0

我正在尝试编写一个 SOAP 调用,示例请求如下:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://server.opsware.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:attachPolicies soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <self xsi:type="xsd:anyType">?</self>
         <policies xsi:type="ser:ArrayOf_xsd_anyType" soapenc:arrayType="xsd:anyType[]"/>
      </ser:attachPolicies>
   </soapenv:Body>
</soapenv:Envelope>

ArrayOf_xsd_anyType关于可能意味着什么或我如何找到有效选项的任何想法?

4

2 回答 2

1

只是为了澄清您的术语,您展示的不是 WSDL,而是 SOAP 服务的示例 SOAP 请求。WSDL 是一个 XML 文档,描述了请求和响应中使用的 XML 类型,以及 PortType、Binding 和 Service 信息。

至于anyType,此链接提供了其用法的清晰概述: https ://www.ibm.com/support/knowledgecenter/SSFTDH_8.0.0/com.ibm.wbpm.main.doc/topics/cbo_usinganytype.html

但是 TL;DR 是这样的:“anyType 允许任何 DataObject 而不管类型如何。如果 maxOccurs > 1,则列表中的每个 DataObject 都可以[是]不同的类型。”

这与仅限于单一类型的“complexType”形成对比。例如,如果您有一个complexType数据数组,则所有数组值必须属于同一类型(“客户”、“地址”等)。

于 2018-11-28T03:45:35.950 回答
1

该名称ser:ArrayOf_xsd_anyType指的是您希望在命名空间的架构中找到的类型xmlns:ser="http://server.opsware.com"

我不知道在哪里可以找到该架构;此消息的收件人应该知道它。也许这个页面有帮助:https ://en.wikipedia.org/wiki/Opsware

于 2018-11-28T09:39:49.440 回答