EbxmlMessage¶
-
public class
EbxmlMessage
¶ A representation of an ebXML message. An ebXML message conforms to the ` SOAP 1.1 with Attachments Specification <http://www.w3.org/TR/2000/NOTE-SOAP-attachments-20001211>`_. This
EbxmlMessage
encapsulates ajavax.xml.soap.SOAPMessage
.Author: cyng
Fields¶
CHARACTER_SET_ENCODING¶
SOAP_ACTION_VALUE¶
SOAP_PART_CONTENT_ID¶
Constructors¶
EbxmlMessage¶
-
public
EbxmlMessage
()¶ Constructs an
EbxmlMessage
using the default JAXMMessageFactory
implementationThrows: - SOAPException – Description of the Exception
EbxmlMessage¶
-
public
EbxmlMessage
(MessageFactory messageFactory)¶ Constructs an
EbxmlMessage
using the providedjavax.xml.soap.MessageFactory
Parameters: - messageFactory –
MessageFactory
for creating message.
Throws: - SOAPException – Description of the Exception
- messageFactory –
EbxmlMessage¶
-
public
EbxmlMessage
(File file)¶ construct an
EbxmlMessage
from File using the logic in MessageServer. The file must not contain any content header like Content-TypeParameters: - file – the file contain the messsage.
Throws: - SOAPException – Description of the Exception
- IOException – Description of the Exception
EbxmlMessage¶
-
public
EbxmlMessage
(InputStream inputStream)¶ constructs an
EbxmlMessage
from InputStream using the logic in MessageServer. The input stream must not contain any content headers like Content-type.Parameters: - inputStream – Description of the Parameter
Throws: - SOAPException – Description of the Exception
- IOException – Description of the Exception
EbxmlMessage¶
-
public
EbxmlMessage
(SOAPMessage soapMessage)¶ Constructs an
EbxmlMessage
using the givenSOAPMessage
Parameters: - soapMessage –
Throws: - SOAPException – Description of the Exception
EbxmlMessage¶
-
public
EbxmlMessage
(MimeHeaders headers, InputStream in)¶ Constructs a
EbxmlMessage
using the givenInputStream
and default JAXMMessageFactory
implementationParameters: - headers – MIME headers to be included in the message.
- in – Message content in form of
InputStream
.
Throws: - IOException – Description of the Exception
- SOAPException – Description of the Exception
Methods¶
addAckRequested¶
-
public void
addAckRequested
(boolean signed)¶ Add acknowledgement request element to the message.
Parameters: - signed – The feature to be added to the AckRequested attribute
Throws: - SOAPException –
addAcknowledgment¶
-
public void
addAcknowledgment
(String timestamp, EbxmlMessage refToMessage)¶ Add acknowledgement element to the message using given timestamp, refToMessageId.
Parameters: - timestamp – Timestamp string expressed in UTC format.
- refToMessage – The feature to be added to the Acknowledgment attribute
Throws: - SOAPException – Description of the Exception
addAcknowledgment¶
-
public void
addAcknowledgment
(String timestamp, EbxmlMessage refToMessage, String fromPartyId)¶ Add acknowledgement element to the message using given timestamp, refToMessageId and fromPartyId.
Parameters: - timestamp – Timestamp string expressed in UTC format.
- fromPartyId – Sender party ID.
- refToMessage – The feature to be added to the Acknowledgment attribute
Throws: - SOAPException – Description of the Exception
addAcknowledgment¶
-
public void
addAcknowledgment
(String timestamp, EbxmlMessage refToMessage, String fromPartyId, String fromPartyIdType)¶ Add acknowledgement element to the message using given timestamp, refToMessageId, fromPartyId and fromPartyIdType.
Parameters: - timestamp – Timestamp string expressed in UTC format.
- fromPartyId – Sender party ID.
- fromPartyIdType – Sender party ID type.
- refToMessage – The feature to be added to the Acknowledgment attribute
Throws: - SOAPException – Description of the Exception
addErrorList¶
-
public void
addErrorList
(String errorCode, String severity, String description)¶ Add an error list to the message using given error code, severity and description.
Parameters: - errorCode – [ebMSS 4.2.3.4]
- severity – Valid values are “Error” and “Warning”.
- description – Description of the error.
Throws: - SOAPException – Description of the Exception
addErrorList¶
-
public void
addErrorList
(String errorCode, String severity, String description, String location)¶ Add an error list to the message using given error code, severity and description.
Parameters: - errorCode – [ebMSS 4.2.3.4]
- severity – Valid values are “Error” and “Warning”.
- description – Description of the error.
- location – Location of the message containing the error.
Throws: - SOAPException –
addMessageHeader¶
-
public MessageHeader
addMessageHeader
(String fromPartyId, String toPartyId, String cpaId, String conversationId, String service, String action, String messageId, String timestamp)¶ Adds a
MessageHeader
to thisEbxmlMessage
with the given mandatory fieldsParameters: - fromPartyId – Party ID of the sender [ebMSS 3.1.1.1]
- toPartyId – Party ID of the receiver [ebMSS 3.1.1.1]
- cpaId – CPA Id [ebMSS 3.1.2]
- conversationId – ID of the conversation in which this message is involved [ebMSS 3.1.3]
- service – Service name [ebMSS 3.1.4]
- action – Action name [ebMSS 3.1.5]
- messageId – Unique identifier of the message [ebMSS 3.1.6.1]
- timestamp – Date/time of the message header creation expressed as UTC [ebMSS 3.1.6.2]
Throws: - SOAPException – Description of the Exception
Returns: the newly added
MessageHeader
addMessageHeader¶
-
public MessageHeader
addMessageHeader
(String fromPartyId, String fromPartyIdType, String toPartyId, String toPartyIdType, String cpaId, String conversationId, String service, String action, String messageId, String timestamp)¶ Adds a
MessageHeader
to thisEbxmlMessage
with the given mandatory fieldsParameters: - fromPartyId – Party ID of the sender [ebMSS 3.1.1.1]
- fromPartyIdType – PartyID type of the sender [ebMSS 3.1.1.1]
- toPartyId – Party ID of the receiver [ebMSS 3.1.1.1]
- toPartyIdType – PartyID type of the receiver [ebMSS 3.1.1.1]
- cpaId – CPA Id [ebMSS 3.1.2]
- conversationId – ID of the conversation in which this message is involved [ebMSS 3.1.3]
- service – Service name [ebMSS 3.1.4]
- action – Action name [ebMSS 3.1.5]
- messageId – Unique identifier of the message [ebMSS 3.1.6.1]
- timestamp – Date/time of the message header creation expressed as UTC [ebMSS 3.1.6.2]
Throws: - SOAPException – Description of the Exception
Returns: the newly added
MessageHeader
addMessageHeader¶
-
public MessageHeader
addMessageHeader
()¶ Adds a default
MessageHeader
to thisEbxmlMessage
.Throws: - SOAPException –
Returns: the newly added
MessageHeader
addMessageOrder¶
-
public void
addMessageOrder
(int status, int sequenceNumber)¶ Add a MessageOrder element to the header.
Parameters: - status – Status of the sequence number. It should have the value of either MessageOrder.STATUS_RESET or MessageOrder.STATUS_CONTINUE.
- sequenceNumber – Sequence number to be assigned to this message.
Throws: - SOAPException – Description of the Exception
addPayloadContainer¶
-
public PayloadContainer
addPayloadContainer
(DataHandler dataHandler, String contentId, String description)¶ Add an ebXML message payload container.
Parameters: - dataHandler – the
DataHandler
that generates the payload content. - contentId – the contentId of this payload attachment. The contentId must be unique among all payload attachment.
- description – the description of this payload.
Throws: - SOAPException –
Returns: the
PayloadContainer
object that is created and added.- dataHandler – the
addStatusRequest¶
addStatusResponse¶
addStatusResponse¶
-
public void
addStatusResponse
(String refToMessageId, String messageStatus, String timestamp)¶ Add a status response element to the message.
Parameters: - refToMessageId – Identifier of the message it is referring to.
- messageStatus – Status string to be added in the response element.
- timestamp – Timestamp of the status response expressed in UTC format.
Throws: - SOAPException –
addSyncReply¶
-
public void
addSyncReply
()¶ Add a SyncReply element to the message.
Throws: - SOAPException –
getAckRequested¶
-
public AckRequested
getAckRequested
()¶ Get acknowledgement request element.
Returns: AckRequested
object representing the element.
getAcknowledgment¶
-
public Acknowledgment
getAcknowledgment
()¶ Get acknowledgement element.
Returns: Acknowledgement
object representing the element.
getDatasource¶
-
public DataSource
getDatasource
()¶ Returns: Returns the datasource.
getDuplicateElimination¶
-
public boolean
getDuplicateElimination
()¶ Gets the flag stating if duplicate elimination is enabled or not.
Returns: true if duplicate elimination is required; false otherwise.
getErrorList¶
getFileName¶
getFromPartyIds¶
getHeaderContainer¶
-
public HeaderContainer
getHeaderContainer
()¶ Returns: Returns the headerContainer.
getManifest¶
getMessageFromDataSource¶
-
public static Object
getMessageFromDataSource
(DataSource dataSource, boolean withAttachments)¶
getMessageHeader¶
-
public MessageHeader
getMessageHeader
()¶ Get the message header of this ebXML message.
Returns: MessageHeader
of this ebXML message.
getMessageOrder¶
-
public MessageOrder
getMessageOrder
()¶ Get the message order element in the message.
Returns: MessageOrder
object if it exists in the ebXML message; null otherwise.
getMimeHeaders¶
getMimeHeaders¶
-
public Map
getMimeHeaders
(String soapEncoding, String payloadEncoding)¶ Gets the MIME headers of this ebXML message
Parameters: - soapEncoding – content transfer encoding to be applied to SOAP part when computing length
- payloadEncoding – content transfer encoding to be applied to payload when computing length
Throws: - IOException – Description of the Exception
- SOAPException – Description of the Exception
Returns: the MIME headers of this ebXML message
getPayloadContainer¶
-
public PayloadContainer
getPayloadContainer
(String contentId)¶ Gets the payload that is identified by the given content ID.
Parameters: - contentId – Content ID of the payload to be retrieved.
Returns: PayloadContainer
of the given content ID ornull
if no suchPayloadContainer
exists
getPayloadContainers¶
getPayloadCount¶
-
public int
getPayloadCount
()¶ Gets the number of payloads in this ebXML message
Returns: the number of payloads
getPayloadInError¶
getPersistenceHandler¶
getPersistenceName¶
getSOAPMessage¶
-
public SOAPMessage
getSOAPMessage
()¶ Gets the
SOAPMessage
encapsulated in thisEbxmlMessage
.Returns: SOAPMessage
representing thisEbxmlMessage
getSignatures¶
getSoapEnvelopeBytes¶
-
byte[]
getSoapEnvelopeBytes
()¶ Get the soap envelope in bytes. This function will only be used by the Hermes Server itself, and it is not expected for the client to call it.
getSoapEnvelopeBytesFromStream¶
-
public static byte[]
getSoapEnvelopeBytesFromStream
(InputStream stream)¶ parse the message from InputStream and get the byte array of SOAP Envelope
Parameters: - stream – the InputStream contains the message
Throws: - MessageServerException – throw if there is error on parsing
Returns: the byte array of the Soap Envelope
getStatusRequest¶
-
public StatusRequest
getStatusRequest
()¶ Get the status request element in the message.
Returns: Content of the status request element stored in StatusRequest
object.
getStatusResponse¶
-
public StatusResponse
getStatusResponse
()¶ Get the status response element in the message.
Returns: Content of the status response element stored in StatusResponse
object.
getSyncReply¶
-
public boolean
getSyncReply
()¶ Gets the flag stating if sync reply is enabled or not.
Returns: true if sync reply is enabled; false otherwise.
getTimeToLive¶
getTimestamp¶
getToPartyIds¶
saveChanges¶
-
public void
saveChanges
()¶ Updates the encapsulated
SOAPMessage
with all changes that have been made to it.Throws: - SOAPException –
See also:
javax.xml.soap.SOAPMessage.saveChanges()
saveRequired¶
-
public boolean
saveRequired
()¶ Indicates whether the encapsulated
SOAPMessage
need to be updated by callingsaveChanges
on it.Returns: true if it is required to call saveChanges on the message; false otherwise.
setFileName¶
setPayloadContainers¶
setPersistenceInfo¶
-
public void
setPersistenceInfo
(String persistenceName, Object handler, DataSource datasource)¶ set the persistence info to the message This function will only be used by the Hermes Server itself, and it is not expected for the client to call it.
Parameters: - persistenceName – the name on the persistence handler
- handler – the persistence handler
setSoapEnvelopeBytes¶
-
public void
setSoapEnvelopeBytes
(byte[] soapEnvelopeBytes)¶ set the soap envelope in bytes. Those bytes will be used to verify This function will only be used by the Hermes Server itself, and it is not expected for the client to call it. the signature.
writeTo¶
-
public void
writeTo
(OutputStream out)¶ Writes the encapsulated
SOAPMessage
to the given output stream. The externalization format is as defined by the SOAP 1.1 with Attachments Specification.Parameters: - out –
OutputStream
to write the message to.
Throws: - IOException – Description of the Exception
- SOAPException – Description of the Exception
- out –
writeTo¶
-
public void
writeTo
(OutputStream out, String soapEncoding, String payloadEncoding)¶ Writes the encapsulated
SOAPMessage
to the given output stream. The externalization format is as defined by the SOAP 1.1 with Attachments Specification.Parameters: - out –
OutputStream
to write the message to. - soapEncoding – Description of the Parameter
- payloadEncoding – Description of the Parameter
Throws: - IOException – Description of the Exception
- SOAPException – Description of the Exception
- out –