【发布时间】:2012-06-10 14:23:36
【问题描述】:
我需要与 SOAP 服务进行交互,但在这样做时遇到了很多麻烦;非常感谢对此的任何指示。原来的错误信息是:
org.apache.axis2.databinding.ADBException: Any type element type has not been given
经过一番研究,原来这是SUDS和服务器对如何处理的分歧
type="xsd:anyType"
关于有问题的元素。
我已确认使用 SOAPUI,并在建议可以通过以下步骤解决问题后:
- 向每个导致问题的元素添加 xsi:type="xsd:string"
- 将 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 添加到 SOAP 信封
那么,SUDS 目前在哪里这样做:
<SOAP-ENV:Envelope ... xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<ns3:Body>
<ns0:method>
<parameter>
<values>
<table>
<key>EMAIL_ADDRESS</key>
<value>example@example.org</value>
</table>
</values>
</parameter>
</ns0:method>
它应该产生这个:
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" ... xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<ns3:Body>
<ns0:method>
...
<parameter>
<values>
<table>
<key xsi:type="xsd:string">EMAIL_ADDRESS</key>
<value xsi:type="xsd:string">example@example.org</value>
</table>
</values>
</parameter>
</ns0:method>
有没有正确的方法来做到这一点?我看到了使用 ImportDoctor 或 MessagePlugins 的建议,但还没有真正了解如何达到预期的效果。
【问题讨论】: