开发者

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

开发者 https://www.devze.com 2022-12-31 09:17 出处:网络
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 servi

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

精彩评论

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