Pawan
Pawan

Reputation: 32321

How to include a XML Tag with in the SOAP Request

I have a simple SOAP request , as shown below

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.bayer.com/" xmlns:chim="http://scivantage.com/tata">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:strategy>
         <request>
            <xmlMessage>?</xmlMessage>
          </request>
      </ser:strategy>
   </soapenv:Body>
</soapenv:Envelope>

In the Simple SOAP Request above within the xmlMessage Tag , i need to include the following XML data

<accountid>384</accountid>
<userid>testuser</userid>

Please tell me how can i include these two tags with in the question mark here ??

Upvotes: 0

Views: 4726

Answers (1)

djserva
djserva

Reputation: 395

You can use CDATA (where the text is not parsed) and re-parse the xmlMessage on client. See:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.bayer.com/" xmlns:chim="http://scivantage.com/tata">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:strategy>
         <request>
            <xmlMessage><![CDATA[<accountid>384</accountid><userid>testuser</userid>]]>/xmlMessage>
          </request>
      </ser:strategy>
   </soapenv:Body>
</soapenv:Envelope>

Upvotes: 2

Related Questions