Archive for the ‘EDI’ Category

In my last two posts I showed two possible errors, and their respective solutions, that can happen when we are validating dummy EDI message, provided by our partners, against the schema using Visual Studio, but these errors could also happen in runtime.

In this post I will show you one common error when we are validating an EDI solution.

After I deploy and correctly configured the solution, I was trying to receive an EDI document from a Receive Port, in order to convert it to XML format using the generic EDI pipeline: “Microsoft.BizTalk.Edi.DefaultPipelines.EdiReceive”, but I was always getting this error:

“There was a failure executing the receive pipeline:
“Microsoft.BizTalk.Edi.DefaultPipelines.EdiReceive,
Microsoft.BizTalk.Edi.EdiPipelines, Version=3.0.1.0, Culture=neutral,
PublicKeyToken1bf3856ad364e35” Source: “EDI disassembler” Receive Port: “IN_ORDER_PORT” URI: “E:\PORTS\EDI\IN_ORDER\*.*” Reason: No Disassemble stage components can recognize the data.“.

The message provided by our partner was this:

UNH+1000100+ORDERS:D:93A:UN:EAN007'
BGM+220+01521710'
DTM+137:120530:101'
DTM+64:120604:101'
DTM+63:120004:101'
FTX+AAI+++SOME TEXT'
FTX+AAI+++SOME TEXT'
FTX+AAI+++SOME TEXT'
NAD+BY+8000000001164::9'
NAD+DP+8000000009463::9'
NAD+IV+8000000013002::9'
NAD+SU+8000001459008::9'
NAD+PR+8000000016003::9'
LIN+1++4001518722937:EN'
PIA+1+00:PV+14001518722937:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:52'
LIN+2++5000014010034:EN'
PIA+1+00:PV+15701014010031:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:152'
LIN+3++5000014016142:EN'
PIA+1+00:PV+15701014016149:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:304'
LIN+4++5006879009752:EN'
PIA+1+00:PV+15776879009759:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:720'
UNS+S'
UNT+31+1000100'

CAUSE

After some time trying to understand the reason of this problem, I realize that’s nothing wrong with my project, the problem is actually in the message that I’m using.

This error occurs because the message does not contain the EDIFACT interchange envelope segments (UNB and UNZ). An EDIFACT interchange begins with a UNB. It contains version release information, syntax information, and partner information. An interchange ends with a UNZ.

UNA Segment: The UNA segment is optional in an EDIFACT interchange. The specifications in the UNA segment define the characters used as separators and indicators for the interchange. Use this segment only if the interchange contains non-standard separator characters. (More information here)

UNB Segment: The UNB segment is compulsory to an EDIFACT interchange. This segment acts as the interchange header for a set of EDIFACT documents. The UNB segment elements identify the sender and recipient of the interchange, together with the date and time that the interchange was prepared and the agency controlling the syntax of the interchange. (More information here)

UNZ Segment: This segment is the Interchange Trailer segment of an EDIFACT document. This segment indicates the end of an interchange and checks the interchange reference and number of documents in the interchange. (More information here)

SOLUTION

Add this segment to your message: UNA (optional), UNB and UNZ and the message will be processed correctly.

Correct message:

UNA:+,?*'
UNB+UNOB:1+UNB2.1+UNB3.1+012301:0123+UNB5'
UNH+1000100+ORDERS:D:93A:UN:EAN007'
BGM+220+01521710'
DTM+137:120530:101'
DTM+64:120604:101'
DTM+63:120004:101'
FTX+AAI+++SOME TEXT'
FTX+AAI+++SOME TEXT'
FTX+AAI+++SOME TEXT'
NAD+BY+8000000001164::9'
NAD+DP+8000000009463::9'
NAD+IV+8000000013002::9'
NAD+SU+8000001459008::9'
NAD+PR+8000000016003::9'
LIN+1++4001518722937:EN'
PIA+1+00:PV+14001518722937:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:52'
LIN+2++5000014010034:EN'
PIA+1+00:PV+15701014010031:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:152'
LIN+3++5000014016142:EN'
PIA+1+00:PV+15701014016149:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:304'
LIN+4++5006879009752:EN'
PIA+1+00:PV+15776879009759:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:720'
UNS+S'
UNT+31+1000100'
UNZ+1+UNB5'

