我正在尝试使用WCF .Net 4.0客户端来使用NuSOAP / 0.7.2(1.94)Web服务。首先,Web服务不是基于当前的SOA标准,因此我必须创建一个自定义编码器来处理ISO-8859-1消息编码。当我收到响应时,WCF会抛出以下异常
“反序列消息正文中的错误”
在查看SOAP正文时,我看到<SOAP-ENV:Body>... stream ...</SOAP-ENV:Body>
有没有人遇到过这个错误?任何反馈或正确方向的观点都将受到极大的赞赏。这是我第一次对“非”WCF服务的WCF。
ApplicationData
TraceData
<DataItem>
<MessageLogTraceRecord Time="2010-07-14T19:14:36.4832868-07:00" Source="TransportReceive" Type="System.ServiceModel.Channels.StreamedMessage" xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace">
<HttpResponse>
<StatusCode>OK</StatusCode>
<StatusDescription>OK</StatusDescription>
<WebHeaders>
<X-SOAP-Server>NuSOAP/0.7.2 (1.94)</X-SOAP-Server>
<Content-Encoding></Content-Encoding>
<Content-Length>496</Content-Length>
<Content-Type>text/xml; charset=ISO-8859-1</Content-Type>
<Date>Thu, 15 Jul 2010 02:14:36 GMT</Date>
<Server>Apache/2.0.54 (Unix) mod_ssl/2.0.54 OpenSSL/0.9.7a PHP/4.3.11</Server>
<X-Powered-By>PHP/4.3.11</X-Powered-By>
</WebHeaders>
</HttpResponse>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="https://www.datatranswebedi.com/soapv2/">
<SOAP-ENV:Header></SOAP-ENV:Header>
<SOAP-ENV:Body>... stream ...</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</MessageLogTraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
提前致谢, 布伦南
答案 0 :(得分:2)
答案 1 :(得分:1)
我必须做同样的事情(针对另一个传统类型的webservice),我最初遇到了问题。
我遇到了这篇优秀的博文WCF: Text Message Encoding and ISO-8859-1 Encoding,其中描述了为WCF实施自定义文本编码器时的一些陷阱 - 这可能会对您有所帮助吗?
同时查看以前关于同一主题的Stackoverflow问题: