com.helger.phase4.senderMaven artifact:
com.helger.phase4:phase4-lib
AS4Sender is the entry point for sending generic AS4 messages without applying any profile-specific settings. Use the profile-specific senders (e.g. Phase4PeppolSender) when you need profile enforcement.
Factory methods
BuilderUserMessage
BuilderUserMessage extends AbstractAS4UserMessageBuilderMIMEPayload. The payload is always placed in a MIME part rather than in the SOAP body.
Required fields
The AS4 sender party identifier value. Maps to
eb:PartyInfo/eb:From/eb:PartyId.The sender role URI. Maps to
eb:PartyInfo/eb:From/eb:Role.The AS4 receiver party identifier value. Maps to
eb:PartyInfo/eb:To/eb:PartyId.The receiver role URI. Maps to
eb:PartyInfo/eb:To/eb:Role.The destination AS4 endpoint URL to send to.
The P-Mode governing this message exchange. Optional — if not set explicitly, the
pmodeResolver will attempt to find a matching PMode automatically based on the message metadata.Optional fields
The party ID type (scheme) for the sender party. Optional.
The party ID type (scheme) for the receiver party. Optional.
The service type of the
eb:Service element. Optional.The service value of the
eb:Service element. Optional.The
eb:Action value. Optional.The
eb:AgreementRef value. Optional.The
eb:AgreementRef type attribute value. Optional. Since 2.7.8.The PMode ID to be included in the user message. Optional.
The AS4 conversation ID. If not set, a random ID is generated.
The main payload sent as the first MIME attachment. Use
AS4OutgoingAttachment.Builder to construct.The X.509 certificate of the receiver used for message encryption. Mutually exclusive with
receiverCertificateAlias.Alias into the crypto factory keystore identifying the receiver certificate. Mutually exclusive with
receiverCertificate. Since 2.1.4.Force the message to be wrapped in a MIME envelope even when there are no attachments. Since 2.5.1.
Optional callback receiving the synchronous AS4 Signal Message response.
Optional informational callback invoked after signal message reference validation. Since 3.0.1.
Attachment management
Message properties
Sending
EAS4UserMessageSendResult
Return value ofsendMessageAndCheckForReceipt().
| Enum value | ID | Description | Retry feasible |
|---|---|---|---|
SUCCESS | success | Receipt received — message delivered successfully | — |
INVALID_PARAMETERS | invalid-parameters | Mandatory builder fields were missing or incorrect | No |
TRANSPORT_ERROR | transport-error | Network or HTTP(S) level failure | Yes |
TRANSPORT_ERROR_NO_RETRY | transport-error-no-retry | Network/HTTP failure where retry is not recommended (since 3.2.0) | No |
NO_SIGNAL_MESSAGE_RECEIVED | no-signal-msg-received | No valid AS4 Signal Message in the response | Yes |
AS4_ERROR_MESSAGE_RECEIVED | as4-error-msg-received | AS4 Error Message returned by the other side | No |
INVALID_SIGNAL_MESSAGE_RECEIVED | invalid-signal-message-received | Signal Message contained neither error nor receipt | Yes |
BuilderPullRequest
BuilderPullRequest extends AbstractAS4PullRequestBuilder. Available since 0.12.0.
Required fields
The Message Partition Channel (MPC) to reference in the Pull Request.
The destination AS4 endpoint URL.
Optional fields
The P-Mode to use. Optional.
Optional PMode ID to include. Since 3.0.0.
Whether to use Leg 1 (
true) or Leg 2 (false) of the PMode. Since 2.7.8.Optional consumer for the AS4 User Message received in response.
Optional consumer for the AS4 Signal Message received in response.