.net 同一合同的两个绑定
我有一份合同,对此我有基本的约束力.net 同一合同的两个绑定,.net,wcf,wcf-endpoint,.net,Wcf,Wcf Endpoint,我有一份合同,对此我有基本的约束力 <endpoint address="http://localhost:49654/BookShopService.svc" binding="basicHttpBinding" contract="BookShop.IBookShopService"> </endpoint> 我想为同一个绑定添加另一个具有wsHttpBinding的端点。 我必须采取哪些步骤?结果地址是什么?只需
<endpoint address="http://localhost:49654/BookShopService.svc" binding="basicHttpBinding" contract="BookShop.IBookShopService">
</endpoint>
我想为同一个绑定添加另一个具有wsHttpBinding的端点。
我必须采取哪些步骤?结果地址是什么?只需添加另一个具有不同地址的端点,它应该如下所示:
<endpoint address="http://localhost:49654/BookShopService.svc" binding="basicHttpBinding" contract="BookShop.IBookShopService">
</endpoint>
<endpoint address="http://localhost:49654/BookShopServiceWS" binding="wsHttpBinding" contract="BookShop.IBookShopService">
</endpoint>
上有一个起始点。只需添加另一个具有不同地址的端点,它应该如下所示:
<endpoint address="http://localhost:49654/BookShopService.svc" binding="basicHttpBinding" contract="BookShop.IBookShopService">
</endpoint>
<endpoint address="http://localhost:49654/BookShopServiceWS" binding="wsHttpBinding" contract="BookShop.IBookShopService">
</endpoint>
上有一个引物。如果您在IIS中运行,则不应提供完全限定的地址-该地址将由IIS确定,因此提供一个地址可能会导致部署问题。所以,以Greg Sansom的回答为基础,我建议
<endpoint address=""
binding="basicHttpBinding"
contract="BookShop.IBookShopService" />
<endpoint address="ws"
binding="wsHttpBinding"
contract="BookShop.IBookShopService" />
其中,ws
是服务位置的相对地址
e、 g
- -basicHttp端点
- -wsHttp端点
<endpoint address=""
binding="basicHttpBinding"
contract="BookShop.IBookShopService" />
<endpoint address="ws"
binding="wsHttpBinding"
contract="BookShop.IBookShopService" />
其中,ws
是服务位置的相对地址
e、 g
- -basicHttp端点
- -wsHttp端点