Creating EDI large documents

I have a question that is related to creating an EDI document in webMethods IS and sending it out through TN.

I have a service that pulls data from a database and then needs to format the records into an EDI 867 document. My concern is that the number of records I get from the database could get very large. So instead of getting all of them at the same time, I would like to read them one at a time, convert each record into some edi string using convertToString.

Can somebody tell me a way to do this ? I dont think I can call convertToString in a loop concatenating the results from each call and still end up with a valid edi document as some segments and control numbers get duplicated.

Is there a way to achieve this ?

Hey Rupinder

You can call the converttoString in a Loop, for more details/help check the Service Tutorial.XMLtoEDI:processXMLSource under EDI Samples package.



Thanks Uday,

But the sample is not sufficient for my needs. Instead of creating individual documents from each row I want to be able to create one EDI document from all rows. And I dont have the rows in a list.

So what I want to do is something like this :

    1a. Get the next record from database
    1b. Add it to the EDI document

  2. create group for EDI document

  3. Create envelope for EDI document

  4. Send document


What kind of this rows are? Are they records of IDOC or any other RDBMS record or XML records?