NonStop SOAP 4.1 User's Manual

2. Implement the business logic of the post_process()user-exits to the
axutil_empdb_post_process_invoke() function.
The following code sample shows the business logic implemented in the
axutil_empdb_post_process_invoke() function in the empdb_post_process_handler.c
file.
1 axis2_status_t AXIS2_CALL
2 axutil_empdb_post_process_invoke(
3 struct axis2_handler * handler,
4 const axutil_env_t * env,
5 struct axis2_msg_ctx * msg_ctx)
6 {
7 axiom_soap_envelope_t *soap_envelope = NULL;
8 axis2_svc_t* service_struct = NULL;
9 axis2_op_t* operation_struct = NULL;
10 const axis2_char_t* service_name = NULL;
11 const axis2_char_t* operation_name = NULL;
12 const axutil_qname_t* operation_qname = NULL;
13
14 axis2_char_t* target = "xml-stylesheet";
15 axis2_char_t* data = "type='text/xsl' href='../../empdb.xsl'";
16 axutil_hash_t* processing_instructions_ht = NULL;
17
18 AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
19 AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
20 AXIS2_LOG_DEBUG(env->log,AXIS2_LOG_SI, "Starting empdb post_processhandler .........");
21
22 processing_instructions_ht = axutil_hash_make(env);
23 axutil_hash_set(processing_instructions_ht,target,
24 AXIS2_HASH_KEY_STRING , data);
25 axis2_msg_ctx_set_processing_instructions(msg_ctx, env,
26 processing_instructions_ht);
27
28 /* The following section should be used when one needs to implement
29 the business logic at the service level*/
30
31 /* service_struct= axis2_msg_ctx_get_svc (msg_ctx,env);*/
32 /* service_name = axis2_svc_get_name(service_struct, env); */
33 /* The following section should be used when one needs to implement
34 the business logic at the operation level*/
35
36 /*operation_struct = axis2_msg_ctx_get_op(msg_ctx,env);*/
37 /*operation_qname = axis2_op_get_qname(operation_struct, env);*/
38 /*operation_name = axutil_qname_get_localpart(operation_qname, env);*/
39 /*if(!axutil_strcmp(operation_name,"EmpInfo")){*/
40 /* TODO :: Insert your business logic here */
41 /*}*/
42 /*if(!axutil_strcmp(operation_name,"EmpDel")){*/
43 /* TODO :: Insert your business logic here */
44 /*}*/
45 /*if(!axutil_strcmp(operation_name,"EmpAdd")){*/
46 /* TODO :: Insert your business logic here */
47 /*}*/
48 return AXIS2_SUCCESS;
49 }
The SoapAdminCL tool generates the code that lists the function and variable declaration.Line 1 - 13
Initializes variables.Line 14 - 16
Checks for errors.Line 18 - 20
Creates the processing instruction.Line 22 - 24
Adds the processing instruction to the SOAP message.Line 25 - 26
This code is useful when you have a business logic that needs to be implemented at the
operation level.
Line 31 - 47
68 Migrating NonStop SOAP 3 Services to NonStop SOAP 4 or Higher Versions