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.

 View Only
  • 1.  XML Parsing

    Posted Wed April 02, 2008 02:35 PM

    Im accepting a XMLnode back as input to my service. I see that you can use the encode parameter if you use documentToXMLString. The problem I have is that I only have a node. So the only thing I can run is XMLNodeToDocument. Obvsiouly because I have the special characters it blows up everytime. Can’t I convert the XMLNodetoXMLString? Im having issues receiving an XML document from a customer.

    I can’t turn on encode because it does not exist going from XMLNodeToDocument.

    Thanks for any help.


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


  • 2.  RE: XML Parsing

    Posted Thu April 03, 2008 07:22 AM

    The source should send proper XML. You can not manipulate the xml node.

    Cheers
    Guna


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


  • 3.  RE: XML Parsing

    Posted Thu April 03, 2008 08:33 PM

    It turns out they were. But when I went from XMLNodeToDocument it would get rid of the escape characters. Then I would do my updates and convert it back without setting the encode to true in the documentToXMLString service. Thanks for the help. Here is the flow people should be using if they want to catch a document routed from TN.

    How to send a doc to TN: Input of service is node.

    xmlNodeToDocument
    MAP steps…
    documentToXMLString (set encode to true)
    XMLStringToXMLNode
    wm.tn.doc.xml:routeXml

    How to catch doc from TN and WriteToFile :Input of service is node.

    xmlNodeToDocument
    MAP steps…
    documentToXMLString (set encode to true)
    writeToFile (custom util accepting string)


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


  • 4.  RE: XML Parsing

    Posted Thu April 03, 2008 08:54 PM

    Setting encode to true should be the default, IMO. I’m not sure why it is false. I guess avoiding encoding is good when one knows for certain that no characters that need encoding will be encountered. But this is a risky bet, IMO. Invariably, fields that “could never have an ampersand” (or any other special character) end up having one eventually.

    Readers might consider adopting an “always set encode to true” policy.


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


  • 5.  RE: XML Parsing

    Posted Thu April 03, 2008 09:01 PM

    I agree. Its confusing to me why encode itself is an optional field. I imagine there is a good reason just not for the uses that we use it for. There are a bunch of characters that the encode function escapes. We really needed to do it also because the business is expecting a “well formed” XML document, which this creates.


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