The article describes two scenarios of transformation and enveloping in IBM® WebSphere® Partner Gateway V6.2. In Scenario 1, WebSphere Partner Gateway receives XML documents from an internal or external partner, transforms them into EDI transactions, envelops the transactions, and sends them to the internal or external partner. In Scenario 2, WebSphere Partner Gateway receives record-oriented data (ROD) documents from an internal or external partner, transforms the documents into EDI transactions, envelops the transactions, and sends them to the internal or external partner. (ROD documents are documents that conform to a proprietary format.)
WebSphere Partner Gateway supports the transformation, enveloping, and de-enveloping with the following EDI standards:
- X12
- Common EDI standard approved by the American National Standards Institute (ANSI)
- UN/EDIFACT
- United Nations Electronic Data Interchange for Administration Commerce and Support
- UCS
- Uniform Communication Standard
An EDI interchange envelope is a series of segments. EDI interchanges can contain three levels of segments, each with a header segment at the beginning and a trailer segment at the end:
- Transaction envelope
- A series of detailed segments that defines a transaction
- Group envelope
- A group of transactions of the same type
- Interchange envelope
- A number of groups destined for a particular trading partner
Each EDI standard provides its own method and its own segments for displaying the data within an interchange, as shown in the table below:
| EDI standard | Interchange start | Interchange end | Group start | Group end | Transaction start | Transaction end |
|---|---|---|---|---|---|---|
| EDI-X12 | ISA | IEA | GS | GE | ST | SE |
| EDIFACT | UNB | UNZ | UNG | UNE | UNH | UNT |
| UCS | BG | EG | GS | GE | ST | SE |
EDI is a method used for transmitting business information over a network between business associates who agree to follow industry standards for translating or exchanging information. Maps are required to perform the translation tasks. This article shows you how to use transformation maps to transform a document from one format to another.
Maps can be created using the Data Interchange Services (DIS) client.
- WebSphere Partner Gateway V6.2 should be installed and running
- Download samples.zip at the bottom of the article. It contains samples of maps and input files.
Scenario 1. XML to EDI document flow
This scenario involves translating an incoming XML file into an EDI transaction based on the mapping, enveloping the transaction in an EDI X12 ISA, and sending the output EDI to the target partner. Use the map compiledSDT-XML-EDI.eif and the input file Splitterxml2edi.xml.
Figure 1. XML to EDI document flow

- Log into the WebSphere Partner Gateway Community Console.
- Navigate to Wizards => EIF Import Wizard.
- Click Browse and select compiledSDT-XML-EDI.eif from the file system.
- Click Import:
Figure 2. Importing a map using EIF Import Wizard

After clicking Import, the next screen opens:
Figure 3. Import summary screen

- Click Next to view the transaction that gets created with this map import:
Figure 4. Default Interaction created

- Click Next and then Finish:
Figure 5. Import completion screen

Step 2. Verifying the map import
- Navigate to Hub admin => Hub configuration => Maps => Transformation maps. The transformation map S-DT-XML-TO-EDI should be listed.
- Click the View details icon to check the document definition at source and target side.
Figure 6. Document definition from source to target

- Navigate to Hub Admin => Receivers.
- Click Create receiver.
- Specify the name of the Receiver, such as XMLtoEDIFileReceiver.
- For File directory, select Transport.
- Specify the Document root path, such as /XMLtoEDIFileReceiver.
- In the Handlers section, select Pre-process from the drop-down for Configuration point handlers.
- Select com.ibm.bcg.edi.receiver.preprocesshandler.XMLSplitterHandler from the Available list and add it to the Configured list.
- Click Save.
You can use this receiver for an EDI file containing multiple EDI envelopers. The XML splitter parses the document and creates the metadata that will be used by the document manager to extract the routing trading partner information.
- Create an Internal partner with name Manager and Freeform id 01-111111111.
- Create an External partner with name Partner and Freeform id 01-222222222.
- Edit the input file Splitterxml2edi.xml to modify the Sender ID and Receiver ID as shown in below:
Figure 7. Modifying Sender and Receiver IDs in the input XML file

- Create destinations for both manager and partner by selecting File directory as the transport.
- Two interactions need to be configured for this flow -- one for the translation and enveloping, and another for the EDI document to be sent to the target destination.
- The transformation interaction was already created while importing the map. The XML document gets translated into EDI transactions through the "XML translate and Validate" action. The output transaction needs to be enveloped. Here, an envelope profile is used to define the envelope properties.
- Navigate to Hub Admin => Document Definition => Create interaction.
- Specify the following items to create an interaction to send the enveloped EDI message to the target destination:
- Source
- Package: N/A
- Protocol: EDI-X12 (ALL)
- Document flow: ISA (ALL)
- Target:
- Package: None
- Protocol: EDI-X12 (ALL)
- Document flow: ISA (ALL)
- Action: Pass through
Step 7. Enabling B2B capabilities for the partners
- Enable the following Package, Protocol, and Document flow for Manager (Internal Partner):
- Package: None
- Protocol: FVT-XML-TEST (ALL)
- Document flow: ICGCPO (ALL)
- Package: N/A
- Protocol: EDI-X12 (ALL)
- Document flow: ISA (ALL)
- Package: N/A
- Protocol: MX12V3R1 (ALL)
- Document flow: 850 (ALL)
- Enable the following Package, Protocol, and Document flow for Partner (External Partner):
- Package: N/A
- Protocol: Protocol: MX12V3R1 (ALL)
- Document flow: 850 (ALL)
- Package: None
- Protocol: EDI-X12 (ALL)
- Document flow: ISA (ALL)
Step 8. Creating envelope profile
- Navigate to Hub Admin => Hub Configuration => Envelope Profile.
- Click Create.
- Provide a name for the Envelope profile, such as EnvProfile.
- Select X12 as the EDI Standard.
- Click Save.
Figure 8. Creating Enveloper profile

XML to EDI flow requires the XML format to be defined to determine the format of the XML to extract the attributes like Sender ID and Receiver ID.
- Navigate to Hub Admin => XML Formats.
- Click Create Document Family.
- Specify the Family name, such as DocFamily.
- Select the protocol FVT-XML-TEST ALL from the drop-down list.
- Select Family type as Root Tag.
- Provide MMDoc as the Family identifier.
- Click Save.
- Click Create XML Format.
- Provide the values as shown in Figures 9 and 10:
- Click Save:
Figure 9. Document definition type criteria

Figure 10. Document attributes

- Navigate to Account Admin => Connections.
- Select Manager from Source drop down.
- Select Partner from Target drop down.
- The connections should be activated as shown below:
Figure 11. Enabling partner connections

Step 12. Configuring connection attributes on target partner
For the Receiver ID: At the target partner of the EDI flow -- attributes at the participant connection for the target partner is used.
- Click Attributes for Target side in the connection for Protocol MX12V3R1.
- In the connection summary page, click Protocol.
- Locate the Envelope profile attribute and select EnvProfile from the dropdown.
- Locate the Business identifier (EDI Interchange Qualifier) and provide the value 01.
- Locate the Business identifier (EDI Interchange Identifier) and provide the value 222222222.
- Locate the Interchange usage indicator and provide the value T.
- Click Save.
Step 13. Configuring B2B capabilities attributes on source partner (Manager)
For the Sender ID: At the source partner of the EDI flow -- the attributes at the participant connection for the source partner is not for the generated EDI envelope -- therefore the source ID is specified at the source trading partner's B2B capabilities.
- Navigate to Manager's B2B capabilities.
- Click edit icon for MX12V3R1 protocol.
- Locate the Envelope Profile attribute and select EnvProfile from the dropdown.
- Locate the Business Identifier (EDI Interchange Qualifier) and provide the value 01.
- Locate the Business Identifier (EDI Interchange Identifier) and provide the value 111111111.
- Locate the Interchange usage indicator and provide the value T.
- Click Save.
- Copy the input file Splitterxml2edi.xml to the XMLtoEDIFileReceiver/Documents/Production folder.
- Navigate to Viewers => Document Viewer to check the document status.
- The XML should be should be translated to 850 transaction.
- The enveloped document is send to the Partner's file destination.
- The output transactions are shown below:
Figure 12. Transactions in the Document viewer

