将 WCF 服务绑定从 basichttp 更改为 nettcp
将 WCF 服务的绑定从 basichttp 更改为 nettcp 的最简单方法是什么?当然,您不必手动编辑该文件,因为错误范围太大。
What is the easiest way of changing the binding of a WCF service from basichttp to nettcp? Surely you don't have to edit the file manually as there is just too much scope for error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想避免手动编辑引入的错误,我建议使用 WCF 服务配置编辑器。
I recommend using the WCF Service Configuration Editor if you want to avoid errors introduced with manual editing.
您必须编辑某些文件。这取决于您如何定义绑定。如果您通过配置定义它,则需要更改它(从
到
)。如果通过代码定义它,则需要更改源代码(从new BasicHttpBinding()
到new NetTcpBinding()
)。除了这个更改之外,应该就是这样(前提是该服务也有 net.tcp 协议的基地址)。You have to edit some file. It depends on how you define your binding. If you defined it via config, you'll need to change it (from
<endpoint binding="basicHttpBinding" ...>
to<endpoint binding="netTcpBinding" ...>
). If you define it via code, you'll need to change the sourcfe code (fromnew BasicHttpBinding()
tonew NetTcpBinding()
). Besides this change, that should be it (provided that the service has a base address for the net.tcp protocol as well).