0

我正在尝试使用使用 JavaScript 以 Java 构建的 Axis 服务。

一切都很好,除了一个要求apachesoap:Map类型的搜索操作。这是该操作的 WSDL 部分:

<wsdl:message name="queryRequest">
   <wsdl:part name="collection" type="xsd:string"/>
   <wsdl:part name="service"type="xsd:string"/>
   <wsdl:part name="lang" type="xsd:string"/>
   <wsdl:part name="nameToValsMap" type="apachesoap:Map"/>
   ...

有什么方法可以使用 JavaScript 传递这种类型的数据?

4

1 回答 1

0

apachesoap:Map is a complex type (an element) as opposed to xsd:string which is a value.

If I'm not mistaken apachesoap refers to the http://xml.apache.org/xml-soap namespace. You are probably calling some legacy SOAP web service that exposes a java.util.Map directly (very bad for interoperability if I'm not mistaken).

The WSDL <types> should contain the definition for the complex type apachesoap:Map and should look something like this in the message (the WSDL should tell you the exact form):

<nameToValsMap>
  <item>
    <key>...</key> 
    <value>...</value> 
  </item>
  ....
  <item>
    <key>...</key> 
    <value>...</value> 
  </item>
</nameToValsMap>
于 2013-01-12T14:18:06.053 回答