【发布时间】:2014-04-16 11:31:41
【问题描述】:
我在 C# 中有一个客户端应用程序,它从外部 SOAP 服务调用一些方法。为了使用此服务,我从服务 WSDL 生成了代理类。 除了一项操作外,一切正常。 当我尝试调用此操作时,它会向我抛出 CommunicationException 并显示以下消息:
Error in deserializing body of reply message for operation 'my-operation-name'
InnerException 如下:
The specified type was not recognized: name='arrayList',
namespace='http://www.oracle.com/webservices/internal/literal', at <validationErrors
xmlns='http://view.label.com/types/'>.
我在 WSDL 文件中找到了这个元素的描述:
<element name="validationErrors" type="ns1:list" nillable="true" />
但我看不到对 arrayList 数据类型的任何引用。
这是来自服务的响应:
<env:Envelope
xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns0="http://view.label.com/"
xmlns:ns1="http://view.label.com/types/"
xmlns:ns2="http://www.oracle.com/webservices/internal/literal">
<env:Body>
<ns0:getLabelResponseElement>
<ns0:result>
<ns1:statusMessage>Error while reading xml label request.</ns1:statusMessage>
<ns1:requestId/>
<ns1:payload/>
<ns1:labelId/>
<ns1:status>Error</ns1:status>
<ns1:validationErrors
xsi:type="ns2:list"
xsi:nil="1"/>
<ns1:statusCode>LabelAssembler_03</ns1:statusCode>
</ns0:result>
</ns0:getLabelResponseElement>
</env:Body>
</env:Envelope>
能否请您指出此问题的可能根源?如果这是我的客户端应用程序部分的问题,或者是兼容性问题,因为该服务是用 Java 编写的,而我的客户端应用程序是用 C# 编写的? 提前致谢。
【问题讨论】:
-
你能提供来自 web 服务的 SOAP 响应吗?
-
我已经添加了响应的例子。
标签: c# java web-services soap wsdl