Discussion
ACC3 International Inc
US
Last activity: 23 Nov 2015 8:29 EST
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 "<" and > in the request xml string. I learnt that this is an expected behaviour as per the XML 1.0 guidelines.
(Ex: <safetyreport><occurcountry>US</occurcountry><reporttype>Spontaneous</reporttype><serious>true</serious></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.
<![CDATA[<safetyreport><occurcountry>US</occurcountry><reporttype>Spontaneous</reporttype><serious>true</serious></safetyreport>]]>
Can someone help me to pass the xml string in the correct format?