z/TPF HTTP server - asynchronous SOAP message flow

The following procedure details z/TPF HTTP server asynchronous SOAP message flow:
  1. 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);
  2. 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.
  3. 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.
  4. CSOH builds the input request soapMsg structure based on the input SOAP request message and initializes the output soapMsg structure.
  5. CSOH uses tpf_soap_handler_ext to call the SOAP handler, passing the input and output instances of the soapMsg and commsBindingExt structures.
  6. tpf_soap_handler_ext processes the asynchronous SOAP request similar to synchronous requests. See steps 3-12 in SOAP message flow example 4.
  7. tpf_soap_handler_ext calls the Web service wrapper program.
  8. 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.
  9. 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.
  10. The wrapper program must save the context token in system heap prior to asynchronously invoking the Web service.
  11. The wrapper program calls the Web Service application asynchronously and exits.
  12. In a new ECB, the wrapper responder program is invoked when the asynchronous response is received.
  13. The wrapper responder retrieves the context token from system heap.
  14. The wrapper responder calls tpf_soapRetrieveCtx with the context token to retrieve the SOAP message context information.
  15. 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.
  16. 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.
  17. The wrapper responder calls tpf_soapSendResponse with the SOAP message context (which contains the response message), and a pointer to the status response code.
  18. tpf_soapSendResponse processes the asynchronous SOAP response. See steps 19-22 in SOAP message flow example 4.
  19. 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.
  20. CSOX is passed the output soapMSG structure, the commsBindingExt structure, and a pointer to the soap response status code.
  21. CSOX calls tpf_httpSendResponse with the original connection token and the response data (the tpf_httpsvr_resp structure).
  22. CSOX sets the final status response code and returns to the response handler.
  23. The z/TPF HTTP server sends the output message to the remote client and releases the output message storage.
  24. The response handler releases the input message and all memory allocations (storage) of the B2B XML scanner and the infoNodes structure.
  25. The response handler returns to tpf_soapSendResponse, which returns to the wrapper responder.
  26. The wrapper responder is returned the final status code that can be interrogated.
  27. 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.
Alternate text