Try OpenEdge Now
skip to main content
Web Services
Creating ABL Clients to Consume OpenEdge SOAP Web Services : Handling SOAP Message Headers in ABL : SOAP message headers: an overview : Specifying SOAP header callback procedures at run time
Specifying SOAP header callback procedures at run time
For an AppServer, all information about remote requests is either passed with parameters or obtained using the attributes and methods of various handles related to the request. For a Web service, most information about Web service requests is passed with parameters, but some information is also contained within other elements of the SOAP message, such as the SOAP header. The SET-CALLBACK-PROCEDURE( ) method allows you to specify internal procedures that can access the content of the SOAP header element in a SOAP message as part of the invocation of a Web service operation that generates the message.
The SET-CALLBACK-PROCEDURE( ) method registers an internal procedure with a specified ABL callback, a designation that causes the internal procedure (callback procedure) to execute in response to some ABL core action, such as in this case, sending and receiving SOAP messages. For Web services, this method supports two types of ABL callbacks:
*"REQUEST-HEADER" — Identifies a SOAP request header callback procedure. This procedure executes just after you invoke a Web service operation and just before OpenEdge sends the SOAP request message to the Web service. It allows you to create or pass an existing SOAP header for use as the SOAP header of an out-going SOAP request message.
*"RESPONSE-HEADER" — Identifies a SOAP response header callback procedure. This procedure executes just after OpenEdge receives the message sent by the Web service in response to processing the Web service operation that you invoked, and just before it makes any output or return parameters available to the ABL calling context. It allows you to examine the SOAP header of an in-coming SOAP message.
Note: While this header callback procedure executes for either a normal SOAP response message or a SOAP fault message generated for the Web service request, a SOAP header is only available in a SOAP response that is not a SOAP fault.
A single Web service procedure object can support only one request header callback and one response header callback at one time. This means that for a single procedure object, you must use the same callbacks for all operations invoked on that procedure object. However, if you want greater flexibility to use different callbacks for the same set of operations, you can use the RUNportTypeName statement to create an additional Web service procedure object for the same port type. You can then invoke the SET-CALLBACK-PROCEDURE( ) method on the new procedure object to assign a different set of callback procedures for use by that same port type. By creating additional Web service procedure objects this way, you can then assign as many callback procedures for a single port type as you want.