9

我正在使用soap UI(来自smartbear)以xml格式发送soap请求:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsg="http://wsg.hpos.om.hp.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <wsg:abc>
      <wsg:contract>
         &lt;request&gt;

         &lt;request-attributes&gt;
            &lt;message&gt;"this &amp; and that"&lt;/message&gt;                
         &lt;/request-attributes&gt;             
         &lt;/request&gt;             
         </wsg:contract>
      </wsg:abc>
   </soapenv:Body>
</soapenv:Envelope>

并且响应是:无效的请求。你能解释一下如何逃脱吗?谢谢

4

1 回答 1

16

您可以将有效负载包装在里面<![CDATA[]]>而不必担心转义:

<![CDATA[<request>
    <request-attributes>
        <message>"this & and that"</message>
    </request-attributes> 
</request>]]>
于 2015-05-13T15:27:34.823 回答