NonStop SOAP User's Manual

NonStop SOAP User-Exits
NonStop SOAP User’s Manual520501-012
C-39
3. SoapUEHandler_impl.cpp
3. SoapUEHandler_impl.cpp
#include "SoapUEHandler_impl.h"
#include <stdio.h>
#include "ErrorTrace.h"
#include "errno.h"
#include "atmi.h" /* TUXEDO Header File */
// Getting the TUXEDO service name and store it in the serviceName data
member of the SOAP User-exit object.
long SoapPW_UEHandler_TOUPPER::pre_process(ServiceEnv *env, SoapFault *sf)
{
strcpy(serviceName, env->getServiceName());
env->skipService(); // Set to skip the service method call
return 0;
}
// Call the Remote service and update the Request and response buffer.
long SoapPW_UEHandler_TOUPPER::pre_service(ServiceReqResponse *req,
SoapFault *sf)
{
gSoapTrace.log("Entered SoapPW_UEHandler_TOUPPER::pre_service\n");
gSoapTrace.log("DDL Buf Len: %ld\n", req->getDDLBufferLen());
char *sendbuf; // Request buffer
char *rcvbuf; // Response buffer
long sendlen, rcvlen;
sendlen=req->getDDLBufferLen();
int ret;
// Set the NSTuxedo environment variables
tuxputenv(“TUXCONFIG=/usr/mytux/tuxconfig”);
tuxputenv=(“TUXDIR=/tuxedo8.0”);
// tpalloc is TUXEDO memory allocation call, used to initialize the request
buffer with NULL
if((sendbuf = (char *) tpalloc("STRING", NULL, sendlen+1)) == NULL)
{