As I mentioned in my last post, when we are in the development phase of a BizTalk project is normal to validate test instances of messages that are provided with respective schemas before we make final tests, the same happens when we are dealing with EDI (EDIFACT) messages.

When we perform this validation, we can detect if some enumerators in the existing EDI Schema contain all admissible values, or if your partner has some values customized and we have to reflect them in the schema.

Another common problem when we are trying to validate dummy EDI message, provided by our partners, against the schema using Visual Studio is:

” Invoking component…
C:\TestFiles\myEDIsample.txt: error BEC2004: Non Segment level : [29] Invalid count specified at interchange, group or message level“.

This is a very basic mistake, and usually occurs when dummy messages are delivered to us for testing.

Sample message:

UNA:+,?*'
UNB+UNOB:1+UNB2.1+UNB3.1+012301:0123+UNB5'
UNH+1000100+ORDERS:D:93A:UN:EAN007'
BGM+220+01521710'
DTM+137:120530:101'
DTM+64:120604:101'
DTM+63:120004:101'
FTX+AAI+++SOME TEXT'
FTX+AAI+++SOME TEXT'
FTX+AAI+++SOME TEXT'
NAD+BY+8000000001164::9'
NAD+DP+8000000009463::9'
NAD+IV+8000000013002::9'
NAD+SU+8000001459008::9'
NAD+PR+8000000016003::9'
LIN+1++4001518722937:EN'
PIA+1+00:PV+14001518722937:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:52'
LIN+2++5000014010034:EN'
PIA+1+00:PV+15701014010031:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:152'
LIN+3++5000014016142:EN'
PIA+1+00:PV+15701014016149:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:304'
LIN+4++5006879009752:EN'
PIA+1+00:PV+15776879009759:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:720'
UNS+S'
UNT+30+1000100'
UNZ+1+UNB5'

CAUSE

This error is a notification that the number of groups, messages, or segments does not match the number given in the UNZ, UNE, UNT, or UST segment; or that the length of an object or the length of encrypted data is not equal to the length stated in the UNO, UNP, USD, or USU segment, i.e., the control count does not match number of instances received.

UNT Segment: UNT is the Message Trailer segment of an EDIFACT document. The UNT segment elements provide information about the number of segments in a message and the reference number for the message. This segment indicates the end of a document.

The following table lists the mandatory elements that the UNT segment contains:

  • Number of Segments in the Message: This element contains the total number of segments in the message.
  • Message Reference Number: This element contains a unique reference number for the message assigned by the sender. This number must be unique to the functional group, and must match the Message Reference Number in the UNH Segment.

So the problem is that in the sample message the Number of Segments in the Message in UNH segment is 30 and the message has in fact 31 (starting count from the UNH segment up to UNT segment).

SOLUTION

You have to change the Number of Segments in the Message element in UNT segment so that contains the correct number of groups, messages, or segments, in this case 31.

Other interesting resources:

When we are in the development phase of a BizTalk project is normal to validate test instances of messages that are provided with respective schemas before we make final tests, the same happens when we are dealing with EDI messages.

When we perform this validation, we can detect if some enumerators in the existing EDI Schema contain all admissible values, or if your partner has some values customized and we have to reflect them in the schema, a good example is:

Data Element ID: FTX01
Data Value: ZZZ
12: Invalid value in data element

To solve this problem you must add this code to the list of the FTX01 element in the schema

The last week when I was trying to validate EDI message, provided by my partner, against the schema using Visual Studio, I kept getting this error:

” Invoking component…
C:\TestFiles\myEDIsample.txt: error BEC2004: Non Segment level : [71] Transaction Set or Group Control Number Mismatch

This is a very basic mistake, and usually occurs when dummy messages are delivered to us for testing.

Sample message:

UNH+1000100+ORDERS:D:93A:UN:EAN007'
BGM+220+01521710'
DTM+137:120530:101'
DTM+64:120604:101'
DTM+63:120004:101'
FTX+AAI+++SOME TEXT'
FTX+AAI+++SOME TEXT'
FTX+AAI+++SOME TEXT'
NAD+BY+8000000001164::9'
NAD+DP+8000000009463::9'
NAD+IV+8000000013002::9'
NAD+SU+8000001459008::9'
NAD+PR+8000000016003::9'
LIN+1++4001518722937:EN'
PIA+1+00:PV+14001518722937:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:52'
LIN+2++5000014010034:EN'
PIA+1+00:PV+15701014010031:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:152'
LIN+3++5000014016142:EN'
PIA+1+00:PV+15701014016149:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:304'
LIN+4++5006879009752:EN'
PIA+1+00:PV+15776879009759:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:720'
UNS+S'
UNT+31+1000101'

