Display UTF-8 in XMLString

Hi,

I am using the documentToXMLstring for generating the XMLString which will be posted to MQ Queue for target system to consume.

Currently this xml failing since encoding type utf-8 is not explicitly defined in ESB generated XML.

Can you please suggest is there any way to generate the xmlstring with “utf-8” explicitly defined in ESB?

if there is no other way then I should define the encoding attribute field in document itself or use the find and replace string.

Can any one suggest the right way to generate explicit UTF-8 in xmlstring.

Thanks,
AG

Hi,

does your xml string contain a <?xml version="1.0"?> header?

If so it should also contain an encoding="UTF-8" atttribute.
Is there a property encoding on the documentToXMLstring?
If so, set this to UTF-8 to enforce UTF-8 format.

Is the ESB UTF-8 aware (via codepage)?

Regards,
Holger

Hi Holger,

Thanks for your response.

Yes, the generated XML is having header. please find the same in below

<?xml version="1.0"?>

testing
testing2

Yes, documentToXMLstring service encode property set as “true”

Am not understanding your question as below,

If so, set this to UTF-8 to enforce UTF-8 format. ===> Where to set it in documentToXMLstring service.

Is the ESB UTF-8 aware (via codepage)? ===>Can you please elaborate little more.

Thanks,
AG

Hi Holger,

I got the solution now.

I have used the “pub.xmldata:setAttributeservice” before invoking “documentToXMLString” service to set the UTF-8 explicit declaration in xmlstring.

its resolved my issue.

<?xml version="1.0" encoding="utf-8"?>

testing
testing2

Thanks,
AG