I am implementing the WCF web service, which is responsible for publishing data through REST and SOAP using multiple bindings. The service must be hosted on IIS.
I wrote some WCF services earlier and am a little versed in setting them up using web.config and setting up routes in Global.asax files, however I am confused about how to make the most “clean” configuration or best practice for setting up a WCF service.
Here is what I have understood so far:
Web.config can be used to set bindings, endpoints, security, etc. - Is this necessary when hosting the service in IIS or can the configuration be done in IIS?
Using Global.asax, we can configure routes (and many other things). but is this a suitable place for this?
void Application_Start(object sender, EventArgs e) { RouteTable.Routes.Add(new ServiceRoute("Service", new WebServiceHostFactory(), typeof(Service))); }
I spent some time searching for this topic, and it seems that each link has its own opinion on how to complete the task.
Therefore, I would like to get some information on how to configure / deploy the WCF service to support the following:
For the record, I know how to publish data using SOAP / REST is not a problem. I'm just trying to do the cleanest / minimum configuration for a service.
Any feedback is welcome.
source share