The standalone AS2 server component based on as2-lib. It directly works on Sockets and not on Servlets. Please see as2-peppol-servlet for an example how as2-lib can be used together with the Servlet specs. Alternatively a specialized Servlet based server for PEPPOL is available with my as2-peppol-server project.
This project is licensed under the FreeBSD License.
IRefreshablePartnershipFactory
to project as2-libServerSelfFillingXMLPartnershipFactory
handles dynamic partnerships based on SelfFillingXMLPartnershipFactory
. See as2-lib #63 and as2-lib #79 java.util.Date
to java.time.LocalDateTime
- so all the Date parameters must be changed from yyyy
to uuuu
!!! com.helger.as2.app.cert.ServerPKCS12CertificateFactory
was deprecated in favor of the more generic com.helger.as2.app.cert.ServerCertificateFactory
that handles arbitrary keystore types (like JKS).CryptoVerifyUseCertificateInBodyPart
to define whether a certificate passed in the signed MIME body part shall be used to verify the signature (when true
) or whether to always use the certificate provided in the partnership (when false
). By default the value is true
.CryptoSignIncludeCertificateInBodyPart
to define whether the certificate used for signing should be included in the signed MIME body part (when true
) or not to include it (when false
). By default the value is true
. This is the sending counter part of CryptoVerifyUseCertificateInBodyPart
Add the following to your pom.xml to use this artifact:
<dependency>
<groupId>com.helger</groupId>
<artifactId>as2-server</artifactId>
<version>4.4.4</version>
</dependency>
Start server: run class com.helger.as2.app.MainOpenAS2Server
Startup arguments (required): src/main/resources/config/config.xml
This configuration file should be the starting point for your own customizations. You may simple copy the file to a different location and provide the absolute path to it instead of the example given above.
Waits for incoming AS2 messages on http://localhost:10080/HttpReceiver
Note: the port for the incoming messages can be configured in the configuration file.
Than run com.helger.as2.test.TestClient
as a Java main application to perform a simple AS2 transmission.
No database or additional software is needed to exchange AS2 messages!
To run this server stand-alone from the source build, perform the following steps.
In the below commands x.y.z
denotes the effective version number
mvn clean install -Pwithdep
(selects the profile "withdep" which means "with dependencies"). On Windows you may run build.cmd
as an alternative.
as2-lib
is referenced. In that case check out the as2-lib project as well, run mvn clean install
on as2-lib and go back to the first step on this project. standalone/as2-server.jar
Launch the server (note: src/main/resources/config/config.xml
is the path to the configuration file to be used and may be changed):
On Unix/Linux systems run the AS2 server using the following command (on one line):
java -cp "standalone/*" com.helger.as2.app.MainOpenAS2Server standalone/config/config.xml
`
On Windows systems run the AS2 server using the following command (on one line) or execute the run.cmd
file:
"%JAVA_HOME%\bin\java" -cp "standalone/*" com.helger.as2.app.MainOpenAS2Server standalone/config/config.xml
My personal Coding Styleguide | On Twitter: @philiphelger