The AddHeader component appends a series of XML tags to the value of working_data. This XML data consists of a transaction ID (a globally unique identifier (GUID) that uniquely identifies the transaction), the date and time on which the transaction occurred, and an optional return receipt request.
AddHeader adds the following information to the XML header.
AddHeader adds the date and time (Universal Coordinated Time) of the transmission using the <UTCDATETIME
></UTCDATETIME
> tags.
If the Transport Dictionary contains any of the name/value pairs listed in the following table, then AddHeader writes these values as XML into the header.
Name/value pair name | Description | Example value | XML added to header |
---|---|---|---|
Document_Type | Tag describing the type of business object being transmitted | PO | <DOCUMENTTYPE>PO |
Document_Source | Tag describing the source of the business object, usually the name of the company transmitting it. | Volcano Coffee | <DOCUMENTSOURCE>Volcano Coffee</DOCUMENTSOURCE> |
Document_Destination | Tag describing the destination of the business object, usually the name of the company receiving it. | Cascade Coffee Roasters | <DOCUMENTDESTINATION> |
AddHeader checks whether the Receipt_requeste
d name/value pair exists and has a value of Yes. If it does, AddHeader appends the following XML items to the data.
SHA1
. (SHA1 is a standard hash algorithm.)Receipt
, indicating that a receipt is requested.This information appears in the XML header as the following:
<RETURNREQUEST>
<DIGESTALGORITHM>
SHA1
</DIGESTALGORITHM>
<DOCUMENTTYPE>
Receipt
</DOCUMENTTYPE>
</RETURNREQUEST>
Finally, AddHeader adds a transaction ID to the header. The transaction ID for a transaction is a string of data that uniquely identifies the transaction. If the transport dictionary contains a name/value pair named txid
, then AddHeader writes this value. Otherwise, AddHeader generates a globally unique ID (GUID), and writes a string representation of that GUID to the txid
name/value pair. In either case, AddHeader appends the transaction ID to the XML header in the form <TRANSACTIONID>transactionid</TRANSACTIONID>
.
In this example, a transport dictionary has been created and given the following values, in addition to the business object in working_data
:
transportDictionary.Value("Receipt_Requested") = "Yes"
transportDictionary.Document_Type = "PO"
transportDictionary.Document_Source = "Volcano Coffee"
transportDictionary.Document_Destination = "Cascade Coffee Roasters"
In this example, no transaction ID is supplied initially, so that the ID is generated by the AddHeader component.
The AddHeader component produces the following XML:
<UTCDATETIME>4/27/98 1:42:28 PM</UTCDATETIME>
<DOCUMENTDESTINATION>Cascade Coffee Roasters</DOCUMENTDESTINATION>
<DOCUMENTSOURCE>Volcano Coffee</DOCUMENTSOURCE>
<DOCUMENTTYPE>PO</DOCUMENTTYPE>
<RETURNREQUEST>
<DIGESTALGORITHM>SHA1</DIGESTALRORITHM>
<DOCUMENTTYPE>Receipt</DOCUMENTTYPE>
</RETURNREQUEST>
<TRANSACTIONID>94htns70082p12noklmq3vhqu0</TRANSACTIONID>
<OBJECTDATA>
<MAPXML ( XML text written by MapToXML)
</MAPXML>
</OBJECTDATA>