WSEDI Level 4
Apr 13th, 2007 by Ricker
SOAP Representation
WS-EDI Level 4 provides a SOAP representation of EDI. With Level 4, there is only one message in each SOAP envelope. If the original EDI file contained several messages, then the Level 4 representation will create several SOAP messages, one for each EDI message in the original file. When EDI files are split apart, the interchange and functional group headers are repeated in the SOAP headers.
X12
In Level 4, there is only one ST loop in each SOAP envelope. The SOAP body contains an
<s:Envelope>
<s:Header>
<w:wsedi>
<w:segment code="ISA" name="Interchange Header"/>
<w:segment code="GS" name="Functional Group Header"/>
<w:segment code="ST" name="Message Header"/>
</w:wsedi>
</s:Header>
<s:Body>
<w:message>
... segments of the message
(after the ST segment and before SE) ...
</w:message>
<s:Body>
</s:Envelope>
Dropped segments
Why do we drop the SE, GE and IEA segments? Afterall, WS-EDI strives to keep a one-to-one relationship between EDI and XML. Within any level of representation, WS-EDI must be able to recreate the EDI document. It is far easier to ignore information left in the document than it is to recreate information stripped out the document. However, the SE, GE and IEA segments are only used as check sums in EDI. To place these segments in the SOAP header would require the processor to buffer the entire EDI document before producing the WS-EDI document. Experience has proven that buffering very large EDI documents is unfeasable. It is far easier for an Uneveloper to recreate the SE, GE and IEA segments than it is for an Enveloper to place those segments in the SOAP header.
EDIFACT
UN EDIFACT messages are represented in SOAP the same way as X12. The only difference is the segments that appear in the SOAP header.
<s:Envelope>
<s:Header>
<w:wsedi>
<w:segment code="UNA" name="Service String Advice"/>
<w:segment code="UNB" name="Interchange Header"/>
<w:segment code="UNG" name="Functional Group Header"/>
<w:segment code="UNH" name="Message Header"/>
</w:wsedi>
</s:Header>
<s:Body>
<w:message>
... segments of the message
(after the UNH segment and before UNT) ...
</w:message>
<s:Body>
</s:Envelope>
The Level 4 representation drops the UNT, UNE and UNZ segments from EDIFACT for the same reason segments are dropped in X12.
Combinations of levels
What happened to Level 3?
Level 3 is the Enriched and Nested Representation, that is, it is a combination of Level 1 and Level 2. The levels comply with binary flagging. The complete set of levels are as follows:
| Flags | Level | Description |
| 0000 | 0 | Minimal |
| 0001 | 1 | Enriched |
| 0010 | 2 | Nested |
| 0011 | 3 | Nested and enriched |
| 0100 | 4 | Enveloped (SOAP) |
| 0101 | 5 | Enveloped and enriched |
| 0110 | 6 | Enveloped and nested |
| 0111 | 7 | Enveloped, nested and enriched |
Note that the Level 4 representation is not enriched or nested. That is, the WS-EDI tags within a Level 4 SOAP document do not contain the human readable metadata or the loop structures inside the message. A Level 7 representation would be a SOAP message with the descriptions and loop structures.
Example documents
- An UN EDIFACT document and its Level 4 representation.
- An ANSI X12 document and its Level 4 representation.
Leave a Reply
You must be logged in to post a comment.