Discussion

2
Replies
1666
Views
KrushanthanR Member since 2010 9 posts
Virtusa (pvt) Ltd
Posted: 4 years ago
Last activity: 4 years 10 months ago
Closed

How to pass XML string as an request parameter to a SOAP service

Hi All,

We are using Connect-SOAP to communicate with an external service provider. One of the request paramter expects an xml string. I have prepared an xml string using XML Stream rule and tried to pass that string as the request. In the tracer I've noticed that "<" and ">" charectors were replaced by "&lt;" and &gt; in the request xml string. I learnt that this is an expected behaviour as per the XML 1.0 guidelines.

(Ex: &lt;safetyreport>&lt;occurcountry>US&lt;/occurcountry>&lt;reporttype>Spontaneous&lt;/reporttype>&lt;serious>true&lt;/serious>&lt;/safetyreport>)

http://www.w3.org/TR/2008/REC-xml-20081126/#syntax

As per the guideline we need use CDATA section to pass the xml string inside an xml node. So I tried to append the request string as follows.

"<![CDATA["+Param.RequestStr+"]]>"

When I use this I am seeing the request xml as below.

&lt;![CDATA[&lt;safetyreport>&lt;occurcountry>US&lt;/occurcountry>&lt;reporttype>Spontaneous&lt;/reporttype>&lt;serious>true&lt;/serious>&lt;/safetyreport>]]&gt;

Can someone help me to pass the xml string in the correct format?

 

Data Integration
Moderation Team has archived post
Share this page LinkedIn