P_AG
(P AG)
September 19, 2017, 5:30pm
1
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
P_AG
(P AG)
September 20, 2017, 12:03pm
3
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
P_AG
(P AG)
September 20, 2017, 12:29pm
4
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