<transactionControl>
This presence of this element indicates that the server associated with the parent <method> will participate in a NonStop TM/MP (TMF) transaction. The attributes of the element indicate which party, client or server, may control the transaction. If the server controls the transaction, this element specifies the conditions under which the transaction should be committed or aborted.
Attributes
Attribute | Data Type | Usage | Default Value | Description |
---|---|---|---|---|
clientControl | xsd:integer | required | none | Indicates that the client may control the transaction. Valid values are "0" (no) and "1" (yes). |
serverControl | xsd:integer | required | none | Indicates that SOAPam Server should control the transaction. Valid values are "0" (no) and "1" (yes). |
validReplyCodes | xsd:string | required | none | A list of reply codes used by SOAPam Server to determine whether to commit the transaction or abort it. The comma-separated list may contain one or more reply code values and/or ranges. A range is represented as 'lo:hi' where lo and hi are integers in the range -32768 to 32767. In lieu of a list, "*" may be used to represent 'any' reply code. Typically, the 'valid' reply codes represent the reply codes that the application considers as 'success' or 'warning'. validReplyCodes should not contain whitespace. See examples at txControlRequestType. |
txTimeout | xsd:int | optional | none | If greater than zero, the number of seconds that the transaction should be allowed to 'live' before it is automatically aborted. If omitted or the specified value is greater than the configured NonStop TM/MP AutoAbort attribute, the AutoAbort value is used. |
Remarks
If clientControl="1", a <header> or a <parameter> of type txControlRequestType must be defined for the request and of type txControlResponseType for the response in the parent <method> of this <transactionControl> element.
If serverControl="1" and clientControl="1", the client controls the transaction if and when it supplies a txControlRequestType header in its method call (SOAP request), otherwise SOAPam Server will control the transaction.
If serverControl="0" and clientControl="1", but the client does not supply a txControlRequestType header or parameter in its method call (SOAP request), no transaction control takes place.
If serverControl="0" and clientControl="0", then no transaction control takes place. This is effectively the same as the <transactionControl> element not being present.
When SOAPam Server controls the transaction, it begins a new transaction prior to sending the request interprocess message to the target server and ends the transaction when the target server replies. Thus, a server-controlled transaction consists of exactly one request-response. To span a single transaction over multiple method (SOAP request-response) calls, you must use client-controlled transactions.
See Managing Transactions and Client Transaction Control for more information.
Example
<method name="debitAccount" server="debitAccountServer">
<headers>
<!-- web service client will send a SOAP header at runtime containing transaction control elements -->
<header name="txRequest" type="txControlRequestType" namespace="http://soapam.com/types/" direction="in" />
<header name="txResponse" type="txControlResponseType" namespace="http://soapam.com/types/" direction="out" />
</headers>
<parameters>
<parameter name="requestMsg" type="ipm_debit_account_request" direction="in" />
<parameter name="replyMsg" type="ipm_debit_account_reply" direction="out" />
</parameters>
<!-- web service client will control the transaction -->
<transactionControl serverControl="0" clientControl="1" />
<request type="ipm_debit_account_request">
<mappings>
<mapping name="requestMsg" element="." />
</mappings>
</request>
<replies>
<reply type="ipm_debit_account_reply" replyCode="*">
<mappings>
<mapping name="replyMsg" element="." />
</mappings>
</reply>
</replies>
</method>