我正在尝试在SOAP UI工具中生成SOAP请求。SOAP请求如下所示
<soapenv:Body><pur:purge soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<name xsi:type="xsd:string">?</name>
<pwd xsi:type="xsd:string">?</pwd>
<network xsi:type="xsd:string">?</network>
<opt xsi:type="pur:ArrayOfString" soapenc:arrayType="xsd:string[]"/>
<uri xsi:type="pur:ArrayOfString" soapenc:arrayType="xsd:string[]"/>
</pur:purgeRequest>
我不能理解如何传递opt和uri的值。
我尝试将uri数组作为
<uri>
<url>url 1</url>
<url>url 2</url>
</uri>这是错误的!
我也在尝试搜索ArrayOfString类型,但无法很好地解释它的用法。
有人能帮帮我吗?
发布于 2011-10-20 04:26:44
天哪,好久没见了。我猜您在那里得到的是一个SOAP数组,其中ArrayOfString是soapenc:Array的一个子类型。
你能找到的最好的信息来源是SOAP specification itself, section 5.4.2.Arrays。
但请注意,SOAP数组是一种奇怪的东西,因为对它的理解不正确,所以产生了一些问题。由于有更好的方法来声明数组(在maxOccurs="unbounded"中使用元素),所以还是使用WS-I Basic Profile discourages its use。
如果您可以控制web服务,我建议将其更改为元素的无界列表。
发布于 2012-06-22 06:15:35
下面的代码将为您工作,
<soapenv:Body><pur:purge soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<name xsi:type="xsd:string">?</name>
<pwd xsi:type="xsd:string">?</pwd>
<network xsi:type="xsd:string">?</network>
<opt xsi:type="pur:ArrayOfString" soapenc:arrayType="xsd:string[2]">
<item>Enter the value here..</item>
<item>Enter the value here..</item>
</opt>
<uri xsi:type="pur:ArrayOfString" soapenc:arrayType="xsd:string[1]">
<item>Enter the value here..</item>
</uri>
</pur:purgeRequest>https://stackoverflow.com/questions/7807957
复制相似问题