如何通过soapUI将参数作为对象分配给Web服务API?

时间:2012-10-17 05:59:21

标签: soapui

我使用soapUI来测试我的Web服务API,但是某些字段/参数是一个对象而不是标准数据类型,例如

<soapenv:Envelope xml>
   <soapenv:Header/>
   <soapenv:Body>
      <api:test>
         <api:giveMeSomeText>BEEF1234567890</api:giveMeSomeText>
         <api:giveMeJavaURLObject>??????</api:giveMeJavaURLObject>
      </api:test>
   </soapenv:Body>
</soapenv:Envelope>

如何通过soapUI将参数作为对象分配给Web服务API?我可以使用CDATA字符串捆绑我的对象,该怎么做?

<![CDATA[??????]]>

enter image description here

1 个答案:

答案 0 :(得分:0)

您可以使用CDATA,请参阅以下示例

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.example.org/sample/">
   <soapenv:Header/>
   <soapenv:Body>
      <sam:searchResponse>
         <sam:searchResponse>
            <item><id>1234</id><description><![CDATA[<item><width>123</width><height>345</height>
<length>098</length><isle>A34</isle></item>]]></description><price>123</price>
            </item>
         </sam:searchResponse>
      </sam:searchResponse>
   </soapenv:Body>
</soapenv:Envelope>