MessageHeader

public class MessageHeader extends HeaderElement

An ebXML MessageHeader in the SOAP Header of a HeaderContainer

Author:cyng

Fields

ATTRIBUTE_TYPE

static final String ATTRIBUTE_TYPE

MessageHeader Type attribute name

ELEMENT_ACTION

static final String ELEMENT_ACTION

MessageHeader Action element name

ELEMENT_CONVERSATION_ID

static final String ELEMENT_CONVERSATION_ID

MessageHeader ConversationID element name

ELEMENT_CPA_ID

static final String ELEMENT_CPA_ID

MessageHeader CPAID element name

ELEMENT_DUPLICATE_ELIMINATION

static final String ELEMENT_DUPLICATE_ELIMINATION

MessageHeader DuplicateElimination element name

ELEMENT_FROM

static final String ELEMENT_FROM

MessageHeader From element name

ELEMENT_MESSAGE_DATA

static final String ELEMENT_MESSAGE_DATA

MessageHeader MessageData element name

ELEMENT_MESSAGE_ID

static final String ELEMENT_MESSAGE_ID

MessageHeader MessageId element name

ELEMENT_PARTY_ID

static final String ELEMENT_PARTY_ID

MessageHeader PartyID element name

ELEMENT_REF_TO_MESSAGE_ID

static final String ELEMENT_REF_TO_MESSAGE_ID

MessageHeader RefToMessageID element name

ELEMENT_ROLE

static final String ELEMENT_ROLE

MessageHeader Role element name

ELEMENT_SERVICE

static final String ELEMENT_SERVICE

MessageHeader Service element name

ELEMENT_TIMESTAMP

static final String ELEMENT_TIMESTAMP

MessageHeader Timestamp element name

ELEMENT_TIME_TO_LIVE

static final String ELEMENT_TIME_TO_LIVE

MessageHeader TimeToLive element name

ELEMENT_TO

static final String ELEMENT_TO

MessageHeader To element name

MESSAGE_HEADER

static final String MESSAGE_HEADER

MessageHeader element name

TIME_ZONE

static final String TIME_ZONE

Standard time zone used in Message Service Handler

Constructors

MessageHeader

MessageHeader(SOAPEnvelope soapEnvelope)

Initializes data structures in MessageHeader object using the given SOAPEnvelope.

Parameters:
  • soapEnvelopeSOAPEnvelope into which the MessageHeader is added.
Throws:
  • SOAPException

MessageHeader

MessageHeader(SOAPEnvelope soapEnvelope, String fromPartyId, String fromPartyIdType, String toPartyId, String toPartyIdType, String cpaId, String conversationId, String service, String action, String messageId, String timestamp)

Constructs a MessageHeader with the given mandatory fields. No further modification on the fields specified are allowed.

Parameters:
  • soapEnvelopeSOAPEnvelope into which the MessageHeader is added.
  • fromPartyId – PartyID of the sender.
  • fromPartyIdType – PartyID type of the sender.
  • toPartyId – PartyID of the recipient.
  • toPartyIdType – PartyID type of the recipient.
  • cpaId – CPA ID.
  • conversationId – Conversation ID of the message.
  • service – Service name.
  • action – Action name.
  • messageId – Unique message identifier.
  • timestamp – Timestamp of the message header creation.
Throws:
  • SOAPException

MessageHeader

MessageHeader(SOAPEnvelope soapEnvelope, SOAPElement soapElement)

Constructs a MessageHeader with the given SOAPEnvelope and SOAPElement.

Parameters:
  • soapEnvelopeSOAPEnvelope into which the MessageHeader is added.
  • soapElementSOAPElement to be parsed and stored in the MessageHeader.
Throws:
  • SOAPException

Methods

addDescription

public void addDescription(String description)

Add element with default xml:lang

Parameters:
  • description – Description to be added to MessageHeader
Throws:
  • SOAPException

addDescription

public void addDescription(String description, String lang)

Add element with specified xml:lang. This method can be called repeatedly to add several descriptions to the MessageHeader

Parameters:
Throws:
  • SOAPException

addFromPartyId

public void addFromPartyId(String id)

Add sender’s PartyID into MessageHeader

Parameters:
  • id – Sender’s PartyID string.
Throws:
  • SOAPException

addFromPartyId

public void addFromPartyId(String id, String type)

Add sender’s PartyID and its type into MessageHeader

Parameters:
  • id – Sender’s PartyID string.
  • type – PartyID type.
Throws:
  • SOAPException

addToPartyId

public void addToPartyId(String id)

Add recipient’s PartyID into MessageHeader

Parameters:
  • id – Recipient’s PartyID string.
Throws:
  • SOAPException

addToPartyId

public void addToPartyId(String id, String type)

Add recipient’s PartyID and its type into MessageHeader

