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
Expand all | Collapse all

Process special characters in XML with Flow Service

  • 1.  Process special characters in XML with Flow Service

    Posted Mon November 03, 2003 07:17 PM

    I have some special characters in item description element in my xml file. This produced an error when processing this xml file in webMethods.

    For example:
    <ItemDesc xml:lang=“eng”>AmpliWax &#153 PCR Gem 100</ItemDesc>
    The error message is: Element <ItemDesc> is missing end tag…

    Anyone encoutered similar situation and can advise on this?
    Thanks,

    J-


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


  • 2.  RE: Process special characters in XML with Flow Service

    Posted Mon November 03, 2003 08:01 PM

    To get rid of this exception set (Encode parameter to “true”)which is in the pub.web:recordToDocument (IS4.6 service) or DocumentToXMLString (IS6.0 service).

    HTH.


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


  • 3.  RE: Process special characters in XML with Flow Service

    Posted Mon November 03, 2003 08:54 PM

    Thanks,

    I have xmlString come into the following service:
    xmlStringToXMLNode
    xmlNodeToDocument
    documentToXMLString

    it is failing on xmlNodeToDocument. What encoding should I use in xmlStringToXMLNode?


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


  • 4.  RE: Process special characters in XML with Flow Service

    Posted Mon November 03, 2003 09:00 PM

    In xmlStringToXMLNode service specify encoding to “UTF-8” and also set
    isXML to “true”

    HTH.


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


  • 5.  RE: Process special characters in XML with Flow Service

    Posted Mon November 03, 2003 09:52 PM

    Yes. I did…but the same error message produced…


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


  • 6.  RE: Process special characters in XML with Flow Service

    Posted Mon November 03, 2003 10:33 PM

    Actually your receving xml should expect like this

    <itemdesc>AmpliWax &#153 PCR Gem 100</itemdesc>

    Then only webMethods can parse the xml document and get validated.Please make sure the xml should be html encoded for the special characters like (&,>,<) == (& and > and <).Please make sure this.

    And similarly while sending the same XML document contains with special characters (&,<,>) to the outside world
    set (encode parameter to “true”)which is in the documentToXMLString service which will show (&,<>).

    HTH.


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


  • 7.  RE: Process special characters in XML with Flow Service

    Posted Mon November 03, 2003 11:31 PM

    I tried <itemdesc>AmpliWax &#153 PCR Gem 100</itemdesc> this already. The same error message produced.

    The special character here to pass is the trademark. While the html encoding works for html client like IE, not for webMethods. When webMethods receives this xml string, & is not & and it stays the same. Trademark html encoded is &#153. If you change that & to & then the original data is altered and in html client the trademark will not be shown but &#153.

    The workaround is to use CDATA section to enclose this and make it unparsed. But this doesn’t seeem to be a not good solution to me.
    Thanks.

    J-


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


  • 8.  RE: Process special characters in XML with Flow Service

    Posted Mon November 03, 2003 11:42 PM

    <itemdesc>AmpliWax &#153 PCR Gem 100</itemdesc>.This worked pretty fine.


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


  • 9.  RE: Process special characters in XML with Flow Service

    Posted Mon November 03, 2003 11:52 PM

    Thanks … after the service reloaded, it works fine and thanks so much…


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


  • 10.  RE: Process special characters in XML with Flow Service

    Posted Mon November 10, 2003 08:27 PM

    it works fine in webMethods…but…

    when the data is presented in IE, the trademark is not shown but &#153.
    I believe only & is encoded and not all the special characters. Therefore, this html encoding doesn’t solve the problem in the first place.


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


  • 11.  RE: Process special characters in XML with Flow Service

    Posted Tue May 25, 2004 12:11 PM

    I’m facing a problem where an external system (third party vendor) is sending in a request XML to our webMethods IS service called ABC. Basically this service receives an object as input and the structure is as follows:

    –savePipelineToFile
    –xmlNodeToDocument
    –customEventLogToFile
    – etc etc etc…

    The problem occurs when there is a special character like &, <,>, " within the XML message sent to ABC via HTTP. The third party vendor provided the XML file they generated before passing to webMethods IS (OutputXML.xml) which I used to test ABC with. Using Developer, I used “Send XML File” to test and it passes through the whole service successfully. However, when the external system passes the same XML via HTTP, it fails at the xmlNodeToDocument step above. The content of the saved pipeline file having the special characters (at custName tag) shows that the strange tags </value> <array name=$xmldataList" type=“value” … were added at the point where the HTML-encoded ampersand was. FYI, I have set makeArrays parameter within that xmlNodeToDocument to false, however the arrays parameter have some values.

    One thing I would like to know is, does wM IS automatically do parsing when saving the pipeline to file? Other transactions sent in without special characters have not faced this problem. From OutLookXML.xml it seems that the third party provider is doing the right thing by HTML-encoding the ampersand to & which has lead both the third party vendor and I to a deadlock situation.

    –Kelvin


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