I was asked to split my WCF service into several different .svc files, one per each logical operation gro开发者_如何学Goup. Now the question is that I must host them in the exact same address
http://somehost/ProjectX/
and I don't really know if I can put them in that exact same route because, although the .svc files have different names, their configuration files all share the name Web.config
. How can I get around this? Should I use
http://somehost/ProjectX/Service1/Service1.svc
http://somehost/ProjectX/Service2/Service2.svc
...
?
The services are able to share the base address by default, they just need to have different contracts (the end bits of the URLs). I wrote a post on this topic, but since then I stop paying for hosting and never had time to migrate the post. The code is still available on github and with a bit of persistence it should be easy to understand how to to that.
The project shows how to host many WCF services in one Windows service. It allows you to do this:
http://localhost:8083/WCFServices/IService1
http://localhost:8083/WCFServices/IService2
http://localhost:8083/WCFServices/IService3
精彩评论