Create a Web service wrapper

Web service wrappers are intended to be an isolation point for the portion of code that does the following:

  • Deserializes the operation and parameter data from the parsed SOAP request.
  • Calls the application that implements the Web service.
  • Serializes the return from the application and builds the Body portion of the SOAP response.
This architecture allows the application to be deployed as a Web service while not requiring changes to handle request data in the SOAP format.
SOAP support uses the TPF_CALL_BY_NAME API to call the 4-character Web service wrapper program name that is specified in the provider Web service deployment descriptor for a Web service. Processing is implemented in C shared objects; CSOs must have a single entry point as defined in the makefile. The interface to the CSO must match the interface that is defined by the typedef that is used to define SOAP message handlers. The format of the typedef is:
typedef int (*intfn)(tpfSoapMsgCtx*); 
An explanation of the typedef follows:
  • Web service wrappers must return an integer; valid values include SendReply, SendErrorReplySender, SendErrorReplyReceiver, and ErrorReplyNeeded, as defined in the tpf/c_soap.h header file.
  • The only parameter is a pointer to a tpfSoapMsgCtx structure, which is defined in the tpf/c_soapctx.h header file.
  • The intfn pointer is a pointer to the function type and is passed to the TPF_CALL_BY_NAME macro. With this pointer and the 4-character program name that implements the Web service wrapper, the TPF_CALL_BY_NAME macro returns a pointer to function value that calls an enter with return linkage (ENTRC linkage) to the specified program.
The tpfSoapMsgCtx structure contains information about the Web service that is being processed, for example:
  • An XMLHandle structure that represents the SOAP message and is called requestMsg.
  • An XMLHandle structure that represents the response message and is called responseMsg.

You can use the z/TPF parser APIs to help in accessing the data in the SOAP request and in creating the SOAP response. TPF Toolkit provides tooling to help you create the Web service wrapper.