Home

Awesome

Introduction

javadoc Maven Central

This project contains different libraries that are commonly used in the Peppol/eDelivery area:

This project is part of my Peppol solution stack. See https://github.com/phax/peppol for other components and libraries in that area.

These project are used implicitly by e.g. the following projects:

This project is licensed under the Apache 2.0 license.

peppol-id-datatypes

Java library with the JAXB generated elements for Peppol ID and Peppol Code List handling. First created in v8.4.0.

Make sure to run mvn process-sources before using it in the IDE. The additional code is created in target/generated-sources/xjc.

peppol-id

Java library with shared IDs and predefined IDs. First created in v7.0.0.

peppol-commons

Java library with shared Peppol components. It contains the basic algorithms. Since v7 this depends on the peppol-id submodule.

This project also contains the predefined Peppol Truststores. See https://github.com/phax/peppol-commons/tree/master/peppol-commons/src/main/resources/truststore for all details.

peppol-sbdh

Simple SBDH handler for the use with Peppol. It offers the possibility to extract all meta data from an SBDH document as well as set all meta data to an SBDH document.

Make sure to run mvn generate-sources before using it in the IDE. The additional code is created in target/generated-sources/xjc.

This projects implements the "Envelope specification" as listed on http://www.peppol.eu/ressource-library/technical-specifications/transport-infrastructure/infrastructure-resources. The detail document this project refers to can be found at https://docs.peppol.eu/edelivery/envelope/PEPPOL-EDN-Business-Message-Envelope-1.2.1-2020-03-11.pdf

peppol-testfiles

A Java library with a lot of UBL and SBDH test files suitable for different scenarios.

SimpleInvoicing test files are used from https://github.com/SimplerInvoicing/testset

peppol-sml-client

This project contains the SML client library used by the SMP's to interact with the SML. This library is usually only used within SMP servers, to communicate the changes to the central SML.

Make sure to run mvn generate-sources before using it in the IDE. The additional code is created in target/generated-sources/xjc.

This project contains 2 main classes for talking to the Peppol SML:

Both classes offer the possibility to set an optional custom SSLSocketFactory as well as a custom optional HostnameVerifier. The implementation of this is in the base class AbstractSMLClientCaller.

This project is used by peppol-smp-server the SMP server with a management GUI and flexible backends.

peppol-smp-datatypes

Java library with the JAXB generated elements for Peppol SMP handling. First created in v8.4.0.

Make sure to run mvn process-sources before using it in the IDE. The additional code is created in target/generated-sources/xjc.

peppol-smp-client

This project holds the SMP client library used by the Access Points to retrieve service metadata. This project supports the Peppol SMP specification, the OASIS BDXR SMP v1 and OASIS BDXR SMP v2 specification. This project uses Apache HTTP client to perform the REST lookups on foreign SMPs.

The Peppol SMP specification 1.2.0, mandatory per 1.5.2022, is supported since v8.7.3. The Peppol SMP specification 1.3.0 to be used per 1.12.2023 does not require any changes and is supported out of the box.

I also provide an OSS phoss SMP server with a nice management GUI.

If you are looking for a standalone query tool, https://github.com/phax/smp-query-webapp is what you may have a look at.

peppol-directory-businesscard

This was introduced in v9.1.0

This project holds the different versions of the Peppol Directory Business Card data model, as well as one generic model.

peppol-mlr

This was introduced in v9.1.2

This project holds utility classes to read and write a Peppol Message Level Response (MLR) as defined in https://docs.peppol.eu/poacc/upgrade-3/profiles/36-mlr/

See https://github.com/phax/peppol-commons/blob/master/peppol-mlr/src/test/java/com/helger/peppol/mlr/PeppolMLRBuilderTest.java for an example how to use the classes.

dbnalliance-xhe

This was introduced in v9.5.0

This project holds support for reading and writing DBNAlliance XHE header. This is the DBNAlliance version of peppol-sbdh based on the ph-xhe library.

Configuration

Configuration resolution (since v8.2.0)

The SMP client (both Peppol and OASIS BDXR) uses the file application.properties for configuration. The file smp-client.properties is also evaluated for backwards-compatibility reasons but with lower priority.

See https://github.com/phax/ph-commons#ph-config for the new resolution logic.

Configuration resolution (pre v8.2.0)

The SMP client (both Peppol and OASIS BDXR) uses the file smp-client.properties for configuration. The default file resides in the folder src/main/resources of this project. You can change the path of the properties file by setting the environment variable SMP_CLIENT_CONFIG (since v7.0.7), the system property peppol.smp.client.properties.path (since v4.3.5), the system property smp.client.properties.path (available as of v4.2.0) to the absolute path of the configuration file (e.g. by specifying -Dsmp.client.properties.path=/var/www/smpclient.properties on Java startup). The name of the file does not matter, but if you specify a different properties file please make sure that you also specify an absolute path to e.g. the trust store!

Configuration properties

It supports the following properties:

Specifying a proxy server

A proxy server can be specified in two ways:

Specify a global proxy server The SMP client supports a proxy server. By default the proxy specified in the configuration file (see above) is used (since v4.3.0).

Alternatively call the method setProxy (org.apache.http.HttpHost) on an SMPClient or SMPClientReadOnly. This means you can specify the proxy on a per-call basis. Proxy authentication is available since v5.2.5 by invoking setProxyCredentials (org.apache.http.auth.Credentials) on the SMP or BDXR client.

Example usage

Get the endpoint URL for a participant using a special document type and process:

    // The Peppol participant identifier
    final PeppolParticipantIdentifier aPI_AT_Test = PeppolParticipantIdentifier.createWithDefaultScheme ("9915:test");

    // Create the main SMP client using the production SML
    final SMPClientReadOnly aSMPClient = new SMPClientReadOnly (PeppolURLProvider.INSTANCE,
                                                                aPI_AT_Test,
                                                                ESML.DIGIT_TEST);
    final String sEndpointAddress = aSMPClient.getEndpointAddress (aPI_AT_Test,
                                                                   EPredefinedDocumentTypeIdentifier.INVOICE_EN16931_PEPPOL_V30,
                                                                   EPredefinedProcessIdentifier.BIS3_BILLING,
                                                                   ESMPTransportProfile.TRANSPORT_PROFILE_PEPPOL_AS4_V2);
    // Endpoint address should be "https://test.erechnung.gv.at/as4"
    System.out.println ("The Austrian government test AS4 AP that handles invoices in Peppol BIS 3 is located at: " +
                        sEndpointAddress);

If you don't need the DNS lookup you can use the URL of the SMP directly (equivalent to the previous example):

    // The Peppol participant identifier
    final PeppolParticipantIdentifier aPI_AT_Test = PeppolParticipantIdentifier.createWithDefaultScheme ("9915:test");

    // Create the main SMP client using the production SML
    final SMPClientReadOnly aSMPClient = new SMPClientReadOnly (URLHelper.getAsURI ("http://B-85008b8279e07ab0392da75fa55856a2.iso6523-actorid-upis.acc.edelivery.tech.ec.europa.eu"));
    final String sEndpointAddress = aSMPClient.getEndpointAddress (aPI_AT_Test,
                                                                   EPredefinedDocumentTypeIdentifier.INVOICE_EN16931_PEPPOL_V30,
                                                                   EPredefinedProcessIdentifier.BIS3_BILLING,
                                                                   ESMPTransportProfile.TRANSPORT_PROFILE_PEPPOL_AS4_V2);

    // Endpoint address should be "https://test.erechnung.gv.at/as4"
    System.out.println ("The Austrian government test AS4 AP that handles invoices in Peppol BIS 3 is located at: " +
                        sEndpointAddress);

Building from source

This project is meant to be build by Maven 3.x. It requires at least Java 1.8 to be build. To build simply call mvn clean install in the root folder.

When integrating this in your IDE, ensure to run mvn process-sources first, so that the automatically generated files are present. For the subprojects peppol-id, peppol-commons, peppol-sbdh and peppol-sml-client add target/generated-sources/xjc to your buildpath afterwards.

Maven usage

Add the following to your pom.xml to use this artifact, replacing x.y.z with the latest version number (see below):

<dependency>
  <groupId>com.helger.peppol</groupId>
  <artifactId>peppol-id</artifactId>
  <version>x.y.z</version>
</dependency>

<dependency>
  <groupId>com.helger.peppol</groupId>
  <artifactId>peppol-commons</artifactId>
  <version>x.y.z</version>
</dependency>

<dependency>
  <groupId>com.helger.peppol</groupId>
  <artifactId>peppol-testfiles</artifactId>
  <version>x.y.z</version>
</dependency>

<dependency>
  <groupId>com.helger.peppol</groupId>
  <artifactId>peppol-sbdh</artifactId>
  <version>x.y.z</version>
</dependency>

<dependency>
  <groupId>com.helger.peppol</groupId>
  <artifactId>peppol-sml-client</artifactId>
  <version>x.y.z</version>
</dependency>

<dependency>
  <groupId>com.helger.peppol</groupId>
  <artifactId>peppol-smp-client</artifactId>
  <version>x.y.z</version>
</dependency>

<dependency>
  <groupId>com.helger.peppol</groupId>
  <artifactId>peppol-directory-businesscard</artifactId>
  <version>x.y.z</version>
</dependency>

<dependency>
  <groupId>com.helger.peppol</groupId>
  <artifactId>peppol-mlr</artifactId>
  <version>x.y.z</version>
</dependency>

<dependency>
  <groupId>com.helger.peppol</groupId>
  <artifactId>dbnalliance-xhe</artifactId>
  <version>x.y.z</version>
</dependency>

Alternatively use the following code in your dependencyManagement section to use it as a BOM:

<dependency>
  <groupId>com.helger.peppol</groupId>
  <artifactId>peppol-commons-parent-pom</artifactId>
  <version>x.y.z</version>
  <type>pom</type>
  <scope>import</scope>
</dependency>

Note: prior to v8.1.0 the Maven groupId was com.helger.

The binary version of this library can be found on https://repo1.maven.org/maven2/com/helger/peppol/ They depend on several other libraries so I suggest you are going for the Maven source integration.

References

News and noteworthy


My personal Coding Styleguide | It is appreciated if you star the GitHub project if you like it.