cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass XML as string message in SOAP request CPI ?

senthilmurugan
Participant
0 Kudos

Hello All,

I need to send an XML data as string to third-party system. Below is the sample payload that I can pass from SOAP UI, here I converted the xml payload to string by using CDATA.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:TextXML>
         <tem:xmlFile>
<![CDATA[<ProdCatalog>
  <ArrayOfPCatInfo>
    <PCatInfo>
      <PFC>51</PFC>
      <PF></PF>
      <S>03</S>
      <PC>CAN-LINK II</PC>
      <P>CAN-Link II</P>
    </PCatInfo>
</ArrayOfPCatInfo><ProdCatalog>]]></tem:xmlFile>
      </tem:TextXML>
   </soapenv:Body> 
</soapenv:Envelope>

when I try to achieve the same in CPI, message mapping fails to simulate the data. It seems CDATA is not recognized in message mapping.

Can anyone help here.


Best Regards,

Senthil

Accepted Solutions (1)

Accepted Solutions (1)

Sriprasadsbhat
Active Contributor

Hello Senthil.

Easiest way would be adding content filter and retrieving the text inside CDATA.Below will work for you

1) Add Namespace entry in runtime configuration.

2) Add content filter and get the string output.

Regards,

Sriprasad Shivaram Bhat

Answers (1)

Answers (1)

daviddasilva
Active Contributor

Hi,

Another option is that you could also try encoding the XML payload as a base64, this will make a string that you can send across that can easily be decoded on the receiving side.

Kind regards,

David