public class MessageHeader extends Object implements XMLMarshallable
Java class represents the header of a message sent via HCI sent by your client application to a connected SAP CC Core Server system; It
includes information about the message originator and specifies the processing mode (TRANSACTION_ALL)
of the operation requests that are included in the sent message body.
The message header MessageHeader contains:
message originator, that is who (or what) sends the message, and
the mean to authenticate it.Important Note
Make sure you specify the transaction mode that is relevant with your business requirements.
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="header">
<xs:complexType>
<xs:sequence>
<xs:element ref="originator" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="transaction" type="TransactionBehaviorType" default="all"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="TransactionBehaviorType">
<xs:restriction base="xs:string">
<xs:enumeration value="all"/>
<xs:enumeration value="firstFail"/>
<xs:enumeration value="most"/>
<xs:enumeration value="try"/>
</xs:restriction>
</xs:simpleType>
| Modifier and Type | Class and Description |
|---|---|
static class |
MessageHeader.TransactionMode
This
enumeration lists the transaction modes used by the SAP CC system to process the received operation messages and the service operations
that are included in these message envelopes. |
| Modifier and Type | Field and Description |
|---|---|
static MessageHeader.TransactionMode |
TRANSACTION_ALL
In this transaction mode, all or none of the operations are executed by the SAP CC system.
|
static MessageHeader.TransactionMode |
TRANSACTION_FIRST_FAIL
In this transaction mode, all operations are executed until
the first that fails.
|
static MessageHeader.TransactionMode |
TRANSACTION_MOST
In this transaction mode, the operations are executed even
if some of them failed.
|
static MessageHeader.TransactionMode |
TRANSACTION_TRY
In this transaction model, no operation is executed, they
are only tried.
|
| Constructor and Description |
|---|
MessageHeader() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(String cData)
Adds character data to the content element.
|
void |
addChild(String tagName,
XMLMarshallable child)
Adds a child to the objects, the
child represents
the marshallable object to be added into the content tree. |
MessageOriginator |
getOriginator()
Returns the originator of this header.
|
MessageHeader.TransactionMode |
getTransactionMode()
Returns the processing mode of the operation requests included in the message body.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, and of its
children.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the tag being
processed.
|
void |
setOriginator(MessageOriginator o)
Sets the originator (your client application) for this message.
|
void |
setTransactionMode(MessageHeader.TransactionMode mode)
Sets the processing mode of the operation requests included in the message body;
The connected SAP CC system receives the message and manages the requests depending on
this execution mode.
|
String |
toString() |
public static final MessageHeader.TransactionMode TRANSACTION_ALL
public static final MessageHeader.TransactionMode TRANSACTION_FIRST_FAIL
public static final MessageHeader.TransactionMode TRANSACTION_MOST
public static final MessageHeader.TransactionMode TRANSACTION_TRY
public MessageHeader.TransactionMode getTransactionMode()
public void setTransactionMode(MessageHeader.TransactionMode mode)
The available operation processing modes are:
all, that means that all
the operations should be executed, or none if one
of them fails,firstFail, that means that
the operations are executed until one of them fails,most, that means that
all the operations that can be done should be done,try, that means that all the operations
are not done, but only attempted.mode - The execution mode for the operation requestsMessageHeader.TransactionModepublic MessageOriginator getOriginator()
public void setOriginator(MessageOriginator o)
o - The originator of this messagepublic void setAttributes(XMLAttributes atts)
setAttributes in interface XMLMarshallableatts - The XML attributes of the current tagpublic void addChild(String tagName, XMLMarshallable child)
child represents
the marshallable object to be added into the content tree.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic void addCharacterData(String cData)
addCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void marshal(XMLOutputter output)
marshal in interface XMLMarshallableoutput - The XML output to marshal the object into