开发者

Multiple WCF Services

开发者 https://www.devze.com 2023-03-31 12:23 出处:网络
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

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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号