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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
Expand all | Collapse all

Changing the XML content

  • 1.  Changing the XML content

    Posted 04/13/05 07:02 AM

    Hi
    Im trying to send XML document as an attachment using SMTP in webMethods.
    But the XML file has the content like Firstname “ampersand in symbol format” Lastname because it is fetched from database since xml does not allow this tag with ampersand error occurs.
    I want to know how it can dynamically be changed in the Flow Service to Firstname & Lastname before emailing that document.

    Any inputs will be of great help.

    Thanks in Advance,
    Solomon.


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


  • 2.  RE: Changing the XML content

    Posted 04/13/05 03:22 PM

    Solomon,

    What you have to do when you use the recordToDocument(4.6) or XMLDocumentToXMLString(6.x) and set the input parameter encode=true the output xmldata will encode the ampersand to &in the xmldata.

    HTH,
    RMG.


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


  • 3.  RE: Changing the XML content

    Posted 04/13/05 04:08 PM


  • 4.  RE: Changing the XML content

    Posted 04/13/05 10:06 PM

    I wonder why encode=true isn’t the default? I cannot think of a case where encode should be false (other than for efficiency when one is absolutely sure the source data will not have special chars).


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


  • 5.  RE: Changing the XML content

    Posted 04/14/05 12:05 AM

    Rob,

    If we set encode=true explicitly then only the output xmldata encoded as expected for special charectors(",>,< etc…)that is how the service works.

    HTH,
    RMG


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


  • 6.  RE: Changing the XML content

    Posted 04/14/05 03:42 PM

    “If we set encode=true explicitly then only the output xmldata encoded as expected for special charectors(”,>,< etc…)that is how the service works."

    I don’t understand what you’re trying to say. Can you rephrase? Do you have an example of when it is desirable to have encode=false?


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


  • 7.  RE: Changing the XML content

    Posted 04/14/05 04:05 PM

    Rob,

    Sorry for not clear.

    Unless we set explicity encode=true,then only DocumentToXMLString xmldata output converts & to & and when encode=false it shows & symbol in the xmldata.

    You may also check the same.

    HTH,
    RMG


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


  • 8.  RE: Changing the XML content

    Posted 04/14/05 07:41 PM

    I see, you were describing the functionality of documentToXMLString. I think I have a pretty good handle on that.

    My question was “why is false the default for encode?” IMO, having the default be false only creates problems–having ‘&’ (or any of the other characters that need to be converted to character entities) appear within XML is never valid. IMO, encode should default to true.


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


  • 9.  RE: Changing the XML content

    Posted 04/14/05 08:06 PM

    You are right encode should be default to true,but it not the way working right now.


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


  • 10.  RE: Changing the XML content

    Posted 04/21/05 08:33 AM

    Is there anything called XMLdocumentToXMLString in webMethods 4.6 or anything similar to this.


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


  • 11.  RE: Changing the XML content

    Posted 04/21/05 03:02 PM

    In 4.6 it is recordToDocument service located in WmPublic/web folder.


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