Hi all,
I use a AssignMessage policy to return xml payload. How could I insert "<?xml version="1.0" encoding="UTF-8" ?>" in the payload.
When I set this object in AssignMessage policy:
<Payload contentType="application/xml"> <?xml version="1.0" encoding="UTF-8" ?>xxxx </Payload>
Apigee designer display "Invalid XML".
Any idea ?
Thanks
Solved! Go to Solution.
That is invalid XML. It's not valid to include a declaration in the middle of ... an XML Document. The assignmessage configuration is XML, so you can't insert that declaration under <Payload>.
Well, you can't do it in the usual way. But have you tried CDATA?
<Payload contentType="application/xml"><![CDATA[<?xml version="1.0" encoding="UTF-8" ?>
xxxx ]]> </Payload>
CDATA is a way to "escape" whatever is contained within. That might work.