一个wcf项目中有多个.svc文件 [英] more than one .svc file in one wcf project
本文介绍了一个wcf项目中有多个.svc文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
目前,我正在WCF项目中工作,在其中我必须在一个wcf项目中添加多个以上的svc文件.谁能告诉我这有可能做到吗
感谢
hi all,
currently i am working on WCF project ,where i have to add more than one svc file in one wcf project. can anyone tell me is this possible to do
Thanks
推荐答案
是的,您可以,在这种情况下,每个svc文件都必须使用分隔符"合同".另外,您还应该为每个Conrtact指定单独的"端点".
如下所示.
Well yes you can, In that case every svc file need saprate "Contract". Also you should specify separate "End-Point" for each Conrtact.
Something as below.
<system.serviceModel>
<services>
<service name="MyNamespace.Service1" behaviorConfiguration="MyBehaviorConfiguration">
<endpoint address="" binding="basicHttpBinding" contract="Mynamespace.IService1" />
</service>
<service name="YourNamespace.Service2" behaviorConfiguration="MyBehaviorConfiguration">
<endpoint address="" binding="basicHttpBinding" contract="Mynamespace.IService2" />
</service>
</services>
</system.serviceModel>
是的,您可以拥有许多服务.每个服务只需要一个唯一的名称.
Yes you can have many many services. Each service just requires a unique name.
这篇关于一个wcf项目中有多个.svc文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文