Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Now the basics are explained, we can now start with the preparation of the samples.  The following prerequisites need to be performed, before the samples can be executed.  Remark that the AS4.NET component can solely run on a Windows machine.

1. Create two instances of the MSH

To send/receive messages from two different MSH’s you can use your own MSH configuration or just copy the root folder to another name:

...

When we have two instances, we can configure the one for sending and another for receiving.
When you’re done copying the Sender/Receiver folders for the Component Instances; we can continue with the configuration of the two.

2. Change the HTTP port of the receiver instance

The two instances having an own HttpReceiver in place which can be hosted on a port. Default is this 8081. It’s logical that we can’t have to HTTP endpoints on the same port, that’s why you must configure one of the two to another port. The samples are made so that the Receiver instance is on port 9090 and the Sender on port 8081.

...

-      Change the address of the submitagent to http://localhost:9090/msh/submit/
-      Change the address of the receiveagent to http://localhost:9090/msh/receive/

3. Copy the required sample PModes

On the sending instance, copy the following PModes from the samples folder to the AS4 .NET Sender \config\ send-pmodes folder:

...

  • samples \ pmodes \ signed-reponse-pmode.xml
  • samples \ pmodes \ unsigned-reponse-pmode.xml

4. Install the required certificates

Import the following private certificates in Certificates (Local Computer) / Personal / Certificates:

...

For instructions on how to Import the certificates files please see this page <INSERT LINK HERE>.

6. Start the two MSH instances

Start both instances by right clicking on Eu.EDelivery.AS4.ServiceHandler.ConsoleHost.exe and choosing ‘Run as Administrator’

...

These ports are used to run the AS4.net Portal and Payloads.
For this sample scenario you can ignore this error as it will have no impact. To avoid this error you can change the ports of either the receive or send instance, the configuration of these ports is done in the AS4 .NET Receiver(or Sender)\bin\appsettings.json file.

3.1   Sending Simple AS4 Message

The first example consists of a AS4 message with a single payload that’s being send from one AS4 .NET Instance to another. This example is the simplest form of sending a message, it contains no compression, signing or encryption.

...

The sending/receiving pmodes in this example are configured to notify/deliver the “Business Application” through the file system. Any Receipts received are notified in the messages\receipts folder, any Errors received are notified in the messages\errors folder and any Exceptions generated are notified in the messages\exceptions folder.

3.2   Sending Signed AS4 Message

The second example consists of a AS4 Message with multiple payloads that’s being send from one AS4 .NET Instance to another. This example uses compression and signing of the message and will return a normal receipt to the configured AS4 .NET Sender.

...

The sending/receiving pmodes in this example are configured to notify/deliver the “Business Application” through the file system. Any Receipts received are notified in the messages\receipts folder, any Errors received are notified in the messages\errors folder and any Exceptions generated are notified in the messages\exceptions folder.

3.3   Sending Signed & Encrypted AS4 Message

The third example consists of a AS4 Message with multiple payloads that’s being send from one AS4 .NET Instance to another. This example uses compression, signing and encryption of the message and will return a NRR (Non-Repudiation Receipt) to the configured AS4 .NET Sender.

...

The sending/receiving pmodes in this example are configured to notify/deliver the “Business Application” through the file system. Any Receipts received are notified in the messages\receipts folder, any Errors received are notified in the messages\errors folder and any Exceptions generated are notified in the messages\exceptions folder.

3.4   Pulling as a Receiver as an ebMS endpoint in EESSI

The AS4.NET Component can act as an ebMS endpoint in the EESSI profile and can receive AS4 Messages via Pulling.

...

To setup an EESSI ebMS endpoint, the following steps need to be undertaken:

3.4.1   Configure the Pmodes

In the samples\pmodes\eessi folder, you can find skeleton files for the PModes that were mentioned in the previous section.
You’ll need to make some minor modifications to those files in order to be able to use them within EESSI:

...

    • eessi-push-send-pmode.xml
    • eessi-pull-send-pmode.xml
    • eessi-pull-response-pmode.xml

3.4.2   Modify settings.xml to enable a PullReceive Agent

The settings.xml file has a PullReceive Agent configured that is currently commented out.

...