NonStop SOAP User's Manual
NonStop SOAP User-Exits
NonStop SOAP User’s Manual—520501-012
C-27
SOA Enable a Nonstop Server Application With
User-Exits
Note: Do not call tpinit() or tpterm() from the user-exit as part of normal
processing. This will cause the TUXCONFIG file to be opened and closed for every
SOAP message that is processed, which is unnecessary and will adversely affect
performance.
Pre_Marshal()
long SoapUEHandler_TOUPPER::pre_marshal(ServiceReqResponse
*resp, SoapFault *sf)
// Set the response buffer in memory to hold the result.
// Validate the name of the service.
// Set the appropriate service name in the response buffer.
{
int err = resp->setRespDDLBuffer(respBuf, strlen(respBuf));
char *resServiceName = new char[sizeof(serviceName)+11];
memset(resServiceName,0,(sizeof(serviceName)+11));
err = resp->setResponseDDLDefinition("RESPONSE");
}
Here the NonStop Tuxedo TOUPPER Service Response buffer is transformed into the
expected SOAP Response structure according to the DDL response definition for the
service. In the call to setResponseDDLDefinition, the name of the DDL definition
for the response is used, as defined to NonStop SOAP in Figure C-7.
This user-exit may also be used to validate the response data or to perform any other
required processing (e.g., such as modifying the response).
Build the NonStop Server With User-Exits Executable
The first step in this process is to create an appropriate Makefile for the compilation of
the NonStop SOAP user-exit classes. In this example, the Makefile can be developed
using either of the following two approaches (remember that the NonStop SOAP server
in this scenario is performing two functions, one as a SOAP server and the other as a
NonStop Tuxedo client application, and so must be built accordingly):
•
Modify the Makefile automatically generated by NonStop SOAP
•
Modify the Makefile used to compile the NonStop Tuxedo application
In general, it is easier to modify the Makefile used to compile the NonStop Tuxedo
application, to add the required NonStop SOAP libraries, and so on. This is the
approach described in the following procedure:
1. Add the location of the required NonStop SOAP, XML, and ICU header files to the
INCLUDES section of the NonStop Tuxedo Makefile (generally by using the
INCDIR Makefile variable).