Can I have multiple .svc files in one virtual directory in IIS in WCF?

Can I have multiple .svc files in one virtual directory in IIS in WCF? If so, how?

+7
wcf
source share
1 answer

You need to have two service contracts, and in the web.config section you need to register two services:

 <system.serviceModel> <services> <service name="YourNamespace.Service1" behaviorConfiguration="returnFaults"> <endpoint address="" binding="basicHttpBinding" contract="Yournamespace.IService1" /> </service> <service name="YourNamespace.Service2" behaviorConfiguration="returnFaults"> <endpoint address="" binding="basicHttpBinding" contract="Yournamespace.IService2" /> </service> </services> </system.serviceModel> 

You can then have two .svc for each of your services.

+8
source share

All Articles