NonStop SOAP 4.1 User's Manual
The following code sample shows the business logic implemented in the
empdb_pre_service_function()in the empdb_MRUF.c file.
1 int empdb_pre_service_function(
2 axis2_MessageReceiverUserFunctions_t *MessageReceiverUserFunctions,
3 axis2_char_t * payload,
4 const axutil_env_t * env,
5 int ReqLen,
6 struct axis2_msg_ctx * in_msg_ctx,
7 struct axis2_msg_ctx * out_msg_ctx){
8
9 axis2_char_t* operation_name = NULL;
10
11 operation_name = axis2_msg_recv_get_operationName(MessageReceiverUserFunctions, env);
12 if(!axutil_strcmp(operation_name,"EmpAdd")){
13 if (payload)
14 {
15 if(payload[ReqLen-2] == '0' && payload[ReqLen-1] == '9'){
16 payload[ReqLen-1] = '0';
17 }
18 }
19 }
20 if(!axutil_strcmp(operation_name,"EmpDel")){
21 /* TODO :: Insert your business logic here */
22 }
23 if(!axutil_strcmp(operation_name,"EmpInfo")){
24 /* TODO :: Insert your business logic here */
25 }
26 return ReqLen;
27}
Gets the operation name.Line 11
Checks whether the operation name is EmpAdd.Line 12
Modifies the branchnum value.Line 15-16
NOTE: NonStop SOAP provides the complete implementation of the pre_service Message
Receiver User Function. Copy the source code of the pre_service Message Receiver User
Function from the NonStop SOAP installation location using the following command:
OSS> cp <NonStop SOAP 4 Installation Directory>/sample_services/modules/empdb_MRUF
/src/empdb_MRUF.c
<NonStop SOAP 4 Deployment Directory>/services/
empdb/MRUF_src/empdb_MRUF.c
The business logic for the pre_marshal handler is also implemented in the
empdb_pre_marshal_function( ) method in the empdb_MRUF.c file. The following code
sample shows the business logic for the pre_marshal( ) method:
1int empdb_pre_marshal_function(
2 axis2_MessageReceiverUserFunctions_t *MessageReceiverUserFunctions,
3 axis2_char_t * payload,
4 const axutil_env_t * env,
5 int ResLen,
7 struct axis2_msg_ctx * in_msg_ctx,
8 struct axis2_msg_ctx * out_msg_ctx)
9{
10
11 axis2_char_t* operation_name = NULL;
12 operation_name = axis2_msg_recv_get_operationName(MessageReceiverUserFunctions, env);
13
14 if(!axutil_strcmp(operation_name,"EmpInfo")){
15 /* TODO :: Insert your business logic here */
16 }
17 if(!axutil_strcmp(operation_name,"EmpDel")){
18 /* TODO :: Insert your business logic here */
19 }
20 if(!axutil_strcmp(operation_name,"EmpAdd")){
21 axis2_msg_recv_set_skipMarshal(MessageReceiverUserFunctions, env, AXIS2_TRUE);
22 }
23
24 return ResLen;
74 Migrating NonStop SOAP 3 Services to NonStop SOAP 4 or Higher Versions










