This page explains how to setup a Peppol AP from scratch. AP is the abbreviation for Access Point which is the technical endpoint for sending and receiving business documents. See the Dictionary for more abbreviations.
Since 2020-02-01 AS4 is the mandatory transport protocol in the Peppol eDelivery network and
AS2 transport protocol got an upgrade to "Peppol AS2 v2" (see details below).
This page was originally created for AS2 and is now partially extended for AS4 - more details to come.
There are a few known possibilities (I'm aware of) on how to build/run a Peppol AccessPoint.
Before you can start you need to have the following information in place:
The Peppol AS4 profile is based on the CEF eDelivery AS4 1.14 profile which in turn is a (non-perfect) profile of the OASIS AS4 profile v1.0 which (you guessed it) is a profile of the OASIS ebXML Messaging V3.
Peppol adds a specific limitation on the usage of AS4. AS4 Messages must be signed and encrypted. AS4 messages must have exactly one encrypted payload which is a Standard Business Document (SBD). Peppol AS4 message MUST use the MIME encoding for message transmission.
See the official phase4 documentation on phase4-peppol-servlet for details.
See the official phase4 documentation on phase4-peppol-client for details.
AS2 is a transport protocol specified in RFC 4130. AS2 version 1.1 adding compression is specified in RFC 5402. The MDN is specified in RFC 3798. Algorithm names are defined in RFC 5751 (S/MIME 3.2) which supersedes RFC 3851 (S/MIME 3.1).
An AccessPoint is a technical adapter for sending and receiving Peppol UBL documents. The following images shows the overall structure of a transmitted AS2 message in a very simplified way:
The outermost container is an S/MIME (Secure / Multipurpose Internet Mail Extensions) message. It is a basic MIME message including signature data. One MIME part of the message is the so called Standard Business Document Header (SBDH). It is a UN/CEFACT standard for merging XML documents with relevant metadata into a single XML document. Peppol maintains its own Envelope specification that is based on SBDH. Finally inside the SBDH the main UBL business document is contained. The complete UBL 2.1 specifications can be downloaded from the OASIS UBL web site.
This section points to projects that help in implementing the different layers of an AS2 message. If you are already familiar with these concepts you may simply skip this section.
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcmail-jdk15on</artifactId>
<version>1.64</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>jakarta.mail</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<artifactId>ph-sbdh</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<artifactId>peppol-sbdh</artifactId>
<version>8.0.0</version>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<artifactId>ph-ubl21</artifactId>
<version>6.2.1</version>
</dependency>
An example project that shows how to receive Peppol documents via AS2 can be found in the as2-peppol-server project. It uses as2-lib, ph-ubl and peppol-sbdh to receive messages from arbitrary Peppol AS2 receivers. It requires no external AS2 handler (like Mendelson) and no mandatory database setup. as2-peppol-server is a Java 1.8+ project and licensed under Apache 2.0 license.
Detailed setup description can be found directly on the as2-peppol-server project page.
An example project that shows how to send Peppol documents via AS2 can be found in the as2-peppol-client project. It uses as2-lib, ph-ubl and peppol-sbdh to send messages to arbitrary Peppol AS2 receivers. as2-peppol-client is a Java 1.8+ project and licensed under Apache 2.0 license.
The steps to send a document are outlined as follows:
0088:test).
The determination of the recipient ID is not in scope for Peppol!
9951:123456.
busdox-transport-as2-ver1p0 (for AS2; for AS4 it is peppol-transport-as4-v2_0).
From this endpoint use EndpointReference as the destination URL and
also remember the certificate of the recipient. It is later needed to extract the
as2-to ID.
com.helger.peppol.sbdh.PeppolSBDHDocument which is filled with
the UBL document, the sender participant ID, the receiver participant ID, the document type
ID and the process ID (all stated in the prerequisites above).
PeppolSBDHDocument to a StandardBusinessDocument using
the PeppolSBDHDocumentWriter utility class.
APP_1000000001).
APP_1000000002) received via the previous SMP lookup.