B2B communication protocols
AS4: B2B messaging with web services security
AS4 is an OASIS standard for secure, reliable B2B messages using web services. It is used by e-invoicing and e-procurement networks, energy markets and government exchanges. ECOM sets up AS4 connections, certificates and receipts and maps the documents they carry.
- Specification
- OASIS AS4 profile of ebMS 3.0
- Transport
- SOAP over HTTPS
- Message security
- WS-Security signatures and encryption
- Receipts
- Signed receipts (non-repudiation)
AS4 counterparties exchange secure, receipted messages with the gateway.
Overview
What AS4 is
AS4 is a profile of the ebXML Messaging Services 3.0 standard. It packages business documents as attachments to a SOAP message, signs and encrypts them with WS-Security, and returns a signed receipt. It adds reliability features such as retries and duplicate detection.
Unlike AS2, AS4 supports both push, where the sender delivers the message, and pull, where the receiver collects waiting messages, which helps partners that cannot accept incoming connections. Networks build their own profiles on top of AS4, specifying algorithms, identifiers and processes.
Where businesses use it
E-invoicing networks
Some e-invoicing and e-procurement networks, such as Peppol, use AS4 between their access points.
Energy markets
Gas transmission operators in Europe exchange data using AS4 profiles.
Government and customs
Public-sector exchanges that require web services security.
How it works
How an AS4 exchange works
The sender builds a SOAP envelope with an ebMS header naming the parties, service and action, attaches the business document, signs it and encrypts the attachment, and posts it over HTTPS. The receiver verifies, decrypts and returns a signed receipt as a signal message.
With pull, the sender places the message on its server, and the receiver sends a pull request to collect it. Retries and duplicate detection make delivery reliable even when a connection drops.
The receipt proves delivery. If none arrives, the sender retries; the receiver discards duplicates.
In depth
AS4 security and reliability
WS-Security
XML signatures protect integrity and origin; encryption protects the payload. Network profiles set the algorithms.
TLS
HTTPS protects the connection; WS-Security protects the message itself, so both layers apply.
Receipts
Signed receipts give non-repudiation of receipt, much like signed MDNs in AS2.
Push and pull
Pull lets partners without a public endpoint collect their messages.
Reliability
Retries, duplicate elimination and error signals are part of the profile.
Network profiles
Each network defines identifiers, certificates and processes; some require registered or certified participants, confirmed during scoping.
In practice
Example: exchanging documents on an AS4-based network
A company exchanges documents with partners on a network whose profile is based on AS4.
The network's profile decides most technical settings; mapping decides how documents reach your ERP.
Connections
How AS4 connects your business
Networks and partners
AS4 connections to networks and direct partners.
Document formats
The XML documents carried, such as e-invoices, are mapped to your systems.
ERP
Invoices and orders reach your ERP.
Monitoring
Receipts and errors are tracked.
ECOM
How ECOM supports AS4
ECOM supports AS4 with dedicated implementation, mapping, communication and support teams, and with specialists who know the industries your partners work in.
Implementation team
Plans the AS4 setup with you, configures it on the gateway and runs the tests with your partners and systems.
Mapping team
Builds and maintains the maps, code conversions and validation rules between partner data and your applications.
Communication team
Sets up and monitors partner connections, certificates, keys and credentials, and coordinates changes with each partner.
Support team
Watches the flows, investigates failed or missing documents, and works the issue through with you and your partner.
For AS4 in particular
- AS4 endpoint, certificate and receipt setup to the network or partner profile.
- Mapping of the documents AS4 carries, such as XML invoices, to your ERP.
- Partner onboarding for AS4: exchanging connection details, testing in both directions and confirming the go-live date with each partner.
- Monitoring of every connection, with alerts for failed, missing or unacknowledged transfers.
Frequently asked questions
What is the difference between AS2 and AS4?
Both send business documents securely with receipts. AS2 uses S/MIME over HTTP. AS4 uses SOAP web services with WS-Security, supports pull as well as push, and has built-in reliability features.
Who uses AS4?
Networks and markets that adopted it in their profiles, such as some e-invoicing networks, European energy operators and government exchanges.
Can ECOM connect us to an AS4 network?
ECOM confirms the network's profile and participation rules during scoping, including whether a registered or certified participant is required, and sets up the connection accordingly.
Does AS4 replace AS2?
Not generally. AS2 remains common in supply chains; AS4 is used where a network or market requires it.
Talk to an EDI/API Expert
Tell us which partners, systems and AS4 requirements you are working with. An ECOM specialist will review them with you and outline the setup, the maps and the tests.