同一个合约的两个绑定
我有一份合同,其中有一个 basicHttpBinding。
<endpoint address="http://localhost:49654/BookShopService.svc" binding="basicHttpBinding" contract="BookShop.IBookShopService">
</endpoint>
我想使用 wsHttpBinding 添加另一个端点,以实现相同的绑定。 我必须采取哪些步骤?结果地址是什么?
I have a contract for which i have an basicHttpBinding.
<endpoint address="http://localhost:49654/BookShopService.svc" binding="basicHttpBinding" contract="BookShop.IBookShopService">
</endpoint>
I want to add another endpoint with wsHttpBinding, for the same binding.
What are the steps I have to take? What would be the resulting address?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需添加另一个具有不同地址的终结点,它应该如下所示:
MSDN。
Just add another endpoint with a different address, it should look like this:
There is a primer on MSDN.
如果您在 IIS 中运行,则不应提供完全限定的地址 - 该地址将由 IIS 确定,因此提供地址可能会导致部署问题。因此,以 Greg Sansom 的答案为基础,我建议
其中
ws
是服务位置的相对地址。例如
If you are running in IIS, then you shouldn't supply a fully qualified address - the address will be determined by IIS and so supply one can cause deployment problems. So, using Greg Sansom's answer as a foundation, I'd suggest
where
ws
is a relative addresses to the service location.e.g.