3.1.4.1 BUILD_COORDINATION_CONTEXT
The BUILD_COORDINATION_CONTEXT event MUST be signaled by the higher-layer business logic with the following required arguments:
A transaction identifier which contains a GUID
A transaction object that contains the following data fields, as specified in [MS-DTCO] (section 2.2.8.1.1.2):
The isoLevel field
The dwTimeout field
The szDesc field
The isoFlags field
The transaction coordinator's Registration Service URI
If the BUILD_COORDINATION_CONTEXT event is signaled, the AppClient Role MUST perform the following actions:
If both the transaction object and the Registration Service URI arguments are provided:
Create a CoordinationContextAnyElementType Complex Type (section 2.2.3.1.8) containing the following elements:
If the isoLevel field value is not ISOLATIONLEVEL_UNSPECIFIED (0xFFFFFFFF), create an IsolationLevel element, as specified in section 2.2.3.1.8, setting the value to the corresponding IsolationLevel (section 2.2.2.1.2) value.
If the isoFlags field value is not ISOFLAG_RETAIN_DEFAULT (0x00000000, as specified in [MS-DTCO] section 2.2.6.8), create an CoordinationContextAnyElementType Complex Type (section 2.2.3.1.8) element, setting the value to the isoFlags value.
If the szDesc field is not an empty string, create a CoordinationContextAnyElementType Complex Type (section 2.2.3.1.8) element, setting the value to the szDesc value.
If the transaction identifier is not the NULL GUID, create a LocalTransactionId Element (section 2.2.3.1.5), setting the value to a string representation of the transaction identifier.
Create a WS-Addressing Address element, as specified in [WSADDR], setting the value to the Registration Service URI argument.
Create a LocalTransactionId Element (section 2.2.3.1.5) setting the value to a string representation of the transaction identifier.
Create a RegisterInfo Element (section 2.2.3.1.6) containing the previously created LocalTransactionId Element.
Create a WS-Addressing ReferenceParameters element, as specified in [WSADDR], containing the previously created RegisterInfo Element.
Create a WS-Coordination RegistrationService element, as specified in [WSC10] and [WSC11], containing the following ordered elements:
The previously created WS-Addressing Address element
The previously created WS-Addressing ReferenceParameters element
Create a WS-Coordination Identifier element, as specified in [WSC10] and [WSC11], setting the value to a string representation of the transaction identifier pre-pended with the string "urn:uuid:".
Create a WS-Coordination Expires element, as specified in [WSC10] and [WSC11], setting the value to the value of the dwTimeout field.
If the V1.1 flag in the SupportedProtocolsFlags field is set to 1, create a WS-Coordination CoordinationType element, as specified in [WSC11], setting the value as specified in [WSC11].
Otherwise if the V1.0 flag in the SupportedProtocolsFlags field is set to 1, create a WS-Coordination CoordinationType element, as specified in [WSC10], setting the value as specified in [WSC10].
Otherwise, return an implementation-specific failure result to the higher-layer business logic.
Create a WS-Coordination CoordinationContext element, as specified in [WSC10] and [WSC11], containing the following ordered elements:
The previously created WS-Coordination Identifier element
The previously created WS-Coordination Expires element
The previously created WS-Coordination CoordinationType element
The previously created WS-Coordination RegistrationService element
The CoordinationContextAnyElementType Complex Type created earlier
Return the WS-Coordination CoordinationContext element to the higher-layer business logic.
Otherwise, return an implementation-specific failure result to the higher-layer business logic.