z/TPF HTTP server - asynchronous SOAP message flow
The following procedure details z/TPF HTTP server asynchronous
SOAP message flow:
- A SOAP message is sent by a client and received by the z/TPF HTTP
server. Using the request URL, the server identifies and invokes communications
request binding program CSOH to process the request.
void CSOH (tpf_httpsvr_req*, tpf_httpsvr_token); - CSOH determines the character set in which the SOAP request message is encoded by doing a lookup in a table defined in tpf/u_soap.h. You can update this table.
- CSOH builds the commsBindingExt structure and indicates that the communications binding type is z/TPF HTTP. The commsBindingExt structure includes the HTTP connection token and identifies CSOX as the communications response binding program to invoke for the SOAP response message.
- CSOH builds the input request soapMsg structure based on the input SOAP request message and initializes the output soapMsg structure.
- CSOH uses tpf_soap_handler_ext to call the SOAP handler, passing the input and output instances of the soapMsg and commsBindingExt structures.
- tpf_soap_handler_ext processes the asynchronous SOAP request similar to synchronous requests. See steps 3-12 in SOAP message flow example 4.
- tpf_soap_handler_ext calls the Web service wrapper program.
- The Web service wrapper program uses the z/TPF parser APIs with the API handle from the soapMsgCtx structure to extract information from the SOAP input message.
- The Web service wrapper program calls tpf_soapSaveCtx to save the SOAP context information for the current SOAP asynchronous request being processed. tpf_soapSaveCtx saves the information in system heap storage and returns a context token to the wrapper program.
- The wrapper program must save the context token in system heap prior to asynchronously invoking the Web service.
- The wrapper program calls the Web Service application asynchronously and exits.
- In a new ECB, the wrapper responder program is invoked when the asynchronous response is received.
- The wrapper responder retrieves the context token from system heap.
- The wrapper responder calls tpf_soapRetrieveCtx with the context token to retrieve the SOAP message context information.
- The wrapper responder initializes a new parser API handle that is used to construct the SOAP output message and saves it in the soapMsgCtx structure.
- The wrapper program uses the z/TPF parser APIs with the response data to build the SOAP output message. It sets the appropriate status response code based on the defined values in c_soap.h.
- The wrapper responder calls tpf_soapSendResponse with the SOAP message context (which contains the response message), and a pointer to the status response code.
- tpf_soapSendResponse processes the asynchronous SOAP response. See steps 19-22 in SOAP message flow example 4.
- When the response message is ready, the response handler invokes the asynchronous response program from the communications binding information (CSOX) using TPF_CALL_BY_NAME.
- CSOX is passed the output soapMSG structure, the commsBindingExt structure, and a pointer to the soap response status code.
- CSOX calls tpf_httpSendResponse with the original connection token and the response data (the tpf_httpsvr_resp structure).
- CSOX sets the final status response code and returns to the response handler.
- The z/TPF HTTP server sends the output message to the remote client and releases the output message storage.
- The response handler releases the input message and all memory allocations (storage) of the B2B XML scanner and the infoNodes structure.
- The response handler returns to tpf_soapSendResponse, which returns to the wrapper responder.
- The wrapper responder is returned the final status code that can be interrogated.
- The wrapper responder exits.
The following figure displays the processing flow of asynchronous
SOAP requests and responses through the z/TPF HTTP server. The HTTP
request and response are received from the client and returned to
the client through different ECBs.
