Search code examples
ibm-datapower

How to handle special characters (such as "&") in Convert Query Params to XML of datapower


I am new to datapower, so I am sorry its silly question.

I have create one flow in datapower whose request and response type is Non-XML. when I try to post an XML to my flow I am getting following error.

Convert HTTP produced invalid XML: mismatched tag, expected employed_by at offset

here is the sample request XML :-

...
<emp_status type="employed" />
<employed_by>abc &amp; company</employed_by>
<work_phone_no>XXXXX</work_phone_no>
<years_employed>10</years_employed>
<months_employed>10</months_employed> 
...

but If I remove &amp; from the request XML then my flow works fine.


Solution

  • If it is query string then &-sign is %26 and not &amp;!

    If it is non-xml you are going for I'd recommend using GatewayScript instead for all parsing!