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

XML File Output

  • 1.  XML File Output

    Posted 02/11/03 09:18 PM

    Authentication Error

    You must enter something as your username.
    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 2.  RE: XML File Output

    Posted 02/11/03 10:14 PM

    I am currently outputting the following first line in an xml string that I am creating using the documentToXMLString service in webMethods 6.0:

    I would like to have the encoding data displayed as well just like the example below:

    How can I format this line using webMethods 6.0 without using a replace function.


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


  • 3.  RE: XML File Output

    Posted 02/11/03 10:18 PM

    Sorry here is what the samples should look like:

    Current

    text = xml version=“1.0”

    Desired:

    text = xml version=“1.0” encoding=“UTF-8”


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


  • 4.  RE: XML File Output

    Posted 02/11/03 10:22 PM

    attrPrefix can be used for this. You can add the value xml version=“1.0” encoding=“UTF-8” to attrPrefix in the recordToDocument step.
    Thanks


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


  • 5.  RE: XML File Output

    Posted 02/11/03 10:42 PM

    Once I add the value you specified, how do I have it merged into my xml string?


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


  • 6.  RE: XML File Output

    Posted 02/11/03 10:52 PM

    you can do a

    1. stringToDocument input will be the xmlstring that you created
    2. Document to Record
    3. recordToDocument - it is in this step that you give the value for attrPrefix - the output of this step is a valid xml document

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


  • 7.  RE: XML File Output

    Posted 02/12/03 12:01 AM

    I am using the 6.0 documentToXMLString Service which has an output of type String called xmldata I set the attrPrefix however it did not add it to the xmldata string it still only displayed xml version 1.0

    Any ideas


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


  • 8.  RE: XML File Output

    Posted 02/12/03 12:40 AM

    Add a String with the value of @encoding with the value that you want.

    There’s an example of how to include the version in the Built-in services users guide in the XML Folder section.


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


  • 9.  RE: XML File Output

    Posted 02/12/03 11:24 AM

    Any field with the attrPrefix (which defaults to ‘@’) that exists in the top level Record that is passed to documentToXMLString will be added to the XML prolog.

    You can use a Flow Map Set operation to add this field.


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


  • 10.  RE: XML File Output

    Posted 02/12/03 03:31 PM

    The documentToXMLString hasthe following Service IN parameters:

    attrPrefix - String
    document - Document
    nsDecls - Document
    addHeader - String
    encode - String
    documentTypeName - String
    generateRequiredTags - String
    enforceLegalXML - String
    dtdHeader - Document
    bufferSize - String

    My input is a recordlist of data, are you saying I should add a field to the top level of this recordlist as @encoding and set the value to xml version 1.0 encode utf-8? And this will populate my record with the proper header?


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


  • 11.  RE: XML File Output

    Posted 02/12/03 04:34 PM

    Add the value ‘’ (please take out the apostrophies) to the attrPrefix variable.
    Thanks


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


  • 12.  RE: XML File Output

    Posted 02/12/03 04:37 PM

    You’ll want to map in a String field into the document input. So using the example from the built-in services guide, the ‘document’ input will have the following structure:

    document
    @version 1.0
    @encoding UTF-8
    AcctInfo whatever data you have

    The attrPrefix input defaults to @, but you can change it to something else. For example setting attrPrefix to __Attr, the encoding key would need to be changed to __Attrencoding to get it inserted as an attribute. The resulting XML string would be:

    <?xml version="1.0" encoding="UTF-8"?>< AcctInfo/>
    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 13.  RE: XML File Output

    Posted 02/12/03 04:44 PM

    Add the value '<?xml version=“1.0” encoding=“UTF-8”?> ’ (please take out the apostrophies) to the attrPrefix variable.
    Thanks


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


  • 14.  RE: XML File Output

    Posted 02/12/03 05:14 PM

    Note that attrPrefix is used in a startsWith test on each key in the IData to see if the entry should be an element or an attribute. Changing this means that you have also set the corresponding attrPrefix in documentToRecord or generated you own IData data using a different naming convention.


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