NonStop SOAP 4.1 User's Manual
The following code sample shows the implementation of business logic for the pre_marshal()
Message Receiver User Function:
1 long
2 SoapUEHandler_Generic::pre_marshal(ServiceReqResponse *resp,
3 SoapFault *sf)
4 {
5 if (!strcmp(serviceName, "EmpAdd")) {
6 getServiceEnv()->skipMarshal();
7 }
8
9 return 0;
10 }
Checks if the service name is EmpAdd.Line 5
Sets the skipMarshal flag.Line 6
NOTE: When migrating user-exits from NonStop SOAP 3 to NonStop SOAP 4 Message Receiver
User Functions, take the following into consideration:
• NonStop SOAP 3 user-exit codes are written using C++ classes but modules and handlers in
NonStop SOAP 4 must be implemented using the C programming language.
• NonStop SOAP 3 works through environment variables. NonStop SOAP 4 works on AXIOM
nodes and configuration context structures. Therefore, you must derive the service name from
these structures.
Migration of pre_service() and pre_marshal() user-exits in NonStop SOAP 4.1
The pre_service()and pre_marshal()user-exits in NonStop SOAP 3 must be migrated to
an equivalent Message Receiver User Function in NonStop SOAP 4.1.
Developing the empdb_MRUF sample for NonStop SOAP involves the following tasks:
1. Running the SoapAdminCL tool to generate the empdb_MRUF stub files (page 72)
2. Migrating the business logic for the pre_service() user-exit (page 73)
3. Compiling the Message Receiver user Functions (page 75)
4. Deploying the Message Receiver user Functions (page 75)
5. Running the NonStop SOAP 4 empdb sample with empdb_MRUF (page 75)
Running the SoapAdminCL tool to generate the empdb_MRUF stub files
The first step is to generate the empdb_MRUF stub files using the SoapAdminCL tool. You must
have the empdb service deployed in NonStop SOAP. For more information about deploying the
empdb service, see Chapter 2: “Installing NonStop SOAP” (page 36).
• The empdb service is located in:
<NonStop SOAP 4.1 Deployment Directory>/services/empdb/
• The SDL file for the empdb service is located in:
<NonStop SOAP 4.1 Deployment Directory>/services/empdb/src/empsdl.xml
To generate the empdb_MRUF stub files, complete the following steps:
72 Migrating NonStop SOAP 3 Services to NonStop SOAP 4 or Higher Versions










