The instructions in this article are targeted for a two-machine scenario where both trading partners involved in a B2B scenario have their BizTalk Server setup. If you are looking for a single-machine scenario, see Walkthrough: Sending a Non-EDI Message over AS2 (http://go.microsoft.com/fwlink/?LinkID=211816). This article applies to BizTalk Server 2006 R2 and BizTalk Server 2009. For information on how to set up B2B messaging between two trading partners using BizTalk Server 2010, see Developing and Configuring BizTalk Server AS2 Solutions (http://go.microsoft.com/fwlink/?LinkID=211815).
Note: To view a complete list of BizTalk Server articles that are available on the TechNet wiki, see BizTalk Server Resources on the TechNet Wiki.
We in the BizTalk Server CCxG team gratefully acknowledge the contributions of the following individuals for providing their valuable inputs for setting up the end-to-end scenario used in this article:
AS2 is a specification or guideline that describes a process for sending data (generally EDI data) that is secure and reliable. The delivery method that it specifies is HTTP or HTTPs (the secure version of HTTP), which are the same transport methods or protocols that you use every day when browsing web pages.
The organizational structure of messages that are sent via AS2 is known as Secure Multipurpose Internet Mail Extension (S/MIME), which is the identical structure to define what an email looks like. AS2 messages are secure because they are signed and encrypted by using the private/public key pairs of you and your trading partners. In addition, AS2 is reliable because it encourages trading partners to use Message Disposition Notifications (MDNs) or receipts to indicate that your trading partners have received an AS2 message and whether your trading partners have found it to be valid.
Organizations use AS2 for 2 reasons:
BizTalk Server includes native functionality providing support for AS2. This functionality is not an add-in to the product, such as an adapter or an accelerator, but is built into the product. For more information about AS2 functionality, see How AS2 Is Implemented in BizTalk Server (http://go.microsoft.com/fwlink/?LinkID=211812).
The scenario discussed in this article describes how to send/receive an unsigned/non-encrypted non-EDI message over AS2 associated with an unsigned asynchronous MDN from a trading partner, Contoso, to another trading partner, Fabrikam. Both the trading partners have their own BizTalk Server setup.
If a non-EDI message is sent over HTTP/HTTPS transport in an asynchronous mode, you must create a send port to return the MDN separately. If it is a dynamic send port, it will use the address in the Receipt-Delivery-Notification line in the header of the message to route the message to the trading partner. If a non-EDI message is sent over AS2 in a synchronous mode, BizTalk Server will return the MDN over that synchronous connection and then close the connection. The MDN will be generated by the AS2Receive pipeline, routed by that pipeline to the BizTalk Server MessageBox, and then automatically picked up by the AS2Send pipeline that is part of the request response receive port. The following diagram will walk you step-by-step through the process of sending and receiving AS2 messages involving fictional trading partners Contoso and Fabrikam.
Contoso
Fabrikam
1. A one-way file receive port receives a text message from the local folder (C:\In).
2. Using the PassThruReceive receive pipeline, the receive port consumes the message. The receive port then drops the text message as-is into the BizTalk Server MessageBox.
3. A static one-way HTTP send port picks up the text message, subscribing to all messages that are received by the receive port. Using the AS2Send send pipeline, the send port sends the AS2 message to the Fabrikam website.
7. A one-way HTTP receive port uses AS2Receive receive pipeline and consumes the MDN received in Contoso’s virtual directory.
8. In the BizTalk Server Administration Console, AS2 reporting is set on the properties of the Contoso party and is made available in the Group Hub page of the BizTalk Server Administration Console. The AS2/MDN status reports activated on Contoso will provide comprehensive status of a document exchange transaction. These reports provide data on receipt, validation and acknowledgment processing of AS2 messages.
4. A one-way HTTP receive port receives the AS2 message from the Fabrikam virtual directory. The AS2Receive receive pipeline decodes the message from AS2, and drops the processed message and the MDN into the BizTalk Server MessageBox.
5. A static one-way FILE send port with a PassThruTransmit send pipeline picks up the text message and sends the text message to a local folder (C:\Out).
6. A dynamic one-way HTTP send port returns the asynchronous MDN to the Contoso’s website.
To set up this scenario, you must have the following:
The following prerequisites must be met before setting up the scenario:
In this section, you need to configure the BizTalk Server Internet Server API (ISAPI) extension DLL (BTSHttpReceive.dll) in Internet Information Services (IIS) and verify that the status for HwsMessages HttpReceive is Allowed. To configure the BizTalk ISAPI extension DLL in IIS
If the HwsMessages HttpReceive web service extension is not configured (it is not included in the Web Service Extensions list in IIS Manager), perform the following procedure. To configure the BizTalk ISAPI extension DLL in IIS:
Note: After you configure the prerequisites, make sure that both CONTOSO-BTS and FABRIKAM-BTS servers can communicate with one another. Check whether both the servers can communicate with one another by opening the Fabrikam website (http://FABRIKAM-BTS/Fabrikam) from the CONTOSO–BTS server.
This section provides information about how to set up the BizTalk Server environment on the CONTOSO-BTS server. Note: If you use BizTalk Application 1, you must add a reference in BizTalk Application 1 to the BizTalk EDI Application so that your application can use its artifacts.
In this step, you set up a one-way FILE receive port that consumes the text message made available in the local folder (C:\In) and then sends the text message to the BizTalk Server MessageBox.
In this step, you set up a one-way HTTP send port that sends the text message as an AS2 message to the Fabrikam website.
In this step, you set up a one-way receive port to receive the asynchronous MDN sent from partner, Fabrikam.
Note: If you use BizTalk Application 1, you must add a reference in BizTalk Application 1 to the BizTalk EDI Application so that your application can use its artifacts.
BizTalk Server uses the send port associated with the party to determine that it should use Fabrikam’s party properties to send the AS2 message. To set up send port association:
In this step, you configure AS2/MDN status reports in the Group Overview page of the BizTalk Server Administration Console.
This section provides information about how to set up the BizTalk Server environment on the FARIKAM-BTS server.
In this step, you set up a one-way receive port to receive the AS2 message from the Fabrikam’s website and drops both the processed message and MDN into the BizTalk Server MessageBox.
In this step, you set up a one-way send port that picks up the text message from the BizTalk Server MessageBox and sends the text message to a local folder (C:\Out).
In this step, you set up a dynamic one-way HTTP send port returns the asynchronous MDN to the Contoso’s website.
In this step, you test the scenario by following these steps:
File name
Operator
Value
Click the Run Query button to return the result set shown here.
For all troubleshooting information related to AS2, see Troubleshooting EDI and AS2 Solutions (http://go.microsoft.com/fwlink/?LinkID=211813).