Export (0) Print
Expand All

Walkthrough: Receiving EDI over AS2 with a Synchronous MDN

This walkthrough provides a set of step-by-step procedures that creates a solution for receiving EDI messages over AS2 transport, returning synchronous MDNs.

How the Solution Receives an EDI/AS2 Message and Returns a Synchronous MDN

The solution will do the following:

  1. Receive an AS2 message containing an EDI interchange over HTTP from the trading partner Fabrikam, and decode the interchange from EDIINT/AS2.

    Bb743306.note(en-us,BTS.20).gifNote
    The events in this list may not occur in the order shown.

  2. Return a synchronous MDN to the trading partner.

  3. Convert the EDI format of the interchange to internal XML format, and drop it in the MessageBox.

  4. A FILE send port with a PassThruTransmit pipeline picks up the message XML file.

  5. The send port sends the EDI interchange XML file to a folder at the Contoso party.

The following figure shows the architecture for this solution.

AS2 receiving with a synchronous MDN

The Functionality in this Solution

The following applies to the functionality of this walkthrough:

  • An EDI acknowledgment is not generated. Generating an EDI acknowledgment is demonstrated in Walkthrough: Receiving EDI Interchanges. Sending an EDI acknowledgment over AS2 transport is described in Walkthrough: Sending EDI over AS2 with a Synchronous MDN.

  • The solution is designed for interchanges using X12 encoding, not EDIFACT encoding.

    Bb743306.note(en-us,BTS.20).gifNote
    The configuration used for EDIFACT encoding is closely parallel to that used for X12 encoding.

  • EDI type and extended validation will be performed on the incoming interchange.

  • AS2 and EDI reporting will be enabled, and transaction sets will be saved for viewing from the interchange status report.

  • This solution does not configure signing, compression, encryption, or message storage in the non-repudiation database. For procedures on configuring those properties, see Configuring AS2 Party Properties.

Configuration Steps

The procedures required for this solution include the following:

  • Create a party for the trading partner Fabrikam that the AS2 message is received from. Configure the AS2 properties for that party to send an AS2 message, and receive a synchronous MDN in return. Configure the EDI properties for BizTalk to receive an EDI interchange from that party.

  • Build and deploy a BizTalk project with the required message schema, making the schema available for use by BizTalk Server in processing the received interchange.

  • Enable the BTS ISAPI filter used in receiving the AS2 message.

  • Create a Contoso virtual directory that receives the AS2 message from Fabrikam, as configured in the receive location.

  • Specify that the Contoso virtual directory is not managed by Windows SharePoint Services.

  • Create a static two-way HTTP receive port for BizTalk Server to receive the AS2 message containing the EDI interchange from the trading partner, and send the MDN response. Configure the receive pipeline to be the AS2EDIReceive pipeline and the send pipeline to be the AS2Send pipeline.

  • Create a static one-way FILE send port to route the EDI payload (in XML format) to a local folder. Create the local folder.

Testing the Walkthrough

You can test the solution by using the HTTP Sender utilities that is shipped as part of the AS2 tutorial files. This utility sends a test AS2 message containing an EDI interchange over AS2 transport (X12_00401_864-Sync.edi, also shipped with the AS2 tutorial). You must modify both the HTTP Sender and the test message from the versions that are in the tutorial. These changes are described in the To test the solution procedure below.

