Reusing an unchanged SOAP response header
- Last Updated: July 19, 2021
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
This example shows how you might handle a SOAP header that you first encounter in the response message returned from the Web service, then use unchanged as the SOAP header for the next request. This is an example of the header returned from the Web service:
SOAP response header to be reused
|
It contains one header entry, AuthHeader, that contains a value used as an access key (AccessID). This type of header might be used when the
Web service and client maintain a consistent context for each other between
requests.
This is the mainline of a procedure that invokes the Web service to reuse the response header:
Invoking a request that reuses an unchanged SOAP response header
|
|
The code in the preceding example:
- Defines several mainline variables, including a global handle to
reference the reused SOAP header (
g_header). - Registers the request header (
ReqHandler) and response header (RespHandler) handlers after connecting to the Web service and instantiating theHeaderSoapport type procedure object. - Runs the
OpenAccessprocedure to invoke the Web service operation that returns theAccessIDvalue in the SOAP response header (see Response header handler for returning a header for reuse). - Runs the
HelloWorldprocedure to invoke the next Web service operation, passing back the SOAP response header to the Web service unchanged as the SOAP request header (see Request header handler for reusing a header). - Cleans up the global objects maintained in its context and
disconnects from the Web service. Note that one of the objects it deletes is the
original SOAP response header saved by the response header handler during
execution of the
OpenAccessprocedure.