【发布时间】:2010-05-21 08:07:01
【问题描述】:
我可以在 WCF 的 IIS 下的一个虚拟目录中拥有多个 .svc 文件吗?如果有怎么办?
【问题讨论】:
标签: wcf
我可以在 WCF 的 IIS 下的一个虚拟目录中拥有多个 .svc 文件吗?如果有怎么办?
【问题讨论】:
标签: wcf
您需要有两个服务合同,并且在web.config 部分中您需要注册这两个服务:
<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>
那么您的每个服务可以有两个 .svc 文件。
【讨论】: