IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
  • 1.  Display UTF-8 in XMLString

    Posted Tue September 19, 2017 01:30 PM

    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


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Display UTF-8 in XMLString

    Posted Tue September 19, 2017 03:42 PM

    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


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 3.  RE: Display UTF-8 in XMLString

    Posted Wed September 20, 2017 08:03 AM

    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


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 4.  RE: Display UTF-8 in XMLString

    Posted Wed September 20, 2017 08:30 AM

    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


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods