WCF 4 Routing Service - protocol bridging issue

隐身守侯 提交于 2019-12-24 15:24:48

问题


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


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/4086027/wcf-4-routing-service-protocol-bridging-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!