NonStop SOAP User's Manual

Customizing the SOAP Server
NonStop SOAP User’s Manual520501-012
8-7
class SoapUEHandler
Protected Attributes
SoapUEHandler *forwardHandler_;
ServiceEnv *serviceEnv_;
};
A nonzero value returned in the methods indicates an error return. When this happens
the SOAP server skips remaining user-exit methods and returns a SOAP fault to the
client. A user-exit method can also modify the SOAP fault buffer pointered to by sf
using methods in the SoapFault class.
Example for setting a SoapFault:
sf->setFaultCode(“Client”);
sf->setFaultString(“Unmarshal Error”);
sf->setDetailCode(-501);
sf->setDetailString(“Element contains an invalid value”);
All four methods must be called to set a SOAP fault.
The methods of SoapUEHandler are invoked on these events.
pre_process(...)
Invoked before the XML parsing of the inputXml buffer. The service/method
name is known at this point.
Allows you to modify the input XML/SOAP document sent from the client.
You cannot modify the service/method name or SOAP header in the input
XML/SOAP document.
You can get or set the input XML/SOAP document using env->getInputXML
and env->setInputXML.
pre_service(...)
Invoked before the SOAP server sends a request to the back-end service.
Allows you to modify the request buffer using methods in the class
ServiceReqResponse.
pre_marshal(...)
Invoked after the SOAP server receives response from the back-end service and
before the SOAP server converts the response to an XML document.
Allows you to modify the response buffer using methods in the class
ServiceReqResponse.
pre_marshal_header(...)