Scenario 2. ROD to EDI document flow
This scenario involves an incoming ROD document to be translated to an EDI transaction based on the mapping, and then the transaction to be enveloped in an EDIX12 ISA. The output EDI is then sent to the target partner.
Figure 13. ROD to EDI document flow

Map to be used: compliledADF-EDI.eif, Input file: adf2edi.inp
Import compliledADF-EDI.eif map using the EIF Import wizard following the procedure in Step 1 of Scenario 1.
Figure14. Map Import Completion Screen

Step 2. Checking the map import
Refer to the procedure described in Step 2 of Scenario 1 to verify that compliledADF-EDI.eif is listed and the document definition is created.
- Navigate to Hub Admin => Receivers.
- Click Create Receiver.
- Specify the name of the Receiver, such as RODtoEDIFileReceiver.
- Select Transport as File directory.
- Specify the Document Root Path, such as /RODtoEDIFileReceiver.
- Select Pre-process from the drop down for Configuration Point Handlers in the Handlers section.
- Select com.ibm.bcg.edi.receiver.preprocesshandler.RODSplitterHandler from Available list and add to the Configured list.
- Select com.ibm.bcg.edi.receiver.preprocesshandler.RODSplitterHandler handler in the Configured list and Click Configure.
- Provide the values as shown in Figure 15 below and Click SetValues.
- Click Save in the receiver creation page.
Figure 15. Configuring the ROD Splitter Handler

The partners created in Scenario 1, Step 4 can be reused for this scenario, or new participants can be created. For simplicity, this article reuses the partners created in Scenario 1. Edit the input file adf2edi.inp to modify the Sender and Receiver IDs as shown below:
Figure 16. Modifying the Sender ID Receiver IDs in the input ROD file

Create destinations for both Manager and Partner by selecting File directory as the transport. The destinations created in Scenario 1 can be reused for this step.
For the ROD to EDI Scenario, two interactions need to be created. One interaction transforms the ROD to EDI 850 message and envelopes it, and the second one corresponds to sending the enveloped EDI message to the Target Partner. The first interaction gets created when the transformation map is imported. The second interaction is already created in Step 6 of Scenario 1.
Step 7. Enabling B2B capabilities for the partners
- Enable the following Package, Protocol, and Document flow for Manager (Internal Partner):
- Package: None
- Protocol: ADF-TO-EDI_DICT (ALL)
- Document flow: DTADF-TO-EDI_ADF (ALL)
- Package: N/A
- Protocol: EDI-X12 (ALL)
- Document flow: ISA (ALL)
- Enable the following Package, Protocol, and Document Flow for Partner (External Partner):
- Package: N/A
- Protocol: Protocol: X12V2R1 (ALL)
- Document flow: 850 (ALL)
- Package: None
- Protocol: EDI-X12 (ALL)
- Document flow: ISA (ALL)
Step 8. Create envelope profile
The envelope profile EnvProfile created in Scenario 1 can be reused.
- Navigate to Account Admin => Connections.
- Select Manager from Source drop down.
- Select Partner from Target drop down.
- The connections should be activated as shown below:.
Figure 17. Activating partner connections

Step 10. Configuring the attributes
For the EDI 850 message to be enveloped, you must configure some attributes, as described below:
- Navigate to Account admin => Search => Partner (Target Partner) => B2B Capabilities.
- Expand Package N/A.
- Click edit icon next to Protocol : X12V2R1 (ALL).
- Locate the Envelope Profile> attribute and select EnvProfile from the dropdown.
- Locate the Business Identifier (EDI Interchange Qualifier) and provide the value 01.
- Locate the Business Identifier (EDI Interchange Identifier) and provide the value 111111111.
- Locate the Interchange usage indicator and provide the value T.
- Click the Validation tab.
- Locate the attributes Max validation error level and Validation level. Select 2 from the drop-down for both of these attributes.
- Click Save.
- Copy the input file adf2edi.inp to the RODtoEDIFileReceiver/Documents/Production folder.
- Navigate to Viewers => Document Viewer to check the document status. The ROD should be should be translated to 850 transaction.
- The enveloped document is send to the Partner's file destination. The output transactions are shown below:
Figure 18. Transactions in Document Viewer

