【发布时间】:2013-06-24 05:53:50
【问题描述】:
大家好,我正在通过 WCF 客户端使用基于 Apache 轴的soap 1.1 服务。问题是 WCF 的内置反序列化器没有解析故障和正常响应,并且在通过 wcf 客户端调用 Web 操作时,我遇到了与 XML 解析相关的异常。当我检查消息时,我得到了这个:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" />
<soapenv:Body>
<V2Response xmlns="urn:ETS">
<V2Return xsi:type="ns1:TResponse" xmlns:ns1="urn:ETS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<fulfilmentRef></fulfilmentRef>
<paymentRef></paymentRef>
<statusCode>2013</statusCode>
<statusDescription>ePayments: Invalid client password specified in request.</statusDescription>
<transactionId xsi:nil="true" />
<transactionTimeStamp>2013-06-21T08:22:16.483Z</transactionTimeStamp>
</V2Return>
</V2Response>
</soapenv:Body>
</soapenv:Envelope>
我得到的例外是:
> The specified type was not recognized: name='TResponse', namespace='urn:ETS', at <V2Return xmlns='urn:ETS'>
我在Reference.cs 中有一个有效的TResponse 类,请让我知道这是否可以通过更改配置来处理,我希望 WCF 客户端解析任何肥皂消息但它不能,我无法更改任何内容服务器端,它是第 3 方 api。
【问题讨论】:
-
你的服务有 WSDL 吗?
-
是的,我有 wsdl,我正在我的 .Net 项目中添加服务参考
-
V2Return 是否继承自 TResponse?
-
TResponse 是一个名为 V2Return 的对象
标签: c# .net wcf axis soap-client