0

我有一份合同,我有一个 basicHttpBinding。

            <endpoint address="http://localhost:49654/BookShopService.svc" binding="basicHttpBinding" contract="BookShop.IBookShopService">
            </endpoint>

我想为相同的绑定添加另一个带有 wsHttpBinding 的端点。我必须采取哪些步骤?结果地址是什么?

4

2 回答 2

2

只需添加另一个具有不同地址的端点,它应该如下所示:

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

MSDN上有一本入门书。

于 2011-01-10T00:19:55.057 回答
1

如果您在 IIS 中运行,则不应提供完全限定的地址 - 该地址将由 IIS 确定,因此提供一个可能会导致部署问题。所以,以 Greg Sansom 的回答为基础,我建议

<endpoint address="" 
    binding="basicHttpBinding" 
    contract="BookShop.IBookShopService" /> 
<endpoint address="ws" 
    binding="wsHttpBinding" 
    contract="BookShop.IBookShopService" />

wherews是服务位置的相对地址。

例如

于 2011-01-10T00:44:08.073 回答