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
Bodyportion of the SOAP response.
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, andErrorReplyNeeded, as defined in thetpf/c_soap.hheader file. - The only parameter is a pointer to a
tpfSoapMsgCtxstructure, which is defined in thetpf/c_soapctx.hheader file. - The
intfnpointer 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
XMLHandlestructure that represents the SOAP message and is calledrequestMsg. - An
XMLHandlestructure that represents the response message and is calledresponseMsg.
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.