Invoking a header handler
- Last Updated: July 19, 2021
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
The following procedure fragment shows how ABL might specify and invoke a header handler for the SOAP message described in the previous sections, in this case returned as a SOAP response message:
Invocation of a header handler
|
This fragment specifies the response header handler for an internal
procedure named TransactionResponseHandler that is
defined in the current external procedure context. Then, it invokes a startTransaction procedure as the first operation. As
the name and parameters imply, this operation begins a transaction on the order
(perhaps automatically retrieved or created, as necessary) with the specified order
number.
Assume the SOAP response message returned by this operation has a
header containing database object and transaction state information for the
transaction that was started. The example SOAP message, in SOAP header structure, contains just
such information, including an ID for the order (the <q1:OrderInfoID> element) and some values identifying the
transaction that is managing the order (the <t:Transaction> element).
The following internal procedure defines the TransactionResponseHandler callback procedure for the header handler.
In this case, the handler locates the <uuid>
element in the OrderInfoID header entry within the
SOAP header referenced by the SOAP header object handle parameter, hSOAPHeader. It then saves the uuid string value to an OUTPUT
parameter(gcUUID)defined globally in the
calling procedure context. This is all accomplished using methods and attributes of
the SOAP header object, SOAP header entry object, and x-noderef objects to access
the parsed XML DOM tree of the SOAP header:
Definition of a header handler procedure
|