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

Handling xml

  • 1.  Handling xml

    Posted Wed July 23, 2003 04:25 PM

    What are the flow services one can use to convert from one xml format into another?

    Thanks,
    mow


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


  • 2.  RE: Handling xml

    Posted Wed July 23, 2003 04:41 PM

    There are many predefined services existing in wmPublic package like…

    In IS4.6 and earlier

    pub.web:stringToDocument (entry for XML document)
    pub.web:DocumentToRecord (Idata record structure)

    Once you have got the appropriate record structure loaded in pipe ,next you need to map with any convertion formats like(internal Defined Canonnical XML,EDI,IDOC…)

    In IS6.0 release (changes in naming convention but behaves same way like in earlier versions)

    pub.xml:XMLStringToNode (entry for XML document)
    pub.xml:XMLNodeToDocument (Idata record structure)

    HTH.


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


  • 3.  RE: Handling xml

    Posted Wed July 23, 2003 05:28 PM

    I am using webMethods 6.0 on unix. My problem is that there is an xml file that can hold differetn transaction types in the same file. I want to extract each of these different transaction types into different document types.Can someone guide me as to how I should use the getxmlNodeiterator and getnextxmlnode to achieve this. Does getnextxmlnode iterate through every child element in the xml?


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


  • 4.  RE: Handling xml

    Posted Wed July 23, 2003 06:11 PM

    yes, getnextxmlnode will iterate child elements(must contain root element in your case transaction type root) in your receving xml and before this we need to specify Critera( Param in getxmlNodeIterator).Hope you followed this convention.

    Sorry if i am missing some thing.


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


  • 5.  RE: Handling xml

    Posted Wed July 23, 2003 07:36 PM

    Thanks, RMG. I am try to find the best way to map an xml document that contains different transactions in the same xml document to differetn target xml types.

    Should I first convert it first into a document and then map it to target xml structures

    OR

    Iterate through the source xml and somehow convert invidual nodes to the target format.

    Any help would be appreciated.

    How does one specify criteria for the getxmlNodeIterator?


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


  • 6.  RE: Handling xml

    Posted Wed July 23, 2003 07:44 PM

    your First option should work fine that to convert it first into a document and then map it to target xml structures.

    Regarding filling criteria (StringList) param (place a map step before getXMLNodeIterator and do a set value to Criteria (pass the child root elements of your xml in your case different transaction types) and map this criteria to NodeIterator (inputParam).

    hope i am not confusing…


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


  • 7.  RE: Handling xml

    Posted Wed July 23, 2003 08:45 PM

    We have a similar situation where I need to get Child element’s NAME & VALUE.

    for eg:
    <reqdoc>
    <orderreq>1111</orderreq>
    </reqdoc>

    As in the above example, the <orderreq> can also be <creditreq> or other requests. What I would like to get is the element NAME(OrderReq or CreditReq) and call the corresponding services…

    Can you describe how the criteria work in the above case.

    Thanks


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


  • 8.  RE: Handling xml

    Posted Wed July 23, 2003 09:00 PM

    Is there any probability that you might get both (OrderReq and CreditReq)?


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


  • 9.  RE: Handling xml

    Posted Wed July 23, 2003 09:28 PM

    For option 1, where i convert the xml node to a document, what should be the label in the inarray statement for a loop step if the document created off the xml structure looks like :

    TransactionContainer
    Transaction
    Transaction[0]
    Transaction[1]
    Transaction[2]




    Transaction[10]
    BatchTotal

    what should be the label for the loop statement
    ( in array) to go through this?


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


  • 10.  RE: Handling xml

    Posted Wed July 23, 2003 09:34 PM

    Hi adb,

    Pls download this Package and hope this is what your expecting using criteria of NodeIterator,

    just i put some skeleton logic and try testing this if it clicks your requirement.

    HTH.

    TestIterator
    TestIterator.zip (3.0 k)


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


  • 11.  RE: Handling xml

    Posted Wed July 23, 2003 09:41 PM

    RMG, what are the ndf and xml files? How can this beimported into wm?


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


  • 12.  RE: Handling xml

    Posted Wed July 23, 2003 09:43 PM

    mow,

    I thought there might be any element in your Trasaction list sounds like eg:<transaction[0]>,<transaction[1]>…so that you can fill label of loop as Transaction and each trasaction iteration will branch on "Type== “Order” or “Sales”…

    Is it what your xml transaction list looks like?


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


  • 13.  RE: Handling xml

    Posted Wed July 23, 2003 09:49 PM

    Every flow service will be internally saved as ndf.node ,flow.xml format, you can find in yourpackage/ns/folder/servicename file folders.

    Hope you are refering this.


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


  • 14.  RE: Handling xml

    Posted Wed July 23, 2003 09:51 PM

    But i am not sure,why you want to import those ndf files to wM.


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


  • 15.  RE: Handling xml

    Posted Wed July 23, 2003 10:12 PM

    sorry i am a novice here. i didnt know how to view the code from the files you sent me. I assumed they had to be imported into wm. Yes, my xml file has a root element called the transactioncontainer and within that there are multiple instances of transaction[0], transaction[1] …etc. The structures of transaction[0] may be diff from transaction[1]. however there is a type attribute on each of these transaction elements which specifies what transaction it is.

    how can i build the loop and the branch for each iteration to call diff serv for diff transactions


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


  • 16.  RE: Handling xml

    Posted Wed July 23, 2003 10:14 PM

    can you please tell me the exact expression i need to put in the loop statement.

    should it be
    %document/TransactionContainer/Transaction/@xsi:type%

    or
    %document/TransactionContainer/Transaction[0]/@xsi:type% with a variable index


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


  • 17.  RE: Handling xml

    Posted Wed July 23, 2003 10:26 PM

    earlier I uploaded the package,just you need to load this TestIterator.zip in webMethods server.

    your loop in array label should be
    /document/TransactionContainer/Transaction
    under Transaction loop place a Branch step on each transaction type
    %document/TransactionContainer/Transaction/@xsi:type% == ‘Order’…


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


  • 18.  RE: Handling xml

    Posted Wed July 23, 2003 10:55 PM


  • 19.  RE: Handling xml

    Posted Wed July 23, 2003 11:02 PM


  • 20.  RE: Handling xml

    Posted Thu July 24, 2003 01:27 AM

    RMG, I got stuck on one point. Since the incoming xml is dynamic, it can have any number of transactions in any order ( and diff trans types),I cannot create a variable of document type to store this xml string in ( after doing a stringtonode and nodetodocument).

    How can I access transaction[i] from this document once I hit it on a branch statement… discussed above.

    Thanks,
    mow


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


  • 21.  RE: Handling xml

    Posted Thu July 24, 2003 01:30 AM

    Just to clarify, I need to access this document type to map to a known document type before converting it to a target xml format.


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


  • 22.  RE: Handling xml

    Posted Thu July 24, 2003 02:17 AM

    Hi RMG,

    Can you please export from wm the testiterator package that you sent earlier. I cannot load it into wm because it is not created with the right package structure.

    Thanks,
    mow


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


  • 23.  RE: Handling xml

    Posted Thu July 24, 2003 03:30 PM

    Hi mow,

    I am successfully able to load and publish the package(using IS4.6) with out any problems,but dont know why its creating problem at your end.

    Hope you are loading this package in IS4.6 server

    Regarding your issue on Transaction[i],can you pls eloborate more.

    TestIterator
    TestIterator.zip (3.4 k)

    Thanks.


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


  • 24.  RE: Handling xml

    Posted Thu July 24, 2003 03:45 PM

    I am using wm 6.0 but will try again. I get the xml string which has these bunch of transactions of different types… structure is :

    transactioncontainer
    transaction[0]
    transaction[1]

    the number and types of transaction[i] can very but the container is fixed. within my subscribing service, i convert the xmlstring to a doc
    and then loop through the doc. I have a branch statement to determine the type within the loop statement. depending on the type, i want to map it to a target document format. this target doc format is diff for each tran type. when i see the input doc in the pipeline, it does not show a structure but as “document” so i cant map it to a target. please let me know if this sounds confusing…


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


  • 25.  RE: Handling xml

    Posted Thu July 24, 2003 04:04 PM

    If possible can you upload your package containing this scenario.i will load it on 6.01 and check it out if any clue.


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


  • 26.  RE: Handling xml

    Posted Thu July 24, 2003 04:26 PM

    RMG, I just got a new idea - will try that and if i get stuck then do the upload. Thankyou so much for your help.


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


  • 27.  RE: Handling xml

    Posted Thu July 24, 2003 04:33 PM


  • 28.  RE: Handling xml

    Posted Fri January 30, 2004 06:24 PM

    Hi
    Professionals
    can anyone tell me whether EDI is a text file with .edi extension or it is different from text file?
    To convert an edi into xml do we need edi Adapters & Templates. If so, from where can i download the templates and how can i configure the adapter.


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


  • 29.  RE: Handling xml

    Posted Fri January 30, 2004 08:26 PM

    Ramesh,

    wM recognizes data by the MIME type. There’s a mime.types file in your IntegrationServer/lib directory. Entries in that file associate MIME types to specific file extensions. If you define *.edi as application/EDI, then wM will properly recognize files with that extension.

    HTH.

    Dave


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


  • 30.  RE: Handling xml

    Posted Tue February 03, 2004 05:16 PM

    Hi Ramesh

    It depends on how you define a text file. :slight_smile:
    An EDI document is a file with text in it which is structured by the EDI standard. As Dave wrote, it doesn’t matter what extension it has as long as the structure is ok. To convert EDI to XML I would create a flat file dictionary of the EDI version that you have to use and a schema of the transaction set that you need. Then you can create a document type of that schema. To create the dictionary and schema use the SEFParse service in WmEDI.wm.b2b.edi how to do is documented in the install directory under \IntegrationServer\packages\WmEDI\pub\doc EDIModuleUsersGuide.pdf
    Then you have to create a document type for the XML file. Click “New”
    –> “Document Type” and follow the instructions. After that you only need to map the data. That’s basically how to convert EDI to XML.


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


  • 31.  RE: Handling xml

    Posted Tue February 03, 2004 10:31 PM

    Hi professionals,
    i am new to webMethods. i am trying to retrieve the individual values of an xml files. I used the sequence of steps as follows\
    1.reading the xml file
    2.using the service XMLStringToXMLNode
    3.validate
    4.XMLNodeToDocument
    5.DocumentToXMLValues
    so i got the xmlvalues as a document.
    here i am trying to access those individual values. can any one suggest help in this regard.

    regards,


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


  • 32.  RE: Handling xml

    Posted Wed February 04, 2004 04:40 PM

    hi professionals,
    i am trying to access the service XMLValuesToRecord to access the xml values. but i am getting this following error.

    [ITD.0024.0001] Cannot access ‘pub.record:XMLValuesToRecord’ without List ACL privileges

    Anyone can suggest me how can i resolve this error. i am waiting here for your early response.

    regards,


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


  • 33.  RE: Handling xml

    Posted Wed February 04, 2004 04:54 PM

    Once you are in with XMLNodeToDocument map this service output IDATA boundnode to a documentReference (This is what the XML document that you have to create first ,which will extract the individual values from the XML file that you are receving).

    Note:Remember you need to create a DocumentType which resembles your receving XML file structure.Then you will be in a good shape to extract the values using XMLNodeToDocument service.

    HTH.


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


  • 34.  RE: Handling xml

    Posted Wed February 04, 2004 04:58 PM

    Finally,

    After you have the DocumentReference (Document) check the pipeline, then you are ready to map the individual values to the target format (Cannonical,EDI,flatfile…) depends on your requirement.

    HTH.


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


  • 35.  RE: Handling xml

    Posted Mon July 05, 2004 07:02 AM

    Hello professionals,
    I am trying to convert the data from database into XML file. Here i followed the following sequence
    1. getData
    2. execSQL
    3. Loop
    documentToXMLString
    appendToStringList
    But i am getting a list of xml files as output. I mean i am getting one XML file for one record in the database. Can anyone suggest me how i get one xml file which contains all records.

    you help is very much needed for me

    with regards,

    Nani


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


  • 36.  RE: Handling xml

    Posted Mon July 05, 2004 08:27 AM

    Try to use appendToDocumentList instead of documentToXmlString & appendToStringList. Then map the resulting documentlist to a documentlist of ur ISDocument & convert that ISDocument to xmlString.I hope this is what u want.


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


  • 37.  RE: Handling xml

    Posted Mon July 05, 2004 01:26 PM

    Hi Gogineni,
    Thank you very much for your help. I got the solution using your help.

    with regards,

    Nani


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


  • 38.  RE: Handling xml

    Posted Thu September 02, 2004 09:23 PM

    Hello:
    Can someone give me a direction on this:

    I pull a Request (RQ) msg off the queue and on a ‘success’ i have to send a response, in which i need to use the same RQ messageheader element, which has the unique msgid,date time stamp etc, to map to response xml message. How do i map it to the RS xml from RQ xml. Till now i have done stringToDocument–>documentToRecord and have the structure, but when i map messageheader from RQ to RS it doesnt map it.

    Also after doing that what are steps i need to do to make this a xmlstring and put it as abc.xml back on the response queue.

    I hope to get some help from here…
    Thank you all, regards…

    Harsh


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


  • 39.  RE: Handling xml

    Posted Thu September 02, 2004 10:12 PM

    Harsh,

    When you are mapping the RQ header to RS Header there might be some record hierrachy issue or else one to one mapping issue.
    What you can do is try to map that msgid,datetime to a separate string variables and map that to RS header.

    And finally make the RS Structure to xml string using recordToDocument (gives xmldata) and put this string in the RS MQ hanlder (Queue).

    If not upload a screen shot of your mapping.

    HTH,
    RMG


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


  • 40.  RE: Handling xml

    Posted Fri September 03, 2004 06:19 PM

    RMG:
    Hey i just got this working! there was a error in the DTD structure for RQ msg after correcting this, the messageheader with all its sub elements maps perefectly to the RS one!
    I used the recordToDocument service on the RS structure, and got a xmldata string out, can you explain little in detail how i can put this as a message back on the queue like abc.xml.
    Thanks so much for you help!

    Harsh


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


  • 41.  RE: Handling xml

    Posted Fri September 03, 2004 07:06 PM

    Harsh,

    yes i too thought that your DTD structure might be messing up when you have created the wm recordtype structure(RS msg).glad you found out.

    Invoke that RSMQhandler service and map this RS xmlstring to the input what ever string or object. and this will put in the queue.

    Actually i dont have mq adapter installed here to tell you in detail but follow the above mentioned comments.

    HTH,
    RMG


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


  • 42.  RE: Handling xml

    Posted Thu March 03, 2005 04:23 PM

    hai,
    Tell me how to create xml document structure in developer.

    with regards,
    venkat


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


  • 43.  RE: Handling xml

    Posted Fri March 04, 2005 03:42 PM

    Venkata,

    You can create new IS DocumentType by using (sample XML or DTD or XML Schema)this will let you create xml doctype automatically using the developer UI,or else create manually by looking into ur xml structure.

    Go thru the ISDeveloper tool userguide for more information.

    HTH,
    RMG.


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


  • 44.  RE: Handling xml

    Posted Fri May 20, 2005 05:30 PM

    Hi Professionals,

    In my project,i have to load the XML files which are stored in a certain directory which i need to load in DB2 database.we have a large xml files of size like(15mb,17mb,20mb…)i am passing the XML node data to getXMLiterator and then routing the document to TN,but the document is not getting published

    2)the settings in TN properties:
    BigDocThreshold : 512288
    tspace location is also defined.


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


  • 45.  RE: Handling xml

    Posted Tue June 28, 2005 11:55 AM

    Hi,
    I loop through a xml file and get a documentList.How do i loop thorough this documentList (in the next flow service)to publish each document in the documentList.Should i convert it to xmlString.
    Please advice.

    Regards,
    Sana


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


  • 46.  RE: Handling xml

    Posted Tue June 28, 2005 01:01 PM

    Hi,
    Continuing with my previous query,the input to my second flow service should be the documentList generated as a result of invoking the appendToDocumentList service in the first flow service.But i notice that the input to the second flow service is a ObjectList and not a documentList which it should be.
    Can anyone let me know how i can go about having a documentList as the input to the second flow service.

    Thanks
    Sana


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


  • 47.  RE: Handling xml

    Posted Fri July 22, 2005 06:30 AM

    Hi,

    I need to take the branch on the output of a procedure , the procedure is fetching the lookup values from the database.
    If all the values are present that is if all the values are fetched successfully, then the process will continue , else it will exit from the flow service.

    Please help me in executing this type of logic in my flow service.


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