This article explained two scenarios for transformation and enveloping in WebSphere Partner Gateway V6.2: XML to EDI transformation, and ROD to EDI transformation.
| Description | Name | Size | Download method |
|---|---|---|---|
| Code sample | samples.zip.zip | 16 KB | HTTP |
Information about download methods
- Implementing EDI with WebSphere Partner Gateway V6.2, Part 2
Part 2 of this series shows you how to implement two different de-enveloping and EDI transformation operations -- EDI to XML transformation, and EDI to record-oriented data (ROD) transformation. - WebSphere Partner Gateway product page
Product descriptions, product news, training information, support information, and more. - WebSphere Partner Gateway V6.2 information center
A single Web portal to all WebSphere Partner Gateway documentation, with conceptual, task, and reference information on installing, configuring, and using WebSphere Partner Gateway. - WebSphere Partner Gateway requirements
Hardware and software requirements for different versions of WebSphere Partner Gateway. - WebSphere Partner Gateway support
A searchable database of support problems and their solutions, plus downloads, fixes, problem tracking, and more. - WebSphere Partner Gateway FAQs
Answers to frequently asked questions about licensing, support, migration, and technical issues. -
B2B innovation with WebSphere Partner Gateway leveraging SOA and BPM
This IBM white paper shows you how WebSphere Partner Gateway provides innovative ways for you to connect to Business Partners within an SOA - developerWorks WebSphere developer resources
Technical information and resources for developers who use WebSphere products. developerWorks WebSphere provides product downloads, how-to information, support resources, and a free technical library of more than 2000 technical articles, tutorials, best practices, IBM Redbooks, and online product manuals. - developerWorks WebSphere application connectivity developer resources
How-to articles, downloads, tutorials, education, product info, and other resources to help you build WebSphere application connectivity and business integration solutions. - developerWorks WebSphere business process management developer resources
WebSphere BPM how-to articles, downloads, tutorials, education, product info, and other resources to help you model, assemble, deploy, and manage business processes. - Most popular WebSphere trial downloads
No-charge trial downloads for key WebSphere products. - WebSphere forums
Product-specific forums where you can get answers to your technical questions and share your expertise with other WebSphere users. - WebSphere on-demand demos
Download, watch, and learn what WebSphere products and WebSphere-related technologies can do for your company. - developerWorks WebSphere weekly newsletter
The developerWorks newsletter gives you the latest articles and information only on those topics that interest you. In addition to WebSphere, you can select from Java, Linux, Open source, Rational, SOA, Web services, and other topics. Subscribe now and design your custom mailing. - WebSphere-related books from IBM Press
Convenient online ordering through Barnes & Noble. - WebSphere-related events
Conferences, trade shows, Webcasts, and other events around the world of interest to WebSphere developers. - developerWorks blogs
Join a conversation with developerWorks users and authors, and IBM editors and developers. - developerWorks Webcasts
Free technical sessions by IBM experts that can accelerate your learning curve and help you succeed in your most difficult software projects. Sessions range from one-hour Webcasts to half-day and full-day live sessions in cities worldwide. - developerWorks podcasts
Listen to interesting and offbeat interviews and discussions with software innovators. - developerWorks on Twitter
Check out recent Twitter messages and URLs.

Sonali Samantaray is a Software Engineer on the WebSphere Partner Gateway team at the IBM India Software Lab. She has a Masters Degree in Computer Applications and is an IBM Certified DB2 Associate and IBM Certified SOA Associate. Sonali has published technical documents for various symposiums as well as several IBM developerWorks articles. You can contact Sonali at sonali.samantaray@in.ibm.com.




