soul

soapui传递数组类型参数

公司有个项目工作需要使用sopui测试webservice接口,将wsdl地址输入到sopui后自动生成请求的xml,默认会将参数项变为?号,如:

 

   <Condition xsi:type="soapenc:string" xmlns:soapenc="https://schemas.xmlsoap.org/soap/encoding/">?</Condition>

         <RequiredItems xsi:type="dat:ArrayOf_soapenc_string" soapenc:arrayType="soapenc:string[]" xmlns:soapenc="https://schemas.xmlsoap.org/soap/encoding/"/>

         <InfoCodeMode xsi:type="soapenc:string" xmlns:soapenc="https://schemas.xmlsoap.org/soap/encoding/">?</InfoCodeMode>


中间参数为string数组,该怎么传值呢?

解决方案如下:

 <Condition xsi:type="soapenc:string" xmlns:soapenc="https://schemas.xmlsoap.org/soap/encoding/">1 = 1</Condition>

         <RequiredItems xsi:type="dat:ArrayOf_soapenc_string" soapenc:arrayType="soapenc:string[3]" xmlns:soapenc="https://schemas.xmlsoap.org/soap/encoding/">

         <item>WYBZ</item>

        <item>LYGS</item>

           <item>ZHDD</item>

         </RequiredItems>

         <InfoCodeMode xsi:type="soapenc:string" xmlns:soapenc="https://schemas.xmlsoap.org/soap/encoding/">0005</InfoCodeMode>

将数组的单标签改为双标签,设置数组需要传递参数的长度,如:3。再添加item子标签,在子标签中设置值。

评论

热度(1)