Modifying a reused SOAP response header
- Last Updated: March 30, 2020
- 2 minute read
- OpenEdge
- Version 12.2
- 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 modify it as the SOAP header for the next request. The response header and its handler are identical to what is used in the header reuse example (see Reusing an unchanged SOAP response header). This is an example of the header returned from the Web service after a password is added:
SOAP request header built from a modified SOAP response header
|
Note that the client adds the <Password> element as a sibling to the
<AccessID> element in the existing AuthHeader
header entry. Another approach is to create and add a new Password header
entry as a sibling to the AuthHeader header entry itself. Again, the actual
approach depends on the Web service itself, in this case the HeaderExample
Web service. This type of header modification might be used when the Web service and client
maintain a consistent context for each other between requests and the operation involved
requires authorization or authentication or some other additional context information.
The following code is the mainline of a procedure that invokes the Web service to reuse the initial SOAP response header by adding a password node to it before passing it back as a SOAP request header: