Skip to main content

What is phase4?

phase4 is an open-source Java library that implements the AS4 messaging protocol (OASIS ebMS 3.0 AS4 Profile). It is designed to be embedded directly into existing Java applications, giving you full control over AS4 message exchange without requiring a standalone middleware server. AS4 is the protocol of choice for many B2B and government e-delivery networks including:
  • Peppol — European procurement and invoicing network (OpenPeppol)
  • CEF eDelivery — European Commission Connecting Europe Facility
  • BDEW — German energy sector data exchange
  • ENTSOG — European Network of Transmission System Operators for Gas
  • EUDAMED — EU Medical Devices database
  • DBNAlliance — North American B2B document exchange
  • HRE-Delivery — HR electronic delivery

Quickstart

Send your first AS4 message in minutes

Installation

Add phase4 to your Maven or Gradle project

Core Concepts

Understand AS4, PModes, and messaging profiles

Peppol Integration

Send Peppol-compliant documents with dynamic SMP discovery

Key features

Multi-profile support

Peppol, CEF, BDEW, ENTSOG, EUDAMED, EuCTP, DBNAlliance, and HRE-Delivery profiles built-in

Send and receive

Full AS4 client and server capabilities — send user messages and receive via servlet

WS-Security

WSS4J-based signing and encryption with flexible key store configuration

Dynamic discovery

Automatic SMP/SML endpoint lookup for Peppol, BDXR, and BDXR2 networks

Builder pattern API

Fluent Java builder API for constructing and sending AS4 messages

PMode management

In-memory and XML-persistent PMode management with full validation

Architecture overview

phase4 is structured as a multi-module Maven project:
ModulePurpose
phase4-libCore AS4 library — sender, receiver, crypto, PMode
phase4-profile-peppolPeppol AS4 profile definitions and validators
phase4-profile-cefCEF eDelivery profile (also used by EUDAMED)
phase4-profile-bdewBDEW energy sector profile
phase4-profile-entsogENTSOG gas network profile
phase4-profile-dbnallianceDBNAlliance North American B2B profile
phase4-profile-edelivery2eDelivery AS4 2.0 profile (EdDSA/ECDSA variants)
phase4-peppol-clientHigh-level Peppol sender (Phase4PeppolSender)
phase4-cef-clientHigh-level CEF sender (Phase4CEFSender)
phase4-bdew-clientHigh-level BDEW sender (Phase4BDEWSender)
phase4-eudamed-clientHigh-level EUDAMED sender (Phase4EudamedSender)
phase4-peppol-servletPeppol AS4 receiving servlet
phase4-peppol-server-webappExample Peppol server web application
phase4-dynamic-discoverySMP/BDXR dynamic endpoint discovery

Maven coordinates

The core library is published to Maven Central under the com.helger.phase4 group ID:
pom.xml
<dependency>
  <groupId>com.helger.phase4</groupId>
  <artifactId>phase4-lib</artifactId>
  <version>4.4.0</version>
</dependency>
See the Installation guide for profile-specific dependencies.

License

phase4 is released under the Apache License 2.0.

Build docs developers (and LLMs) love