我可以在 WCF 中添加带有 netTcpBinding 的服务引用吗?

发布于 2024-08-23 11:28:16 字数 361 浏览 7 评论 0原文

是否可以在Visual Studio中添加服务引用,在使用netTcpBinding时生成本地代理类来调用WCF服务?

据我了解,服务引用方法需要服务公开 WSDL,这仅受 http 绑定支持,不是吗?

也许,我可以在开发中本地添加服务引用,然后在生产中的运行时切换配置以使用 nettcp 吗?

我问的原因是因为我托管在Windows服务中(服务器2003,所以没有WAS,并且不能使用IIS)。而且我们无法更改进行 HTTP 命名空间保留的权限...因此我们无法使用 HTTP 绑定。 NetTcp 可以工作,但在这种特定情况下,我们来回传递的对象图涉及由 EDMX 模型在服务中生成的对象……因此我们无法在合约程序集中共享它。

提前致谢!

Is it possible to add a service reference in visual studio, which generates the local proxy class to call the WCF service when using the netTcpBinding?

As I understood it, the service reference method requires a WSDL to be exposed by the service, which is only supported by the http bindings no?

Perhaps, could I add the service reference locally in development, but then switch the configuration to use nettcp at runtime in production?

The reason I am asking is because I am hosting in a windows service (server 2003, so no WAS, and can't use IIS). And we are unable to change the permissions to do the HTTP namespace reservation ... so we can't use the HTTP bindings. NetTcp works, but in this specific case the object graph we're passing back and forth involves objects generated in the service by an EDMX model ... so we can't share it in a contract assembly.

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

So要识趣 2024-08-30 11:28:16

只需使用 mexTcpBinding 添加绑定即可。

Simply add a binding using mexTcpBinding.

零崎曲识 2024-08-30 11:28:16

是否可以在Visual Studio中添加服务引用,
它生成本地代理类来调用
WCF服务何时使用netTcpBinding?

是的,绝对是!

据我了解,服务引用方法需要 WSDL
由服务公开,该服务仅受 http 绑定支持,不是吗?

不,绝对 - WCF 元数据(无论是其自己的特定格式,还是作为 WSDL / XSD 文件公开)绝对可用于所有基于 SOAP 的调用 - 无论其传输方式如何。

您能向我们展示您在服务器端配置方面拥有什么吗?最有可能的是,您只是缺少一些配置设置或其他内容 - 如果我们看到您拥有的内容,我们也许能够查明这一点并为您提供更多帮助!

Is it possible to add a service reference in visual studio,
which generates the local proxy class to call the
WCF service when using the netTcpBinding?

Yes, most definitely!

As I understood it, the service reference method requires a WSDL
to be exposed by the service, which is only supported by the http bindings no?

No, definitely not - WCF metadata (either its own specific format, or exposed as WSDL / XSD files) is definitely available for all SOAP-based calls - regardless of their transport.

Can you show us what you have, in terms of server-side config? Most likely, you're just missing a little config setting or something - if we see what you have, we might be able to pinpoint that and help you more!

亚希 2024-08-30 11:28:16

所有绑定均通过 WSDL 公开。如果添加 NETTCP 绑定,svcutil 将自动正确生成客户端。我没有在 VS 的 ADD 参考中使用它,因为我一直更喜欢使用 svcutil 生成类。

All bindings are exposed though WSDL. If you add the NETTCP bindings svcutil will atuo generate the client correctly. I haven't used it in the ADD reference in VS as i have always preferred to generate the class with svcutil.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文