Run WCF ServiceHost with multiple contracts

前端 未结 8 2217
长发绾君心
长发绾君心 2020-11-27 14:09

Running a ServiceHost with a single contract is working fine like this:

servicehost = new ServiceHost(typeof(MyService1));
servicehost.AddServiceEndpoint(typ         


        
8条回答
  •  -上瘾入骨i
    2020-11-27 14:16

    I found another solution to for this issue by using a the RoutingService class. Each contract must still be hosted in it's own ServiceHost, but there can be a RoutingService sitting on top of all of them - and presenting them over an unified "endpoint". I've also written a codeproject article about it. The example code is also available on Bitbucket.

提交回复
热议问题