CAUSE

This error is a notification that there is a mismatch with the transaction set or group control numbers. That’s nothing wrong with your project, the problem is actually in the message that you are using and if you look carefully at UNH and UNT segments, you will find the problema.

UNH Segment: This is the Message Header segment of an EDIFACT document. The UNH segment elements provide information about the message type, and the agency responsible for maintaining the publication of the message type. This segment indicates the start of a document in an interchange and the type of document that follows.

The firs element of UNH segment is:

  • Message Reference Number: This element contains a unique reference number for the message assigned by the sender. This number must be unique to the functional group, and must match the Message Reference Number in the UNT Segment.

o In the sample message this value is: 1000100

UNT Segment: UNT is the Message Trailer segment of an EDIFACT document. The UNT segment elements provide information about the number of segments in a message and the reference number for the message. This segment indicates the end of a document.

The following table lists the mandatory elements that the UNT segment contains:

  • Number of Segments in the Message: This element contains the total number of segments in the message.
  • Message Reference Number: This element contains a unique reference number for the message assigned by the sender. This number must be unique to the functional group, and must match the Message Reference Number in the UNH Segment.
    • In the sample message this value is: 1000101

So the problem is that in the sample message the Message Reference Number in UNH segment is different from that exists in UNT segment.

SOLUTION

Message Reference Number in UNH segment must be equal to the existing in the UNT segment. Therefore change one of them to become equal and the problem will be solved.

Other interesting resources:

Triggered by a question in BizTalk Forum, I started researching and testing if really BAM Tool is a requirement to install for EDI/AS2 Runtime functionalities.

I was particularly interested in EDI functionality because I’m advising one of my clients to migrate from BizTalk 2006 R2 to 2010 and I really need to know the basic requirements

So, is BAM Tools a prerequisite for EDI/AS2 Runtime in BizTalk Server 2010?

That depends on the functionalities (features) you want to install, but for me the correct answer is NO.

Considerations for Configuring the BizTalk EDI/AS2 Runtime

BizTalk EDI/AS2 Runtime is divided in 3 functionalities:

  • BizTalk EDI Functionality
  • BizTalk AS2 Functionality
  • BizTalk EDI/AS2 Runtime Status Reporting

When you configure the BizTalk EDI/AS2 Runtime in BizTalk Server 2010, consider the following:

  • Enterprise SSO, Group, and BizTalk Runtime must be configured prior to configuring BizTalk EDI/AS2 Runtime.
  • BAM must be configured prior to enable the AS2 and/or EDI/AS2 Runtime Status Reporting features.
  • If you are only configuring EDI, then BAM is not required.

More info here.

In resume:

  • For the last two functionalities “BizTalk AS2 Functionality” and/or “BizTalk EDI/AS2 Runtime Status Reporting”, BAM Tools must be configured!
  • But if you want ONLY EDI functionality you don´t need BAM Tools.

Proof of concept

I create a machine only with SQL installed (no Analysis Services and no Integration Services) and after installed BizTalk with these components:

EDI-BizTalk-Components

I opened “Microsoft BizTalk Server Configuration Wizard” and selected “Custom configuration” option:

EDI-BizTalk-Custom-Configuration

Note: BAM Tools appears on the right tree, because this is necessary only for AS2 and EDI/AS2 Status Reporting feature.

The next step was to configure the following components:

  • Enterprise SSO
    • Enterprise SSO Secret Backup
  • Group
  • BizTalk Runtime
  • Business Rules Engine
  • And BizTalk EDI/AS2 Runtime with only this two options selected:

EDI-Enable-BizTalk

Leave “BAM Tools” and “Bam Alerts” Disable.

EDI-Disable-BizTalk-BAMTools

Configuration Summary

EDI-BizTalk-Custom-Configuration-summary

EDI-BizTalk-Custom-Configuration-result

EDI-BizTalk-Custom-Configuration-overview

Conclusion

Although the BAM Tools is an optional requirement and even if you don’t use AS2 functionalities, I advise you to install and configure in order to benefit of all EDI functionalities that BizTalk Server 2010 has to offer you.

Tags: BizTalk | EDI | Requirements