Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SOAP-UI - How to pass xml inside parameter

Tags:

xml

soapui

In SOAP-UI I am making a request to a web service like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xxx="http://xxx.call/">
   <soapenv:Header/>
   <soapenv:Body>
      <cotf:call_XXX>
         <!--Optional:-->
         <arg0>
            <!--Optional:-->
            <parameter1>some text</parameter1>
            <!--Optional:-->
            <parameter2>XML string</parameter1>
         </arg0>
      </cotf:call_XXX>
   </soapenv:Body>
</soapenv:Envelope>

What I would like to know is how I can pass an XML string on parameter 2 since if I put the XML string directly it assumes the XML string nodes as request parameters....

Thanks

like image 415
RedEagle Avatar asked Apr 19 '11 11:04

RedEagle


People also ask

How do I use XML in SoapUI?

To import an existing project file from your computer: Select File > Import Project. Specify a path to the project XML file, or click Browse and navigate to the file manually. Click OK.


2 Answers

Either encode the needed XML entities or use CDATA.

<arg0>
    <!--Optional:-->
    <parameter1>&lt;test>like this&lt;/test></parameter1>
    <!--Optional:-->
    <parameter2><![CDATA[<test>or like this</test>]]></parameter2>
 </arg0>
like image 86
Alin Purcaru Avatar answered Oct 07 '22 02:10

Alin Purcaru


NOTE: This one is just an alternative for the previous provided .NET framework 3.5 and above

You can send it as raw xml

<test>or like this</test>

If you declare the paramater2 as XElement data type

like image 37
Arjun Shetty Avatar answered Oct 07 '22 02:10

Arjun Shetty