com.helger.phase4.dynamicdiscoveryMaven artifact:
com.helger.phase4:phase4-dynamic-discovery
Service Metadata Publishers (SMPs) provide the link between a participant identifier and their AS4 endpoint URL and certificate. phase4 integrates SMP lookup via implementations of IAS4EndpointDetailProvider.
How SMP lookup works
- The sender calls
endpointDetailProvider.init(docTypeID, processID, receiverID)immediately before sending. - The provider queries the SMP for service metadata.
- The provider filters for the configured
ISMPTransportProfile(e.g.TRANSPORT_PROFILE_PEPPOL_AS4_V2). - The receiver’s AP certificate and endpoint URL are extracted from the result.
- The certificate is optionally validated against a CA trust store.
- The AS4 message is sent to the resolved URL, encrypted with the resolved certificate.
Supported SMP types
| Class | SMP standard | Used by |
|---|---|---|
AS4EndpointDetailProviderPeppol | Peppol SMP (OASIS BDX) | Peppol |
AS4EndpointDetailProviderBDXR | OASIS BDXR SMP v1 | CEF, EUDAMED |
AS4EndpointDetailProviderBDXR2 | OASIS BDXR SMP v2 | CEF v2 |
AS4EndpointDetailProviderConstant | Static (no SMP) | Testing, known endpoints |
AS4EndpointDetailProviderPeppol configuration
Create from a SMPClientReadOnly
Override transport profile
ESMPTransportProfile.TRANSPORT_PROFILE_PEPPOL_AS4_V2.
Low-level constructor
If you need separateISMPServiceGroupProvider and ISMPExtendedServiceMetadataProvider instances:
Phase4SMPException
Phase4SMPException is thrown by all SMP-based providers when an SMP lookup fails. It extends Phase4Exception.
isRetryFeasible() | Cause |
|---|---|
true | Transient network failure, bad request, bad response, unauthorized |
false | Endpoint not found or structural error |
Error handling example
SMP integration in profile senders
Profile-specific senders integrate SMP lookup via dedicated convenience methods:- Peppol
- CEF
- Generic