In this tutorial, we walk you through the basic steps of setting up an AS2 server. These are the initial steps that will eventually allow you to carry out EDI transactions with an increasing number of trading partners already using this popular B2B file transfer protocol.
The steps you're about to follow will be done on JSCAPE MFT Server, a managed file transfer server that, in addition to AS2, also supports several other file transfer protocols like FTP/S, HTTP/S, OFTP, AFTP, and SFTP. JSCAPE MFT Server already comes with a powerful automation feature called Triggers, which enables admins to automate a variety of business processes, making it the perfect solution for carrying out EDI transactions.
You may download a free, fully-functional evaluation edition of JSCAPE MFT Server here:
Setting up HTTP/S
AS2 runs over HTTP or HTTPS. So before you start configuring any AS2 settings, you'll need to have an HTTP or HTTPS service up and running on your server. The article "How To Set Up A Web File Transfer" should be able to help you with that. We also have a similar article that focuses more on the secure version of HTTP, HTTPS: How To Set UP A HTTPS File Transfer.
Once you have your HTTP/S service all powered up, you can then begin enabling AS2.
Assuming HTTP/S is already up, the first thing you've got to do is enable AS2 on the server. In the JSCAPE MFT Server Manager main screen, go to Server > Settings
Next, go to the Web menu and then to the AS2 tab. Tick the checkbox labeled Enable AS2.
Skip the other settings for now and go directly to the checkbox labeled "Bind unauthenticated transfers to user". Tick that check box as well. After that, enter the username of an existing user account in the first field and the name of an existing domain (in which this user belongs) in the second field. An initial domain should have been created when you first installed JSCAPE MFT Server, so you may use that domain here.
All files/EDI messages received from other AS2 servers will be automatically saved into a folder under this particular user account. In this example, we called this user as2user.
Next, we need to specify the folder where AS2 messages received from other AS2 servers will be stored. Enter the path of that folder in the Upload directory field. Note that this is a relative path that will be located under the bound user account's root directory. This doesn't have to be an existing folder. JSCAPE MFT Server will automatically create the folder for you.
As soon as you're done, navigate to the bottom-right corner of that screen and click the Save changes button
After the page reloads, you should be back at the main screen. Click the Domains tab and then double-click the domain you specified earlier. In our example, that would be "mftserver1".
Alternatively, you could also select that domain and then click the Edit button found in the bottom-right corner of the screen.
Once inside the domain, go to the Services menu and then click the Add button.
Select AS2 from the drop-down list and then click OK.
When the next screen pops up, click OK again.
You should then see your newly added AS2 service in the Services tab.
You have just configured all the basic settings for receiving AS2 messages. We now proceed to discuss the settings for sending AS2 messages.
Configuring Trading Partner settings for sending AS2 messages
In JSCAPE MFT Server, AS2 messages are sent via what are known as Trading Partners. Trading Partners are special objects in the JSCAPE MFT Server environment that encapsulate all the necessary information of an actual trading partner. If you want to learn more about trading partners, here are a couple of introductory videos and articles.
Let's start setting up our AS2 trading partner.
In the same domain where you added the AS2 service, navigate to the Trading Partners menu and then click the Add button.
Notice that a trading partner using the AS2 protocol already exists in our list. In a production environment, you'll likely have multiple AS2 Trading Partners, with each Trading Partner pointing to a distinct company whom you transact with.
Select the AS2 protocol from the drop-down list and then click OK.
When the AS2 Trading Partner dialog box appears, enter the necessary information. This would include:
- Your desired name for this trading partner (e.g. 'ABC Company TP-AS2')
- The URL of your trading partner's AS2 service (e.g. https://192.168.100.102:443/as2/incoming). Ask your trading partner for this piece of information .
- The From ID - This can be any alpha-numeric value (no spaces) that uniquely identifies where the AS2 message is coming from.
- The To ID - Like the From ID, this can be any alpha-numeric value (no spaces) that uniquely identifies where the AS2 message is being sent to.
In a production environment, you will of course need to enter several other information than just those four. However, this is the bare minimum you need to start exchanging AS2 messages with a test system.
After clicking OK, you should see your newly created AS2 Trading Partner in your list of Trading Partners.
Now that you've configured your server to send AS2 messages to a trading partner, you might want to try sending messages now.
Sending AS2 messages manually
JSCAPE MFT Server has a built-in feature that allows you manually send AS2 messages. Let's try it out. Navigate to the AS2 Messages menu and then click the Send File button.
Select the Trading Partner you created earlier and then browse to a file you want to upload. After selecting the file click OK.
After a few seconds, you should see two new records on your AS2 Messages list. One for the outgoing AS2 transmission and another one for its corresponding AS2 MDN receipt.
Let's zoom in on that a bit.
Of course, while it's possible to send EDI messages manually, it's not the ideal way. In order to take full advantage of EDI, EDI messages must be sent automatically. We're going to show you how to do that on our next post, so stay tuned for it.
In the meantime, why don't you try this out yourself? Download a free, fully-functional evaluation edition of JSCAPE MFT Server now.