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

Urgent Plz nested arrays in XML

  • 1.  Urgent Plz nested arrays in XML

    Posted Thu September 09, 2004 01:09 PM

    I have a temp record list having two records with structure like
    tmp2
    –text
    –amt
    my xml is having nested array structure like

    <parent1>
    –<parent2>
    –text
    –amt
    –vat
    –subtot

    so i’m trying to loop at /tmp2 (in-array)
    (out-array = /parent1/parent2)
    inside a map i’m mapping those text and amount fields but it’s not creating parent2 node at all

    Kindly shower ur valuable inputs…
    awaiting ur replies…
    -SK


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


  • 2.  RE: Urgent Plz nested arrays in XML

    Posted Thu September 09, 2004 02:53 PM

    Sreedhar,

    The loop you set will not work.since parent2 will not seen as a record inside the loop and ultimately parent2 node will not be created as expected.

    But if parent1 is a record and parent2 is a Array then your loop will definetely work.

    So you have to use appendToRecordList since the parent1 and parent2 both are nested record lists.

    I believe you know before how to use this append service.

    HTH,
    RMG


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


  • 3.  RE: Urgent Plz nested arrays in XML

    Posted Fri September 10, 2004 08:54 AM

    Sreedhar,

    Another way to do this would be to delete your references to parent 1 and parent 2 (including within the loop). Then create a temporary record structure for parent1 and parent 2 and set some dummy values for text and amt. Make sure define more than 2 values for parent 2 to ensure that webMethods treats this as record list. This step should exist before your loop. Then specify your loop, in array and out array and then map the values. After you have done this, delete the step where you have assigned temp values for parent 1 and parent 2. Then it will work.

    The reason you are getting the error is that, simply by putting parent 2 in the out array will not mean that wM will treat this as a list. So all this work around of first defining the temp values.

    -Rajesh Rao


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


  • 4.  RE: Urgent Plz nested arrays in XML

    Posted Fri September 10, 2004 12:00 PM

    Thanks RMG. It worked

    Rajesh - I couldn’t understand you. Could you pls explain further ? though i got it worked thru’ RMG’s input, i just want to know ur input aswell…

    Thanks
    Sreedhar Kurella


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


  • 5.  RE: Urgent Plz nested arrays in XML

    Posted Fri September 10, 2004 12:51 PM

    Sreedhar,

    Like what I already have explained,

    Delete all references to parent 1 and parent 2 record structures. This means delete all the steps which refer to this record structure.

    Add a map step (Step 1). Create a record structure for parent1 and parent 2 and set some (dummy) values for text and amt.

    Then add the loop step after the previous map step.

    Specify the in array and out array.

    Add a map step within the loop. In this map step map the appropriate variables. (From tmp2 to Parent 2)

    Then delete the map step 1, where you have specified dummy values for parent 2.

    Hope it is more clearer now.

    -Rajesh Rao


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


  • 6.  RE: Urgent Plz nested arrays in XML

    Posted Fri September 10, 2004 02:55 PM


  • 7.  RE: Urgent Plz nested arrays in XML

    Posted Mon September 13, 2004 02:54 PM

    hey,

    appendToRecordlist worked fine and after that i’m trying to convert to XML through recordToDocument with following parameters :

    Incoming invoice structure to boundnode
    addHeader – false
    encode – true
    recordName – Record.XMLSchemas:Invoice (correct path)
    generateReqTags – true

    and after this i’m concatenating the XML header manually with header as <?xml> , just to include that encoding ISO stuff.

    but in the xmldata hasn’t got lineitems which are in boundNode and Invoice structure aswell…! Could you please tell me why those line items are getting stripped off…?

    Thanks
    Sreedhar Kurella


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


  • 8.  RE: Urgent Plz nested arrays in XML

    Posted Mon September 13, 2004 03:11 PM

    Sreedhar,

    Looks like your recordReference mapped from the boundNode is messing up,please check whether the Record.XMLSchemas:Invoice structure is matching with the boundNode in the pipeline.

    Also try unsetting generateReqTags = true and step thru the recordToDocument.

    And there is some easier way to include XML header with encoding other than concatenating.(create the @encoding in the Document Namespace properly.You must add in the same level as root element of your document. So you can set @encoding in a map of your service, before convert document boundNode to xmldata. This you do like any other element of your document namespace)

    let us know the difference and if possible upload a screen shot of the the recordToDocument Step.

    HTH,
    RMG


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


  • 9.  RE: Urgent Plz nested arrays in XML

    Posted Mon September 13, 2004 03:35 PM

    RMG,

    As you advised, i deleted the SET VALUE for generateReqTags … and following are the line items :

      &#60;invbody&#62; 
    &#60;details&#62; 
    &#60;linedata/&#62; 
    &#60;linedata/&#62; 
    &#60;/details&#62; 
    &#60;/invbody&#62; 
    

    but when I set it to TRUE implicity, the same line items are as follows :

      &#60;invbody&#62; 
    &#60;details&#62; 
    &#60;linedata&#62; 
    &#60;text&#62;&#60;/text&#62; 
    &#60;amount&#62;&#60;/amount&#62; 
    &#60;/linedata&#62; 
    &#60;linedata&#62; 
    &#60;text&#62;&#60;/text&#62; 
    &#60;amount&#62;&#60;/amount&#62; 
    &#60;/linedata&#62; 
    &#60;vatperc&#62;&#60;/vatperc&#62; 
    &#60;vatamt&#62;&#60;/vatamt&#62; 
    &#60;subtot&#62;&#60;/subtot&#62; 
    &#60;/details&#62; 
    &#60;/invbody&#62; 
    

    I have screenshots of recordtoDocument and contents of boundNode after the execution of recordToDocument service.
    Couldn’t upload those doc as it 's exceeding 70 kb…

    RMG - i’m sending it to your email id. Hope you don’t mind…

    Pls let me know your views…

    Thanks
    Sreedhar Kurella


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


  • 10.  RE: Urgent Plz nested arrays in XML

    Posted Mon September 13, 2004 04:35 PM

    Sreedhar,

    The behaviour of generateReqTags is if you want to include empty tags in the xmldata say <vatamt></vatamt> etc… which are mandatory in the document structure then you set to True,otherwise set False.Its upto your target requirement.

    And i have noticed in your screen shot (uploaddoc1) that Roottag of boundNode/Billing but it should be boundNode/Invoice right?

    This might be the reason that it is not showing line details in the xmldata.So the recordName(Record.XMLSchemas:Invoice) you have set is not matching with the boundNode and ultimately xmldata is messing up.

    Please


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


  • 11.  RE: Urgent Plz nested arrays in XML

    Posted Mon September 13, 2004 05:16 PM

    RMG,

    the record name is ‘Invoice’ but the root tag of that record is ‘Billing’ only.

    i.e. when i generated the record from XML Schema, i named the record as ‘Invoice’ but the root tag as per the schema is ‘Billing’.

    Need further inputs…pls
    thakns
    Sreedhar K


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


  • 12.  RE: Urgent Plz nested arrays in XML

    Posted Mon September 13, 2004 05:29 PM

    So you mean record structure is Invoice/Billing and this is mapping to boundNode.

    still wondering what could be the reason of not showing line details in the output xmldata,since everything looks fine in the mapping recordToDocument step as per your clarification.

    If possible mail me ur package i have to look into it.

    Sorry for this delay resolution.

    HTH,
    RMG


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


  • 13.  RE: Urgent Plz nested arrays in XML

    Posted Tue September 14, 2004 05:17 PM

    Hi all,

    Just to let you all know that i’m still stuck with this problem… i’ve been trying to debug and find out but invain …
    any inputs would be very very helpful.
    Thanks in advance
    Sreedhar K


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


  • 14.  RE: Urgent Plz nested arrays in XML

    Posted Tue September 14, 2004 05:54 PM

    Guys,
    it worked…
    guess what change i did ?
    I removed the ‘recordName’ value for recordToDocument service… Proving MURPHY’s law

    donno why it’s working, but it is…

    COULD YOU TELL ME HOW RELIABLE TO USE THIS SERVICE IN THIS WAY ?? ANY DOWNSIDES PLS???

    Thanks once again
    Sreedhar K


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


  • 15.  RE: Urgent Plz nested arrays in XML

    Posted Tue September 14, 2004 11:00 PM

    Sreedhar,

    Its wierd that removing recordName worked as expected,since setting this recordName helps for wellformat,structuring the xmldata based on the record layout.

    I believe there should be some extra stuff coming in the mapping of Invoice struture which is breaking detail structure and that could be missing in the record structure which recordToDocument parses referencing with recordName.

    Anyways it worked go a head with further processing.

    Regards,
    RMG


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