WCF 4 路由服务 - 协议桥接问题

发布于 2024-09-30 02:28:49 字数 785 浏览 2 评论 0原文

我有以下 WCF 协议桥接方案:使用 basicHttp 绑定的 WCF 客户端与路由服务通信,路由服务使用 netTcp 将请求转发到服务。

客户端 <-> basicHttpBinding (SOAP 1.1) <–> 路由器服务 <–> netTcpBinding (SOAP 1.2) <–> 服务

路由功能可以完美运行,直到我们将服务公开给使用 gSOAP 库将消息传递给服务的 C++ 客户端。如果C++客户端直接与Service通信,则调用成功;但是,一旦它尝试通过路由服务进行通信,就会失败。

服务接收路由消息,但一旦尝试反序列化消息就会抛出异常。从服务返回的错误消息是 System.ServiceModel.Dispatcher.NetDispatcherFaultException,指出 “格式化程序在尝试反序列化消息时引发异常...”

似乎是由协议桥接引起的。如果我不使用协议桥接,即我在整个调用链中使用 basicHttp,则 C++ 客户端(和消息路由)将按预期工作。

我不知道如何解决这个问题。据我了解,路由服务被设计为 WCF 到 WCF 中介,但该问题似乎仅与源自 C++ gSOAP 客户端的调用无关。我尝试使用一些 Web 服务测试工具(soapUI、soapSonar)来查看是否可以复制该问题,但它们似乎工作正常。 任何帮助或指导将不胜感激。

问候, 史蒂夫

I have the following WCF protocol bridging scenario: a WCF Client using basicHttp binding talking to a Routing Service which forwards the request to the Service using netTcp.

Client <-> basicHttpBinding (SOAP 1.1) <–> Router Service <–> netTcpBinding (SOAP 1.2) <–> Service

The routing functionality works perfectly until we expose the service to our C++ client that uses gSOAP library to pass messages to the service. If the C++ client communicates with the Service directly, the call succeeds; however, as soon as it tries to communicate via the Routing Service it fails.

The Service receives the routed message but throws an exception as soon as it tries to deserialize the message. The error message that is returned from the service is a System.ServiceModel.Dispatcher.NetDispatcherFaultException saying the "The formatter threw an exception while trying to deserialize the message…"

The issue appears to be caused by the protocol bridging. If I do not use protocol bridging, i.e. I use basicHttp throughout the entire call chain, the C++ client (and the message routing) works as expected.

I cannot figure out how to resolve this issue. I understand the Routing Service is designed to be a WCF-to-WCF intermediary, but the issue appears to be isolated only to calls originating from the C++ gSOAP client. I've attemped to use some web service testing tools (soapUI, soapSonar) to see if I can replicate the issue, but they seem to work fine.
Any assistance, or guidance would be appreciated.

Regards,
Steve

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

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

发布评论

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

评论(2

在巴黎塔顶看东京樱花 2024-10-07 02:28:49

在联系微软并在Yaron Naveh的帮助下,事实证明这是一个未经证实的 WCF 路由服务中的错误。有关问题发生原因的详细信息,Yaron 有一篇很好的博客文章,详细描述了该问题。

http://webservices20.blogspot.com /2011/01/gsoap-and-wcf-routing-services-are-not.html

感谢所有帮助澄清此问题的人!

此致,

Steve

更新 (04/03/2011): Microsoft 已针对此问题发布了修复程序。 http://connect.microsoft.com/VisualStudio/feedback/details/640260/wcf-routing-services-creates-wrong-message-when-protocol-bridging-is-used

After contacting Microsoft and with the help from Yaron Naveh, it turns out that this is a unconfirmed bug in the WCF Routing Service. For details on why the issue happens Yaron has a nice blog post which describes the issue in detail.

http://webservices20.blogspot.com/2011/01/gsoap-and-wcf-routing-services-are-not.html

Thanks to everyone who helped clarify this issue!

Regards,

Steve

UPDATE (04/03/2011): Microsoft have issued a fix for this issue. http://connect.microsoft.com/VisualStudio/feedback/details/640260/wcf-routing-services-creates-wrong-message-when-protocol-bridging-is-used

篱下浅笙歌 2024-10-07 02:28:49

当使用具有不同传入和传出绑定的任何 RPC 编码的 SOAP 消息时,也会出现此问题。与类型定义关联的命名空间引用在转换过程中丢失。我们创建了一个服务行为扩展,手动添加了命名空间引用。这并不理想,但我们无法更改绑定。我们已将此问题非正式地报告给 Microsoft。

祝你好运

This issue also occurs when using any RPC encoded SOAP messages with different incoming and outgoing bindings. The namespace reference associated with the type definition is lost in translation. We created a service behavior extension that added the namespace reference back in manually. This was not ideal but we could not change the bindings. We have reported the problem informally to Microsoft.

Good luck

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