Trading Networks 10.7 | Administering and Monitoring B2B Transactions | webMethods Module for EDI | Processing Inbound TRADACOMS Documents Using Trading Networks | Coding Services to Process File and Batch Documents When Using TRADACOMS | Logic to Map a File Document to an Internal-Format Document
 
Logic to Map a File Document to an Internal-Format Document
The following sample code shows logic you might want to include to process a file document that contains a file from an inbound EDI document. The processing in the service below shows how to map information from the file to an internal-format document and send the document to an internal application, that is, a back-end system.
Flow operation
Description
1
Invoke the wm.b2b.edi.tradacoms.compose:startTradacomsTransmission EDI built-in service to create an STX segment for a transmission. This service returns a TRADACOMS transmission object.
2
Invoke the wm.b2b.edi.tradacoms.compose:addToTradacomsTransmission service to add the header message to the TRADACOMS transmission object that the startTradacomsTransmission service returned.
3
Invoke the addToTradacomsTransmission service again to add the detail messages to the TRADACOMS transmission object.
4
Invoke the addToTradacomsTransmission service again to add the trailer message to the TRADACOMS transmission object.
5
Invoke the wm.b2b.edi.tradacoms.compose:endTradacomsTransmission service to create an END segment for the transmission.
6
Invoke the Integration Server pub.io:streamToBytes built-in service to convert the InputStream to bytes.
7
Invoke the Integration Server pub.string:bytesToString built-in service to convert the output of pub.io:streamToBytes to a string.