开发者

Can I have multiple .svc files in one virtual directory under IIS in WCF?

Can I have multiple .svc files in one virtual directory under IIS in WCF? If 开发者_如何学运维so how?


You need to have two service contracts and in the web.config section you need to have the two services registered:

<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>

Then you could have two .svc files for each of your services.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