The following are prerequisites for performing the procedures in this topic:

  • You must be logged on as a member of the BizTalk Server Administrators group.

  1. Right-click the Parties node in the BizTalk Server 2006 Administration Console, point to New, and then click Party to create a party that BizTalk will receive the interchange from.

  2. Enter Fabrikam for the party in the Name text box.

  3. In the first open line of the Aliases list, type EDIINT-AS2 From Value for Name, enter AS2-From for Qualifier, and enter Fabrikam for Value. Click OK.

    Bb743306.note(en-us,BTS.20).gifNote
    An entry for AS2-From is required in the alias list of the party's general properties because BizTalk Server matches this value to the AS2-From header in the incoming message to perform party resolution on the receive side.

  4. Right-click Fabrikam in the Parties pane of the BizTalk Server 2006 Administration Console, and then select AS2 Properties.

  5. In the General pane, click Activate AS2 Reporting.

  6. Right-click Fabrikam in the Parties pane of the BizTalk Server 2006 Administration Console, and then select EDI Properties.

  7. In the console tree of the EDI Properties dialog box, select X12 Interchange Processing Properties (for Party as Interchange Sender).

  8. Enter values for the qualifier and identifier fields for sender and receiver. For ISA5 enter ZZ; for ISA6 enter 7654321; for ISA7 enter ZZ; and for ISA8 enter 1234567.

    Bb743306.note(en-us,BTS.20).gifNote
    BizTalk requires the qualifier and identifier fields for sender and receiver in order to perform party resolution. It matches their values in the message with the value in the party definition.

  9. Clear Check for duplicate ISA13 (Interchange control number), so you can send multiple test input messages.

  10. In the Default Target namespace field, verify that the value selected is http://schemas.microsoft.com/BizTalk/EDI/X12/2006.

  11. Click OK to accept the configuration settings and close the dialog box.

  1. In Visual Studio 2005, open the project <drive>:\Program Files\Microsoft BizTalk Server 2006\SDK\AS2 Tutorial\Schemas\Schemas.btproj.

    Bb743306.note(en-us,BTS.20).gifNote
    This project, which is shipped for the AS2 tutorial, includes an 864 schema for use with the test message.

    Bb743306.note(en-us,BTS.20).gifNote
    This topic assumes that you have already added a reference from your application to the BizTalk EDI Application, which contains EDI schemas, pipelines, and orchestrations. If not, see How to Add a Reference to the BizTalk Server EDI Application.

  2. Right-click the Schemas project, and then click Properties. Click Assembly in the console tree. In the Strong name section, browse to <drive>:\Program Files\Microsoft BizTalk Server 2006\SDK\AS2 Tutorial\Schemas, and select Schemas.snk. Click Open, and then click OK.

  3. Build and deploy Schemas.btproj.

  1. Click Start, point to Programs, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.

    Bb743306.note(en-us,BTS.20).gifNote
    The procedures in this walkthrough that enable the BTS ISAPI filter, configure the Contoso Web page, and specify that your virtual directory is not managed by Windows SharePoint Services are also included in the AS2 Tutorial.

  2. In the IIS Manager dialog box, right-click Web Service Extensions, and then click Add a new Web service extension.

  3. In the New Web Service Extension dialog box, enter BTS Http Receive ISAPI Filter in Extension Name.

  4. Click Add.

  5. In the Add file dialog box, browse to <drive>:\Program Files\Microsoft BizTalk Server 2006\HttpReceive. Select BTSHTTPReceive.dll, and then click Open.

  6. In the Add file dialog box, click OK.

    Bb743306.note(en-us,BTS.20).gifNote
    When you perform step 6, you may receive the following (or a similar) message: "This file is already required by HWSMessages HttpReceive.". If so, click Cancel, and then click Cancel again. In this case, the BTSHTTPReceive.dll file is already required by another Web service extension, and you do not have to complete this "Add File" or "Add a new Web service extension" procedure.

  7. In the New Web Service Extension dialog box, click OK.

  8. In the Web Service Extension pane of IIS Manager, right-click BTS Http Receive ISAPI Filter, and then click Allow.

  1. In IIS Manager, click Web Sites. Right-click Default Web Site, point to New, and then click Virtual Directory.

  2. In the Welcome to the Virtual Directory Creation Wizard page, click Next.

  3. On the Virtual Directory Alias page, enter Contoso as the Alias, and then click Next.

  4. On the Web Site Content Directory page, browse to <drive>:\Program Files\Microsoft BizTalk Server 2006\HttpReceive for the Path. Click Next.

  5. On the Virtual Directory Access Permissions page, select Execute (such as ISAPI applications or CGI). Leave Read selected. Click Next.

  6. On the page indicating successful completion, click Finish.

  7. In IIS Manager, right-click the Contoso virtual directory, click Properties, and note the Application pool associated with the virtual directory. Close the Contoso Properties dialog box.

    Bb743306.note(en-us,BTS.20).gifNote
    If the application pool is the same application pool that is associated with the Fabrikam virtual directory, step 8 is not required.

  8. Under the Application Pools node in IIS Manager, right-click the application pool noted in step 7 under the Application Pools node of IIS Manager, and then click Properties. In the Properties dialog box, click the Identity tab. Verify that the user name listed under Configurable is an administrator on the server, then click Cancel.

  9. Right-click the Contoso virtual directory, and then click Properties. In the Contoso Properties dialog box, click the Directory Security tab. In the Authentication and access control section, click Edit. In the Authentication Methods dialog box, select Enable anonymous access, click OK, and then click OK again.

  1. If Windows SharePoint Services is installed on your computer, click Start, point to Programs, point to Administrative Tools, and then click SharePoint Central Administration.

    Bb743306.note(en-us,BTS.20).gifNote
    This procedure is required if Windows SharePoint Server is installed on the same computer that you are setting the walkthrough up on. In that case, you must specify that your IIS virtual directory is not being managed by Windows SharePoint Server.

  2. On the Central Administration page, under Virtual Server Configuration, click Configure virtual server settings.

  3. On the Virtual Server List page, click Default Web Site.

  4. On the Virtual Server Settings page, under Virtual Server Management, click Define Managed Paths.

  5. In the Define Managed Paths page, under Add a New Path, in the Path text box, enter Contoso. Under Type, click Excluded Path, and then click OK.

  1. In BizTalk Server 2006 Administration Console, right-click the Receive Ports node under the BizTalk Application 1 node, point to New, and then click Request-Response Receive Port.

  2. Name the receive port, and then click Receive Locations in the console tree.

  3. Click New.

  4. Name the receive location, select HTTP for Type, and then click Configure.

  5. Enter /Contoso/BTSHTTPReceive.dll for Virtual directory plus ISAPI extension.

  6. For Receive pipeline, select AS2EDIReceive.

  7. For Send pipeline, select AS2Send.

  8. Click OK, and then click OK again.

  9. In the Receive Locations pane of the BizTalk Administration Console, right-click the receive location, and then click Enable.

  1. In Windows Explorer, create a Contoso local folder named \EDI_to_Contoso to send the EDI payload to.

  2. In BizTalk Server 2006 Administration Console, right-click Send Ports, point to New, and then click Static One-Way Send Port.

  3. In the Send Port Properties dialog box, name your send port, for example, Send_Payload. Select FILE for Type, and then click Configure.

  4. In the FILE Transport Properties dialog box, for Destination folder, browse to and select the \EDI_to_Contoso folder that you created in step 1. Leave File name as %MessageID%.xml. Click OK.

  5. Accept the default of PassThruTransmit for Send Pipeline.

  6. Click Filters in the console tree. For Property, enter BTS.MessageType. For Operator, enter ==. For Value, enter the message type for your message, http://schemas.microsoft.com/BizTalk/Edi/X12/2006#X12_00401_864.

  7. Click OK.

  8. In the Send Ports pane of the BizTalk Administration Console, right-click the send port, and then click Start.

  1. In Visual Studio 2005, open the Sender.csproj project in the <drive>:\Program Files\Microsoft BizTalk Server 2006\SDK\AS2 Tutorial\Sender folder.

  2. In HttpSender.cs, comment out the following line (immediately below the //Request Asynchronous MDN comment line):

    Stream sr = new FileStream(Environment.GetEnvironmentVariable("PROGRAMFILES") + @"\Microsoft BizTalk Server 2006\SDK\AS2 Tutorial\X12_00401_864.edi", FileMode.Open, FileAccess.Read);
    
  3. Uncomment out the following line (immediately below the //Request Synchronous MDN comment line):

    Stream sr = new FileStream(Environment.GetEnvironmentVariable("PROGRAMFILES") + @"\Microsoft BizTalk Server 2006\SDK\AS2 Tutorial\X12_00401_864-Sync.edi", FileMode.Open, FileAccess.Read);
    
  4. Build this project.

  5. In Windows Explorer, move to <drive>:\Program Files\Microsoft BizTalk Server 2006\SDK\AS2 Tutorial. Open X12_00401_864-Sync.edi in Notepad. Delete the line defining the Disposition-Notification-Options header, and then save the file.

  6. Open a command window. Move to <drive>:\Program Files\Microsoft BizTalk Server 2006\SDK\AS2 Tutorial\Sender\bin\debug. Run Sender.exe.

    Bb743306.note(en-us,BTS.20).gifNote
    Running Sender.exe in this instance posts the message X12_00401_864-sync.edi to the Contoso virtual directory (the BTS http receive location).

  7. Verify that an MDN is displayed in the command window. Verify that in the MDN AS2-From is Contoso and AS2-To is Fabrikam.

    Bb743306.note(en-us,BTS.20).gifNote
    Sender.exe displays the MDN in the command window.

  8. Open the Contoso local folder that you create to send the EDI payload to (\EDI_to_Contoso). Verify that there is a <URL>.XML file in the folder. Open the XML file and verify that it contains an 864 transaction set.

  9. Open the test message X12_00401_864-Sync.edi in Notepad, and verify that the transaction set in the output message in the \EDI_to_Contoso local folder corresponds to the transaction set in the X12_00401_864-Sync.edi input message.

Community Additions

ADD
Show:
© 2014 Microsoft