webMethods

webMethods

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.

 View Only
  • 1.  XML Parsing for special characters

    Posted Wed January 14, 2009 04:33 PM

    Hi Experts,

    We have a requirement for sending a xml which comes from sap as an idoc(message type remains same for 3 vendors) to 3 different vendors.

    First two should receive the xml as iso-8859-1 encoding.

    Third one should receive the xml as UTF-8 encoding.

    When we receive the idoc, routing rules are matched then it comes to our main service in which we defined a service pub.sap.encode and given encoding as iso-8859-1and successfully sent the idoc converted xml to First two vendors in iso-8859-1 encoding.

    For third vendor the same xml(iso-8859-1 ) has been encoded to UTF-8 in documentToXMLString and XMLStringToXMLnode (specified encoding as UTF-8) services.

    The result xml is showing encoding as UTF-8, but it consists all the special characters.

    Could anyone suggest us how to resolve this issue.

    Thanks.


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


  • 2.  RE: XML Parsing for special characters

    Posted Wed January 14, 2009 08:13 PM

    Hi,

    Did you set “encode” to true when you call documentToXMLString ?

    Thanks

    Guixia


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


  • 3.  RE: XML Parsing for special characters

    Posted Thu January 15, 2009 01:37 AM

    Yes, we set “encode” to true when we call documentToXMLString


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


  • 4.  RE: XML Parsing for special characters

    Posted Mon January 19, 2009 08:58 PM

    you need to create java service to do the encoding conversion.
    check java.nio.charset.Charset, java.nio.charset.CharsetDecoder, java.nio.charset.CharsetEncoder.

    by changing the encoding on the xml tag you won’t change the encoding of the content.


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


  • 5.  RE: XML Parsing for special characters

    Posted Mon January 19, 2009 10:31 PM

    The encode parameter controls the conversion of characters that have special meaning in XML to character entities. e.g. the ‘&’ is “encoded” into ‘&’. The encode parameter of documentToXMLString has nothing to do with the character set encoding.


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