A demo AS2 server to easily receive AS2 messages from PEPPOL. This project is only meant as a demo project for illustrative purposes, on how to implement a PEPPOL AS2 server. This server implementation writes all incoming documents to disc and does not do anything else with them! Additional or different logic must be implemented!
This project is licensed under the Apache 2 License.
This project is a Java 1.8+ web application and as such meant to be used in an application server (like Tomcat, Jetty etc.).
It consists of the following major components:
- A specialized servlet for retrieval:
com.helger.peppol.as2server.servlet.PEPPOLAS2ReceiveServletwhich defines the configuration for processing incoming files. The servlet is referenced from
- The main handler for an incoming SBDH document in class
com.helger.peppol.as2server.handler.AS2IncomingSBDHandler. This class is referenced via the default SPI lookup mechanism (see
- Additionally a configuration file
src/main/resources/as2-server.propertiesis provided that defines the AS2 specific setup. It contains the path to the keystore as well as in which folders to store what
Before you start
Before this project can be run in a useful way a PKCS12 keystore with your PEPPOL AP certificate must be provided. By default the keystore must be located in
src/main/resources/keystore/ap.pilot.p12 and must have the password
peppol. To change this edit the
Btw. you need no database to run this server. If you want one just use one - but you don't need to.
The easiest way to run and debug the application is to execute class
com.helger.peppol.as2server.jetty.RunInJettyPEPPOLAS2 from within your IDE (as a standard Java application). It starts up a minimal server and listens on port 8080. The servlet that receives PEPPOL messages listens to path
/as2/ and supports only HTTP method POST.
After startup locate your browser to
http://localhost:8080 to check if it is running.
Now that the AS2 server is running you may have a closer look at my as2-peppol-client project which lets you send AS2 messages to a server. If both client and server are configured correctly a successful message exchange should be easily possible.