User Manual
This page describes how to use the EbMS Adapter through its REST and SOAP interfaces. See EbMS Admin for installation and EbMS API for a method-level reference. The OpenAPI spec is available here.
Before you can exchange EbMS messages with another party you have to register a CPA that defines the contract between both parties (endpoints, certificates, retry policy). Optionally you can override CPA URLs and certificates per environment using URL Mappings and Certificate Mappings. After that you can exchange messages and track them through message events.
Manage CPAs
You can manage CPAs using the REST and SOAP CPAService.
validateCPA(cpa)— validate the CPA document before storing itinsertCPA(cpa, overwrite)— store the CPA; ifoverwriteistruean existing CPA with the samecpaIdis replacedgetCPAIds()— list all registeredcpaIdsgetCPA(cpaId)— retrieve a stored CPAdeleteCPA(cpaId)— remove a CPA
Manage URL Mappings
You can override the endpoint URLs from a CPA per environment using the REST and SOAP URLMappingService. This is useful for routing the same CPA to a remote EbMS adapter through a Proxy Server or for testing purposes.
setURLMapping(urlMapping)— map asourceURL (as defined in the CPA) to a destination URLgetURLMappings()— list all URL mappingsdeleteURLMapping(source)— remove the mapping forsource
Manage Certificate Mappings
You can override the SSL certificates from a CPA per environment using the REST and SOAP CertificateMappingService.
setCertificateMapping(certificateMapping)— map asourceSSL certificate (as defined in the CPA) to a destination SSL certificategetCertificateMappings()— list all certificate mappingsdeleteCertificateMapping(source)— remove the mapping forsource
Exchange Messages
The EbMS Adapter exchanges messages with remote EbMS adapters defined in a CPA, using the REST and SOAP EbMSMessageService. For large or binary payloads use the MTOM-enabled variant (see EbMS API).
Send a message
sendMessage(message)— submit the message to the EbMS Adapter; the adapter returns a generatedmessageIdand asynchronously delivers it to the remote adapter according to the CPA's retry policygetMessageStatus(messageId)— check the delivery status- Optional:
resendMessage(messageId)— resend a message; a newmessageIdis returned
To be notified of delivery results without polling, configure an EventListener and consume Message Events.
Receive messages
When the remote adapter sends an EbMS message, the EbMS Adapter stores it with status RECEIVED. The application polls and processes it:
getUnprocessedMessageIds(messageFilter, maxNr)— list message IDs that matchmessageFilterand have statusRECEIVEDgetMessage(messageId, process)— retrieve the message; whenprocessistruethe message is markedPROCESSEDand no longer returned bygetUnprocessedMessageIds- Alternative: retrieve the message with
process=falseand callprocessMessage(messageId)after successful processing
Ping
You can verify connectivity and the CPA configuration with a remote adapter without sending business data:
ping(cpaId, fromPartyId, toPartyId)— performs an EbMS ping for the given CPA and party IDs
Message Events
Message Events let an application track the lifecycle of sent and received messages. They require eventListener.type = DAO.
getUnprocessedMessageEvents(messageFilter, eventTypes, maxNr)— list events matchingmessageFilterandeventTypes. Event types:RECEIVED— a message was receivedDELIVERED— a message was sent successfullyFAILED— a message returned an error while sendingEXPIRED— a message could not be sent within the attempts and time defined in the CPA
getMessage(messageId, process)— retrieve the message referenced by aRECEIVEDeventprocessMessageEvent(messageId)— mark the event processed so it is no longer returned bygetUnprocessedMessageEvents(and, forRECEIVEDevents, bygetUnprocessedMessageIds)