Reputation: 2747
What is best practice for naming & hosting a WCF service endpoint in IIS?
Assuming an example scenario of:
Company.Entities.Customer
Company.Entities.Customer.ServiceHost
contains the IIS Host (ie. just the .svc file)Company.Entities.Customer.Service
contains the service implementation (not the hosting)Company.Entities.Customer.ServiceContracts
contains the service contractsWhat would you name:
As examples i am currently tossing up between:
CustomerEntities.svc
Service.svc
(since the service is already definied in the hostname + dir/sitename)Upvotes: 2
Views: 2433
Reputation: 755128
I definitely prefer your cleaner suggestion, #2. It gives you shorter URL's, still has all the relevant info (which customer you're dealing with).
Suggestion #1 is okay because it's very clear and leaves no doubt about what you're dealing with, but it seems overly complicated, too long and gives you too much chances for a typo :-)
Go with #2 if you ask me!
Marc
Upvotes: 2
Reputation: 8039
This being a subjective question, this is a subjective answer:
Personally I preffer a modified version of your second one presented. I sometimes use a sub domain (ws.alexdrenea.eu/Service1) and sometimes just use a virtual directory on the main site (alexdrenea.eu/Service1) with the svc being directly in that folder.
You can name the svc file as you wish but make sure you add it to the default pages in IIS so it can be accessible directly.
Upvotes: 1