Parameters:
  • id – Recipient’s PartyID string.
  • type – PartyID type.
Throws:
  • SOAPException

getAction

public String getAction()

Get action name.

Returns:Action name.

getConversationId

public String getConversationId()

Get conversationId

Returns:Conversation ID of the message.

getCpaId

public String getCpaId()

Get cpaId.

Returns:Collaborative Protocol Agreement ID.

getDescriptionCount

public int getDescriptionCount()

Gets the number of Description elements in this MessageHeader.

Returns:The number of Description elements.

getDescriptions

public Iterator getDescriptions()

Get all Description elements in this MessageHeader.

Returns:an Iterator of Descriptions’.

getDuplicateElimination

public boolean getDuplicateElimination()

Get current setting of duplication elimination.

Returns:true if duplicate elimination is enabled; false otherwise.

getFrom

ExtensionElement getFrom()

Get From core extension element.

Returns:From extension element object.

getFromPartyIds

public Iterator getFromPartyIds()

Get Sender’s PartyId in header. It can have one or more occurrences.

Returns:Iterator pointing to a list of senders’ Party IDs.

getFromRole

public String getFromRole()

Get Role element in the From core extension element.

Returns:Role name.

getMessageData

ExtensionElement getMessageData()

Get MessageData core extension element.

Returns:MessageData ExtensionElement

getMessageId

public String getMessageId()

Get messageId.

Returns:Unique message identifier.

getRefToMessageId

public String getRefToMessageId()

Get the unique identifier of the message this message refers to.

Returns:ID of the message being referred to.

getService

public String getService()

Get service name

Returns:Service name.

getServiceType

public String getServiceType()

Get the service type string.

Returns:Service type string.

getTimeToLive

public String getTimeToLive()

Get TimeToLive

Returns:TimeToLive expressed in UTC format.

getTimestamp

public String getTimestamp()

Get header creation timestamp expressed in UTC format.

Returns:Timestamp expressed in UTC format.

getTo

ExtensionElement getTo()

Get To core extension element.

Returns:To extension element object.

getToPartyIds

public Iterator getToPartyIds()

Get recipient’s PartyId in header. It can have one or more occurrences.

Returns:Iterator pointing to a list of recipients’ Party IDs.

getToRole

public String getToRole()

Get Role element in the To core extension element.

Returns:Role name.

setAction

public void setAction(String action)

Set action name. This property can be set only once.

Parameters:
  • action – Action name.
Throws:
  • SOAPException

setConversationId

public void setConversationId(String conversationId)

Set conversationId. This property can be set only once.

Parameters:
  • conversationId – Conversation ID of the message.
Throws:
  • SOAPException

setCpaId

public void setCpaId(String cpaId)

Set cpaId of the message header. This property can be set only once.

Parameters:
  • cpaId – Collaborative Protocol Agreement ID.
Throws:
  • SOAPException

setDuplicateElimination

public void setDuplicateElimination()

Enable duplication elimination function. This property can be set only once.

Throws:
  • SOAPException

setFromRole

public void setFromRole(String role)

Set Role element in the From core extension element.

Parameters:
  • role – Role name.
Throws:
  • SOAPException

setMessageId

public void setMessageId(String messageId)

Set messageId. This property can be set only once.

Parameters:
  • messageId – Unique message identifier.
Throws:
  • SOAPException

setRefToMessageId

public void setRefToMessageId(String messageId)

Set optional “RefToMessageId” element. This property can be set only once.

Parameters:
  • messageId – Message ID to be set in the current message header.
Throws:
  • SOAPException

setService

public void setService(String serviceName)

Set service name. This property can be set only once.

Parameters:
  • serviceName – Service name.
Throws:
  • SOAPException

setService

public void setService(String serviceName, String serviceType)

Set service. This property can be set only once.

Parameters:
  • serviceName – Service name.
  • serviceType – Service type string.
Throws:
  • SOAPException

setServiceType

public void setServiceType(String type)

Set optional “type” attribute in service element

Throws:
  • SOAPException

setTimeToLive

public void setTimeToLive(String time)

Set optional “TimeToLive” element. This property can be set only once.

Parameters:
  • time – TimeToLive expressed in UTC format.
Throws:
  • SOAPException

setTimeToLive

public void setTimeToLive(Date time)

Convert local date/time to UTC string and set TimeToLive value. This property can be set only once.

Parameters:
  • time – Local date/time to be converted to UTC format and set as TimeToLive value.
Throws:
  • SOAPException

setTimestamp

public void setTimestamp(String timestamp)

Set timestamp.

Parameters:
  • timestamp – Header creation timestamp expressed in UTC format.
Throws:
  • SOAPException

setToRole

public void setToRole(String role)

Set Role element in the To core extension element.

Parameters:
  • role – Role name.
Throws:
  • SOAPException