在 SOAPUI 中生成 arrayofstring 类型的请求
我正在尝试在 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 类型,但无法获得有关其用法的良好解释。
有人可以帮助我吗?
I am trying to generate the SOAP Request inside SOAP UI Tool. The SOAP Request look like
<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>
I am not able to understand how to pass values for opt and uri?.
I tried giving array of uri as
<uri>
<url>url 1</url>
<url>url 2</url>
</uri>
Which is wrong !.
I am also trying to search about ArrayOfString type but couldn't get a good explanation about it's usage.
Can some one help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下代码将适合您,
The following code will work for you,
天啊,好久没看到这个了。你得到的是一个 SOAP 数组,我猜其中
ArrayOfString
是soapenc:Array
的子类型。您可以找到的最佳信息来源是 SOAP 规范本身,第 5.4 节.2.数组。
但请注意,SOAP 数组是一个奇怪的野兽,由于对它的理解不正确,它产生了一些问题。事实上,WS-I Basic Profile 不鼓励使用它 ,因为有更好的方法来声明数组(使用带有
maxOccurs="unbounded"
的元素)。如果您可以控制网络服务,我建议将其更改为无限的元素列表。
OMG, haven't seen that in a while. What you got there is a SOAP array with
ArrayOfString
being a subtype ofsoapenc:Array
I guess.The best source of information you can find is the SOAP specification itself, section 5.4.2.Arrays.
But do note that the SOAP array is a strange beast and because it was improperly understood, it generated some problems. For that fact, the WS-I Basic Profile discourages its use, since there are better ways of declaring arrays (using elements with
maxOccurs="unbounded"
).If you have control over the web service, I would suggest to change that to an unbounded list of elements.