3.1.7.2.4 Message Serialization
A new SRMPMessage to be sent by the QM MUST be serialized in the following way:
A string buffer large enough to hold the new outgoing message MUST be instantiated.
The structure of the new protocol message MUST be encoded in XML ([XML1.0]), as defined for [SOAP1.1] messages in section 2.2.
The contents of the <se:Envelope> element MUST be assembled as follows:
The string <se:Envelope xmlns:se="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://schemas.xmlsoap.org/srmp/"> MUST be appended to the string buffer.
The contents of the <se:Header> element MUST be assembled as follows:
The string <se:Header> MUST be appended to the string buffer.
The contents of the <rp:path> element MUST be assembled as follows:
The string <path xmlns="http://schemas.xmlsoap.org/rp/" se:mustUnderstand="1"> MUST be appended to the string buffer.
The contents of the <action> element MUST be assembled as follows:
The string <action> MUST be appended to the string buffer.
If the SRMPMessage.Label attribute has a non-NULL value, the string "MSMQ:" MUST be appended to the string buffer and be followed by the string that is contained in the attribute.
The string </action> MUST be appended to the string buffer.
The contents of the <to> element MUST be assembled as follows:
The string <to> MUST be appended to the string buffer.
The string contained in the SRMPMessage.DestinationQueueFormatName attribute MUST be appended to the string buffer.
The string </to> MUST be appended to the string buffer.
The contents of the <id> element MUST be assembled as follows:
The string <id> MUST be appended to the string buffer.
The string "uuid:" MUST be appended to the string buffer.
The contents of the SRMPMessage.Identifier.Uniquifier attribute MUST be converted to a string and appended to the string buffer.
The string "@" MUST be appended to the string buffer.
The contents of the SRMPMessage.Identifier.Lineage attribute MUST be converted to a string and appended to the string buffer.
The string </id> MUST be appended to the string buffer.
If the SRMPMessage.ResponseQueueFormatName attribute has a non-NULL value, the contents of the <rev> element MUST be assembled as follows:
The string <rev> MUST be appended to the string buffer.
The string <via> MUST be appended to the string buffer.
The string contained in the SRMPMessage.ResponseQueueFormatName attribute MUST be appended to the string buffer.
The string </via> MUST be appended to the string buffer.
The string </rev> MUST be appended to the string buffer.
The string </path> MUST be appended to the string buffer.
The contents of the <properties> element MUST be assembled as follows:
The string <properties se:mustUnderstand="1"> MUST be appended to the string buffer.
The contents of the <expiresAt> element MUST be assembled as follows:
The string <expiresAt> MUST be appended to the string buffer.
The UTC date/time calculated by adding the time span value contained in the SRMPMessage.TimeToReachQueue attribute to the UTC date/time value contained in the SRMPMessage.SentTime attribute MUST be appended to the string buffer.
The string </expiresAt> MUST be appended to the string buffer.
The contents of the <sentAt> element MUST be assembled as follows:
The string <sentAt> MUST be appended to the string buffer.
The UTC date/time string contained in the SRMPMessage.SentTime attribute MUST be appended to the string buffer.
The string </sentAt> MUST be appended to the string buffer.
The string </properties> MUST be appended to the string buffer.
If the SRMPMessage.DeliveryGuarantee attribute is set to Recoverable, or if the SRMPMessage.AcknowledgementsRequested attribute includes the value AckPosArrival, or if the SRMPMessage.FinalAckRequired attribute is set to True, the contents of the <services> element MUST be assembled as follows:
The string <services se:mustUnderstand="1"> MUST be appended to the string buffer.
If the SRMPMessage.DeliveryGuarantee attribute is set to Recoverable, the string <durable/> MUST be appended to the string buffer.
If the SRMPMessage.AcknowledgementsRequested attribute includes the value AckPosArrival, the contents of the <deliveryReceiptRequest> element MUST be assembled as follows:
The string <deliveryReceiptRequest> MUST be appended to the string buffer.
The string <sendTo> MUST be appended to the string buffer.
The string contained in the SRMPMessage.AdministationQueueFormatName attribute MUST be appended to the string buffer.
The string </sendTo> MUST be appended to the string buffer.
The string </deliveryReceiptRequest> MUST be appended to the string buffer.
If the SRMPMessage.FinalAckRequired attribute is set to True, the contents of the <commitmentReceiptRequest> element MUST be assembled as follows:
The string <commitmentReceiptRequest> MUST be appended to the string buffer.
The string <sendTo> MUST be appended to the string buffer.
The string contained in the SRMPMessage.AdministationQueueFormatName attribute MUST be appended to the string buffer.
The string </sendTo> MUST be appended to the string buffer.
If the SRMPMessage.AcknowledgementsRequested attribute includes the value AckPosReceive, the string <positiveOnly/> MUST be appended to the string buffer.
If the SRMPMessage.AcknowledgementsRequested attribute includes the value AckNegReceive, the string <negativeOnly/> MUST be appended to the string buffer.
The string </commitmentReceiptRequest> MUST be appended to the string buffer.
The string </services> MUST be appended to the string buffer.
If the SRMPMessage.TransactionalMessageSequenceIdentifier attribute has a nonzero value, the contents of the <stream> element MUST be assembled as follows:
The string <stream se:mustUnderstand="1"> MUST be appended to the string buffer.
The contents of the <streamId> element MUST be assembled as follows:
The string <streamId> MUST be appended to the string buffer.
The string "uid:" MUST be appended to the string buffer.
The contents of the QueueManager.Identifier attribute MUST be converted to string and appended to the string buffer.
The string "\" MUST be appended to the string buffer.
The contents of the SRMPMessage.TransactionalMessageSequenceIdentifier attribute MUST be converted to string and appended to the string buffer.
The string </streamId> MUST be appended to the string buffer.
The contents of the <current> element MUST be assembled as follows:
The string <current> MUST be appended to the string buffer.
The contents of the SRMPMessage.TransactionSequenceNumber attribute MUST be converted to string and appended to the string buffer.
The string </current> MUST be appended to the string buffer.
If the SRMPMessage.TransactionPreviousSequenceNumber attribute has a nonzero value, the contents of the <previous> element MUST be assembled as follows:
The string <previous> MUST be appended to the string buffer.
The contents of the SRMPMessage.TransactionPreviousSequenceNumber attribute MUST be converted to a string and appended to the string buffer.
The string </previous> MUST be appended to the string buffer.
If the SRMPMessage.TransactionSequenceNumber attribute is set to 1, the contents of the <start> element MUST be assembled as follows:
The string <start> MUST be appended to the string buffer.
The string <sendReceiptsTo> MUST be appended to the string buffer.
Let ReceiptsURL be a URL that is formed by concatenating the following elements:
"http://" if SRMPMessage.DestinationQueueFormatName begins with "DIRECT=http:" or "https://" if SRMPMessage.DestinationQueueFormatName begins with "DIRECT=https:"
QueueManager.ComputerName
the string "MSMQ/PRIVATE$/order_queue$"
The value of SRMPMessage.DestinationQueueFormatName with the leading "DIRECT=" removed MUST be checked against the URLs in the From attributes of the <Redirection> elements in the StreamReceiptURLReplacementCollection (section 3.1.1.1.10.3). If a match is found, ReceiptsURL MUST be set to the value of the To attribute of the <Redirection> element that had the matching From attribute. If no match is found and DefaultStreamReceiptURLReplacement is not empty, ReceiptsURL MUST be set to the value of DefaultStreamReceiptURLReplacement.
The string value of ReceiptsURL MUST be appended to the string buffer.
The string </sendReceiptsTo> MUST be appended to the string buffer.
The string </start> MUST be appended to the string buffer.
The string </stream> MUST be appended to the string buffer.
The contents of the <Msmq> element MUST be assembled as follows:
The string <Msmq xmlns="msmq.namespace.xml"> MUST be appended to the string buffer.
The contents of the <Class> element MUST be assembled as follows:
The string <Class> MUST be appended to the string buffer.
The contents of the SRMPMessage.Class attribute MUST be converted to a string and appended to the string buffer.
The string </Class> MUST be appended to the string buffer.
The contents of the <Priority> element MUST be assembled as follows:
The string <Priority> MUST be appended to the string buffer.
The contents of the SRMPMessage.Priority attribute MUST be converted to a string and appended to the string buffer.
The string </Priority> MUST be appended to the string buffer.
If the SRMPMessage.PositiveJournalingRequested attribute is set to True, the string <Journal > MUST be appended to the string buffer.
If the SRMPMessage.NegativeJournalingRequested attribute is set to True, the string <DeadLetter > MUST be appended to the string buffer.
If the SRMPMessage.CorrelationIdentifier attribute has a non-NULL value, the contents of the <Correlation> element MUST be assembled as follows:
The string <Correlation> MUST be appended to the string buffer.
The contents of the SRMPMessage.CorrelationIdentifier attribute MUST be converted to a string and appended to the string buffer.
The string </Correlation> MUST be appended to the string buffer.
If the SRMPMessage.TracingRequested attribute is set to True, the string <Trace/> MUST be appended to the string buffer.
If the SRMPMessage.ConnectorTypeIdentifier attribute has a non-NULL value, the contents of the <ConnectorType> element MUST be assembled as follows:
The string <ConnectorType> MUST be appended to the string buffer.
The contents of the SRMPMessage.ConnectorTypeIdentifier attribute MUST be converted to a string and appended to the string buffer.
The string </ConnectorType> MUST be appended to the string buffer.
If the SRMPMessage.ApplicationTag attribute has a nonzero value, the contents of the <App> element MUST be assembled as follows:
The string <App> MUST be appended to the string buffer.
The contents of the SRMPMessage.ApplicationTag attribute MUST be converted to a string and appended to the string buffer.
The string </App> MUST be appended to the string buffer.
The contents of the <BodyType> element MUST be assembled as follows:
The string <BodyType> MUST be appended to the string buffer.
The contents of the SRMPMessage.BodyType attribute MUST be converted to a string and appended to the string buffer.
The string </BodyType> MUST be appended to the string buffer.
If the SRMPMessage.HashAlgorithm attribute has a nonzero value, the contents of the <HashAlgorithm> element MUST be assembled as follows:
The string <HashAlgorithm> MUST be appended to the string buffer.
The contents of the SRMPMessage.HashAlgorithm attribute MUST be converted to a string and appended to the string buffer.
The string </HashAlgorithm> MUST be appended to the string buffer.
If the SRMPMessage.FirstInTransaction attribute is set to True, or if the SRMPMessage.LastInTransaction attribute is set to True, or if the SRMPMessage.ConnectorQueueManagerIdentifier attribute has a non-NULL value, the contents of the <Eod> element MUST be assembled as follows:
The string <Eod> MUST be appended to the string buffer.
If the SRMPMessage.FirstInTransaction attribute is set to True, the string <First/> MUST be appended to the string buffer.
If the SRMPMessage.LastInTransaction attribute is set to True, the string <Last/> MUST be appended to the string buffer.
If the SRMPMessage.ConnectorQueueManagerIdentifier attribute has a non-NULL value, the <ConnectorId> element MUST be assembled as follows:
The string <ConnectorId> MUST be appended to the string buffer.
The contents of the SRMPMessage.ConnectorQueueManagerIdentifier attribute MUST be converted to a string and appended to the string buffer.
The string </ConnectorId> MUST be appended to the string buffer.
The string </Eod> MUST be appended to the string buffer.
If the SRMPMessage.AuthenticationProviderType attribute has a nonzero value, or if the SRMPMessage.AuthenticationProviderName attribute has a non-NULL value, the contents of the <Provider> element MUST be assembled as follows:
The string <Provider> MUST be appended to the string buffer.
If the SRMPMessage.AuthenticationProviderType attribute has a nonzero value, the contents of the <Type> element MUST be assembled as follows:
The string <Type> MUST be appended to the string buffer.
The contents of the SRMPMessage.AuthenticationProviderType attribute MUST be converted to a string and appended to the string buffer.
The string </Type> MUST be appended to the string buffer.
If the SRMPMessage.AuthenticationProviderName attribute has a non-NULL value, the contents of the <Name> element MUST be assembled as follows:
The string <Name> MUST be appended to the string buffer.
The contents of the SRMPMessage.AuthenticationProviderName attribute MUST be appended to the string buffer.
The string </Name> MUST be appended to the string buffer.
The string </Provider> MUST be appended to the string buffer.
The contents of the <SourceQmGuid> element MUST be assembled as follows:
The string <SourceQmGuid> MUST be appended to the string buffer.
The contents of the SRMPMessage.SourceMachineIdentifier attribute MUST be converted to a string and appended to the string buffer.
The string </SourceQmGuid> MUST be appended to the string buffer.
If the SRMPMessage.DestinationMultiQueueFormatName attribute has a non-NULL value, the contents of the <DestinationMqf> element MUST be assembled as follows:
The string <DestinationMqf> MUST be appended to the string buffer.
For each member element of the string collection contained in SRMPMessage.DestinationMultiQueueFormatName, the string contained in the member element MUST be appended to the string buffer, followed by a white-space character (for example, blank or line feed).
The string </DestinationMqf> MUST be appended to the string buffer.
If the SRMPMessage.AdministrationMultiQueueFormatName attribute has a non-NULL value, the contents of the <AdminMqf> element MUST be assembled as follows:
The string <AdminMqf> MUST be appended to the string buffer.
For each member element of the string collection contained in SRMPMessage.AdministrationMultiQueueFormatName, the string contained in the member element MUST be appended to the string buffer, followed by a white-space character (for example, blank or line feed).
The string </AdminMqf> MUST be appended to the string buffer.
If the SRMPMessage.ResponseMultiQueueFormatName attribute has a non-NULL value, the contents of the <ResponseMqf> element MUST be assembled as follows:
The string <ResponseMqf> MUST be appended to the string buffer.
For each member element of the string collection contained in SRMPMessage.ResponseMultiQueueFormatName, the string contained in the member element MUST be appended to the string buffer, followed by a white-space character (for example, blank or line feed).
The string </ResponseMqf> MUST be appended to the string buffer.
The contents of the <TTrq> element MUST be assembled as follows:
The string <TTrq> MUST be appended to the string buffer.
The UTC date/time string calculated by adding the time span value contained in the SRMPMessage.TimeToReachQueue attribute to the UTC date/time value contained in the SRMPMessage.SentTime attribute MUST be appended to the string buffer.
The string </TTrq> MUST be appended to the string buffer.
The string </Msmq> MUST be appended to the string buffer.
If Message.AuthenticationLevel ([MS-MQDMPR] section 3.1.1.12) equals XmlSig, the following actions MUST be taken.
The string <Signature xmlns="http://www.w3.org/2000/02/xmldsig#"> MUST be appended to the string buffer.
The string <SignedInfo> MUST be appended to the string buffer.
The string <SignatureMethod Algorithm="http://www.w3.org/2000/02/xmldsig#dsa"></SignatureMethod> MUST be appended to the string buffer.
If the message contains a <Body> element, the protocol MUST perform the following actions:
The string <Reference URI="cid:body@" MUST be appended to the string buffer, followed by a string that represents the GUID QueueManager.Identifier ([MS-MQDMPR] section 3.1.1.12), followed by the string ">.
If Message.HashAlgorithm ([MS-MQDMPR] section 3.1.1.12) equals MD5, the protocol MUST perform the following steps:<29>
The string <DigestMethod Algorithm="http://www.w3.org/2000/02/xmldsig#md5"></DigestMethod> MUST be appended to the string buffer.
The string <DigestValue> MUST be appended to the string buffer.
The MD5 algorithm (see [RFC1321]) MUST be used to calculate a 128-bit digest of the <Body> element of this message. The 128-bit digest MUST be base64-encoded into a 24-octet octet stream that MUST be appended to the string buffer.
If Message.HashAlgorithm equals SHA1, the protocol MUST perform the following steps:
The string <DigestMethod Algorithm="http://www.w3.org/2000/02/xmldsig#sha1"></DigestMethod> MUST be appended to the string buffer.
The string <DigestValue> MUST be appended to the string buffer.
The SHA1 algorithm (see [RFC3174]) MUST be used to calculate a 160-bit digest of the <Body> element of this message. The 160-bit digest MUST be base64-encoded into a 28-octet octet stream that MUST be appended to the string buffer.
The strings </DigestValue> and </Reference > MUST be appended to the string buffer.
If the message contains an <Extension> element, the protocol MUST perform the following actions:
The string <Reference URI="cid:extension@ MUST be appended to the string buffer, followed by a string that represents the GUID QueueManager.Identifier ([MS-MQDMPR] section 3.1.1.12), followed by the string ">.
If Message.HashAlgorithm equals MD5, the protocol MUST perform the following steps:
The string <DigestMethod Algorithm="http://www.w3.org/2000/02/xmldsig#md5"></DigestMethod> MUST be appended to the string buffer.
The string <DigestValue> MUST be appended to the string buffer.
The MD5 algorithm (see [RFC1321]) MUST be used to calculate a 128-bit digest of the <Extension> element of this message. The 128-bit digest MUST be base64-encoded into a 24-character stream that MUST be appended to the string buffer.
If Message.HashAlgorithm equals SHA1, the protocol MUST perform the following steps:
The string <DigestMethod Algorithm="http://www.w3.org/2000/02/xmldsig#sha1"></DigestMethod> MUST be appended to the string buffer.
The string <DigestValue> MUST be appended to the string buffer.
The SHA1 algorithm [RFC3174]) MUST be used to calculate a 160-bit digest of the <Extension> element of this message. The 160-bit digest MUST be base64-encoded into a 28-character stream that MUST be appended to the string buffer.
The strings </DigestValue> and </Reference > MUST be appended to the string buffer.
The strings</SignedInfo> and <SignatureValue> MUST be appended to the string buffer.
Using the sender's private key, the DSA [FIPS186] algorithm MUST be used to calculate a signature of the <SignedInfo> element that was constructed previously. The 512-bit signature MUST be base64-encoded into an 88-character stream that MUST be appended to the string buffer.
The strings </SignatureValue> and </Signature> MUST be appended to the string buffer.
The string </se:Header> MUST be appended to the string buffer.
The string <se:Body></se:Body> MUST be appended to the string buffer.
The string </se:Envelope> MUST be appended to the string buffer.