axis2_status_t AXIS2_CALL axis2_statistics_admin_out_op_count_handler_invoke(struct axis2_handler *handler, const axutil_env_t *env, struct axis2_msg_ctx *msg_ctx) { axis2_status_t status = AXIS2_SUCCESS; service_admin_counter_t *counter = NULL; axutil_param_t *param = NULL; axis2_op_t *op = NULL; axis2_svc_t *svc = NULL; const axis2_char_t *svc_name = NULL; AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[adminservices] Start:axis2_statistics_admin_out_op_count_handler_invoke"); AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE); svc = axis2_msg_ctx_get_svc(msg_ctx, env); if(svc) { svc_name = axis2_svc_get_name(svc, env); } op = axis2_msg_ctx_get_op(msg_ctx, env); if(op) { param = axis2_op_get_param(op, env, AXIS2_OUT_OPERATION_COUNTER); if(param) { counter = axutil_param_get_value(param, env); if(counter) { service_admin_counter_increment(counter, env, msg_ctx); } } else { axis2_char_t *op_name = NULL; op_name = axutil_qname_get_localpart(axis2_op_get_qname(op, env), env); axutil_allocator_switch_to_global_pool(env->allocator); counter = service_admin_counter_create(env, svc_name, op_name); if(counter) { service_admin_counter_increment(counter, env, msg_ctx); param = axutil_param_create(env, AXIS2_OUT_OPERATION_COUNTER, counter); if(param) { axis2_op_add_param(op, env, param); } } axutil_allocator_switch_to_local_pool(env->allocator); } } AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[adminservices] End:axis2_statistics_admin_out_op_count_handler_invoke"); return status; }
/* * This method invokes the right service method */ axiom_node_t* AXIS2_CALL rm_sample_svc_invoke( axis2_svc_skeleton_t *svc_skeleton, const axutil_env_t *env, axiom_node_t *node, axis2_msg_ctx_t *msg_ctx) { axis2_op_t *op = NULL; axutil_qname_t *op_qname = NULL; axis2_char_t *op_name = NULL; op = axis2_msg_ctx_get_op(msg_ctx, env); if(op) { op_qname = (axutil_qname_t *)axis2_op_get_qname(op, env); if(op_qname) { op_name = axutil_qname_get_localpart(op_qname, env); } if(op_name) { axis2_endpoint_ref_t* to_epr = NULL; to_epr = axis2_msg_ctx_get_to(msg_ctx, env); if (to_epr) { const axis2_char_t* to_address = NULL; to_address = axis2_endpoint_ref_get_address(to_epr, env); if (to_address && strstr(to_address, AXIS2_ANON_SERVICE)) { axis2_msg_ctx_set_wsa_action(msg_ctx, env, AXIS2_ANON_OUT_IN_OP); } } if (!axutil_strcmp(op_name, "echoString")) { return rm_sample_svc_echo(env, node); } if (!axutil_strcmp(op_name, "ping")) { rm_sample_svc_ping(env, node); return NULL; } if (!axutil_strcmp(op_name, "mtomSample")) { return rm_sample_svc_mtom(env, node, msg_ctx); } } } return NULL; }
/* * This method invokes the right service method */ axiom_node_t* AXIS2_CALL savan_subs_mgr_svc_invoke( axis2_svc_skeleton_t *svc_skeleton, const axutil_env_t *env, axiom_node_t *node, axis2_msg_ctx_t *msg_ctx) { /* Invoke the business logic. * Depending on the function name invoke the correct impl method. */ axis2_op_t *op = NULL; axutil_qname_t *op_qname = NULL; axis2_char_t *op_name = NULL; op = axis2_msg_ctx_get_op(msg_ctx, env); if(op) { op_qname = (axutil_qname_t *)axis2_op_get_qname(op, env); if(op_qname) op_name = axutil_qname_get_localpart(op_qname, env); if(op_name) { if (axutil_strcmp(op_name, "add_subscriber") == 0) return savan_subs_mgr_svc_add_subscriber(env, node, msg_ctx); if (axutil_strcmp(op_name, "remove_subscriber") == 0) return savan_subs_mgr_svc_remove_subscriber(env, node, msg_ctx); if (axutil_strcmp(op_name, "get_subscriber") == 0) return savan_subs_mgr_svc_get_subscriber(env, node, msg_ctx); if (axutil_strcmp(op_name, "get_subscriber_list") == 0) return savan_subs_mgr_svc_get_subscriber_list(env, node, msg_ctx); if (axutil_strcmp(op_name, "get_topic_list") == 0) return savan_subs_mgr_svc_get_topic_list(env, node, msg_ctx); /*if (axutil_strcmp(op_name, "add_topic") == 0) return savan_subs_mgr_svc_add_topic(env, node, msg_ctx);*/ } } return NULL; }
/** * Private function implementations */ static axis2_char_t * wsf_xml_msg_recv_get_method_name( axis2_msg_ctx_t * msg_ctx, const axutil_env_t * env) { axis2_op_ctx_t *op_ctx = NULL; axis2_op_t *op = NULL; const axutil_qname_t *qname = NULL; axis2_char_t *name = NULL; op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env); if (!op_ctx) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[wsfphp] Operation Context is not found"); return NULL; } op = axis2_op_ctx_get_op(op_ctx, env); if (!op) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[wsfphp] Operation is not found"); return NULL; } qname = axis2_op_get_qname(op, env); if (!qname) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[wsfphp] Operation QName is not found"); return NULL; } name = axutil_qname_get_localpart(qname, env); return name; }
/* * This method invokes the right service method */ axiom_node_t* AXIS2_CALL axis2_svc_skel_SecurityAdminService_invoke(axis2_svc_skeleton_t *svc_skeleton, const axutil_env_t *env, axiom_node_t *content_node, axis2_msg_ctx_t *msg_ctx) { /* depending on the function name invoke the * corresponding method */ axis2_op_ctx_t *operation_ctx = NULL; axis2_op_t *operation = NULL; axutil_qname_t *op_qname = NULL; axis2_char_t *op_name = NULL; axis2_msg_ctx_t *in_msg_ctx = NULL; axiom_soap_envelope_t *req_soap_env = NULL; axiom_soap_header_t *req_soap_header = NULL; axiom_soap_envelope_t *res_soap_env = NULL; axiom_soap_header_t *res_soap_header = NULL; axiom_node_t *ret_node = NULL; axiom_node_t *input_header = NULL; axiom_node_t *output_header = NULL; axiom_node_t *header_base_node = NULL; axis2_svc_skel_SecurityAdminService_t *svc_skeleton_wrapper = NULL; adb_getScenariosResponse_t* ret_val1; adb_getScenarios_t* input_val1; axis2_status_t ret_val2; adb_applySecurity_t* input_val2; axis2_status_t ret_val3; adb_activateUsernameTokenAuthentication_t* input_val3; axis2_status_t ret_val4; adb_disableSecurityOnService_t* input_val4; adb_getSecurityConfigDataResponse_t* ret_val5; adb_getSecurityConfigData_t* input_val5; adb_getSecurityScenarioResponse_t* ret_val6; adb_getSecurityScenario_t* input_val6; svc_skeleton_wrapper = (axis2_svc_skel_SecurityAdminService_t*)svc_skeleton; operation_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env); operation = axis2_op_ctx_get_op(operation_ctx, env); op_qname = (axutil_qname_t *)axis2_op_get_qname(operation, env); op_name = axutil_qname_get_localpart(op_qname, env); if (op_name) { if ( axutil_strcmp(op_name, "getScenarios") == 0 ) { input_val1 = adb_getScenarios_create( env); if( AXIS2_FAILURE == adb_getScenarios_deserialize(input_val1, env, &content_node, NULL, AXIS2_FALSE)) { adb_getScenarios_free(input_val1, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getScenarios_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val1 = axis2_skel_SecurityAdminService_getScenarios(env, msg_ctx,input_val1, (axis2_skel_SecurityAdminService_getScenarios_fault*)&(svc_skeleton_wrapper->fault)); if ( NULL == ret_val1 ) { adb_getScenarios_free(input_val1, env); return NULL; } ret_node = adb_getScenariosResponse_serialize(ret_val1, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getScenariosResponse_free(ret_val1, env); adb_getScenarios_free(input_val1, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "applySecurity") == 0 ) { input_val2 = adb_applySecurity_create( env); if( AXIS2_FAILURE == adb_applySecurity_deserialize(input_val2, env, &content_node, NULL, AXIS2_FALSE)) { adb_applySecurity_free(input_val2, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_applySecurity_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val2 = axis2_skel_SecurityAdminService_applySecurity(env, msg_ctx,input_val2, (axis2_skel_SecurityAdminService_applySecurity_fault*)&(svc_skeleton_wrapper->fault)); if( AXIS2_FAILURE == ret_val2 ) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from applySecurity "); } adb_applySecurity_free(input_val2, env); /* since this has no output params it just returns NULL */ return NULL; } if ( axutil_strcmp(op_name, "activateUsernameTokenAuthentication") == 0 ) { input_val3 = adb_activateUsernameTokenAuthentication_create( env); if( AXIS2_FAILURE == adb_activateUsernameTokenAuthentication_deserialize(input_val3, env, &content_node, NULL, AXIS2_FALSE)) { adb_activateUsernameTokenAuthentication_free(input_val3, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_activateUsernameTokenAuthentication_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val3 = axis2_skel_SecurityAdminService_activateUsernameTokenAuthentication(env, msg_ctx,input_val3, (axis2_skel_SecurityAdminService_activateUsernameTokenAuthentication_fault*)&(svc_skeleton_wrapper->fault)); if( AXIS2_FAILURE == ret_val3 ) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from activateUsernameTokenAuthentication "); } adb_activateUsernameTokenAuthentication_free(input_val3, env); /* since this has no output params it just returns NULL */ return NULL; } if ( axutil_strcmp(op_name, "disableSecurityOnService") == 0 ) { input_val4 = adb_disableSecurityOnService_create( env); if( AXIS2_FAILURE == adb_disableSecurityOnService_deserialize(input_val4, env, &content_node, NULL, AXIS2_FALSE)) { adb_disableSecurityOnService_free(input_val4, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_disableSecurityOnService_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val4 = axis2_skel_SecurityAdminService_disableSecurityOnService(env, msg_ctx,input_val4, (axis2_skel_SecurityAdminService_disableSecurityOnService_fault*)&(svc_skeleton_wrapper->fault)); if( AXIS2_FAILURE == ret_val4 ) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from disableSecurityOnService "); } adb_disableSecurityOnService_free(input_val4, env); /* since this has no output params it just returns NULL */ return NULL; } if ( axutil_strcmp(op_name, "getSecurityConfigData") == 0 ) { input_val5 = adb_getSecurityConfigData_create( env); if( AXIS2_FAILURE == adb_getSecurityConfigData_deserialize(input_val5, env, &content_node, NULL, AXIS2_FALSE)) { adb_getSecurityConfigData_free(input_val5, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getSecurityConfigData_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val5 = axis2_skel_SecurityAdminService_getSecurityConfigData(env, msg_ctx,input_val5, (axis2_skel_SecurityAdminService_getSecurityConfigData_fault*)&(svc_skeleton_wrapper->fault)); if ( NULL == ret_val5 ) { adb_getSecurityConfigData_free(input_val5, env); return NULL; } ret_node = adb_getSecurityConfigDataResponse_serialize(ret_val5, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getSecurityConfigDataResponse_free(ret_val5, env); adb_getSecurityConfigData_free(input_val5, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getSecurityScenario") == 0 ) { input_val6 = adb_getSecurityScenario_create( env); if( AXIS2_FAILURE == adb_getSecurityScenario_deserialize(input_val6, env, &content_node, NULL, AXIS2_FALSE)) { adb_getSecurityScenario_free(input_val6, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getSecurityScenario_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val6 = axis2_skel_SecurityAdminService_getSecurityScenario(env, msg_ctx,input_val6, (axis2_skel_SecurityAdminService_getSecurityScenario_fault*)&(svc_skeleton_wrapper->fault)); if ( NULL == ret_val6 ) { adb_getSecurityScenario_free(input_val6, env); return NULL; } ret_node = adb_getSecurityScenarioResponse_serialize(ret_val6, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getSecurityScenarioResponse_free(ret_val6, env); adb_getSecurityScenario_free(input_val6, env); return ret_node; /* since this has no output params it just returns NULL */ } } AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "axis2_svc_skel_SecurityAdminService service ERROR: invalid OM parameters in request\n"); return NULL; }
/* * This method invokes the right service method */ axiom_node_t* AXIS2_CALL axis2_svc_skel_IIp2Location_invoke(axis2_svc_skeleton_t *svc_skeleton, const axutil_env_t *env, axiom_node_t *content_node, axis2_msg_ctx_t *msg_ctx) { /* depending on the function name invoke the * corresponding method */ axis2_op_ctx_t *operation_ctx = NULL; axis2_op_t *operation = NULL; axutil_qname_t *op_qname = NULL; axis2_char_t *op_name = NULL; axis2_msg_ctx_t *in_msg_ctx = NULL; axiom_soap_envelope_t *req_soap_env = NULL; axiom_soap_header_t *req_soap_header = NULL; axiom_soap_envelope_t *res_soap_env = NULL; axiom_soap_header_t *res_soap_header = NULL; axiom_node_t *ret_node = NULL; axiom_node_t *input_header = NULL; axiom_node_t *output_header = NULL; axiom_node_t *header_base_node = NULL; axis2_svc_skel_IIp2Location_t *svc_skeleton_wrapper = NULL; adb_getResponse_t* ret_val1; adb_get_t* input_val1; axis2_status_t ret_val2; adb_add_t* input_val2; svc_skeleton_wrapper = (axis2_svc_skel_IIp2Location_t*)svc_skeleton; operation_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env); operation = axis2_op_ctx_get_op(operation_ctx, env); op_qname = (axutil_qname_t *)axis2_op_get_qname(operation, env); op_name = axutil_qname_get_localpart(op_qname, env); if (op_name) { if ( axutil_strcmp(op_name, "get") == 0 ) { input_val1 = adb_get_create( env); if( AXIS2_FAILURE == adb_get_deserialize(input_val1, env, &content_node, NULL, AXIS2_FALSE)) { adb_get_free(input_val1, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_get_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val1 = axis2_skel_IIp2Location_get(env, msg_ctx,input_val1); if ( NULL == ret_val1 ) { adb_get_free(input_val1, env); return NULL; } ret_node = adb_getResponse_serialize(ret_val1, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getResponse_free(ret_val1, env); adb_get_free(input_val1, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "add") == 0 ) { input_val2 = adb_add_create( env); if( AXIS2_FAILURE == adb_add_deserialize(input_val2, env, &content_node, NULL, AXIS2_FALSE)) { adb_add_free(input_val2, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_add_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val2 = axis2_skel_IIp2Location_add(env, msg_ctx,input_val2); if( AXIS2_FAILURE == ret_val2 ) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from add "); } adb_add_free(input_val2, env); /* since this has no output params it just returns NULL */ return NULL; } } AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "axis2_svc_skel_IIp2Location service ERROR: invalid OM parameters in request\n"); return NULL; }
/* * This method invokes the right service method */ axiom_node_t* AXIS2_CALL axis2_svc_skel_LoggingAdmin_invoke(axis2_svc_skeleton_t *svc_skeleton, const axutil_env_t *env, axiom_node_t *content_node, axis2_msg_ctx_t *msg_ctx) { /* depending on the function name invoke the * corresponding method */ axis2_op_ctx_t *operation_ctx = NULL; axis2_op_t *operation = NULL; axutil_qname_t *op_qname = NULL; axis2_char_t *op_name = NULL; axis2_msg_ctx_t *in_msg_ctx = NULL; axiom_soap_envelope_t *req_soap_env = NULL; axiom_soap_header_t *req_soap_header = NULL; axiom_soap_envelope_t *res_soap_env = NULL; axiom_soap_header_t *res_soap_header = NULL; axiom_node_t *ret_node = NULL; axiom_node_t *input_header = NULL; axiom_node_t *output_header = NULL; axiom_node_t *header_base_node = NULL; axis2_svc_skel_LoggingAdmin_t *svc_skeleton_wrapper = NULL; adb_getAllLoggerDataResponse_t* ret_val1; adb_getAllLoggerData_t* input_val1; axis2_status_t ret_val2; axis2_status_t ret_val3; adb_updateSystemLog_t* input_val3; adb_getSystemLogResponse_t* ret_val4; adb_getAppenderDataResponse_t* ret_val5; adb_getAppenderData_t* input_val5; axis2_status_t ret_val6; adb_updateAllAppenderData_t* input_val6; adb_getLoggerDataResponse_t* ret_val7; adb_getLoggerData_t* input_val7; axis2_status_t ret_val8; adb_updateLoggerData_t* input_val8; svc_skeleton_wrapper = (axis2_svc_skel_LoggingAdmin_t*)svc_skeleton; operation_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env); operation = axis2_op_ctx_get_op(operation_ctx, env); op_qname = (axutil_qname_t *)axis2_op_get_qname(operation, env); op_name = axutil_qname_get_localpart(op_qname, env); if (op_name) { if ( axutil_strcmp(op_name, "getAllLoggerData") == 0 ) { input_val1 = adb_getAllLoggerData_create( env); if( AXIS2_FAILURE == adb_getAllLoggerData_deserialize(input_val1, env, &content_node, NULL, AXIS2_FALSE)) { adb_getAllLoggerData_free(input_val1, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getAllLoggerData_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val1 = axis2_skel_LoggingAdmin_getAllLoggerData(env, msg_ctx,input_val1); if ( NULL == ret_val1 ) { adb_getAllLoggerData_free(input_val1, env); return NULL; } ret_node = adb_getAllLoggerDataResponse_serialize(ret_val1, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getAllLoggerDataResponse_free(ret_val1, env); adb_getAllLoggerData_free(input_val1, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "restoreDefaults") == 0 ) { ret_val2 = axis2_skel_LoggingAdmin_restoreDefaults(env, msg_ctx, (axis2_skel_LoggingAdmin_restoreDefaults_fault*)&(svc_skeleton_wrapper->fault)); if( AXIS2_FAILURE == ret_val2 ) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from restoreDefaults "); } /* since this has no output params it just returns NULL */ return NULL; } if ( axutil_strcmp(op_name, "updateSystemLog") == 0 ) { input_val3 = adb_updateSystemLog_create( env); if( AXIS2_FAILURE == adb_updateSystemLog_deserialize(input_val3, env, &content_node, NULL, AXIS2_FALSE)) { adb_updateSystemLog_free(input_val3, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_updateSystemLog_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val3 = axis2_skel_LoggingAdmin_updateSystemLog(env, msg_ctx,input_val3, (axis2_skel_LoggingAdmin_updateSystemLog_fault*)&(svc_skeleton_wrapper->fault)); if( AXIS2_FAILURE == ret_val3 ) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from updateSystemLog "); } adb_updateSystemLog_free(input_val3, env); /* since this has no output params it just returns NULL */ return NULL; } if ( axutil_strcmp(op_name, "getSystemLog") == 0 ) { ret_val4 = axis2_skel_LoggingAdmin_getSystemLog(env, msg_ctx, (axis2_skel_LoggingAdmin_getSystemLog_fault*)&(svc_skeleton_wrapper->fault)); if ( NULL == ret_val4 ) { return NULL; } ret_node = adb_getSystemLogResponse_serialize(ret_val4, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getSystemLogResponse_free(ret_val4, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getAppenderData") == 0 ) { input_val5 = adb_getAppenderData_create( env); if( AXIS2_FAILURE == adb_getAppenderData_deserialize(input_val5, env, &content_node, NULL, AXIS2_FALSE)) { adb_getAppenderData_free(input_val5, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getAppenderData_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val5 = axis2_skel_LoggingAdmin_getAppenderData(env, msg_ctx,input_val5); if ( NULL == ret_val5 ) { adb_getAppenderData_free(input_val5, env); return NULL; } ret_node = adb_getAppenderDataResponse_serialize(ret_val5, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getAppenderDataResponse_free(ret_val5, env); adb_getAppenderData_free(input_val5, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "updateAllAppenderData") == 0 ) { input_val6 = adb_updateAllAppenderData_create( env); if( AXIS2_FAILURE == adb_updateAllAppenderData_deserialize(input_val6, env, &content_node, NULL, AXIS2_FALSE)) { adb_updateAllAppenderData_free(input_val6, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_updateAllAppenderData_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val6 = axis2_skel_LoggingAdmin_updateAllAppenderData(env, msg_ctx,input_val6, (axis2_skel_LoggingAdmin_updateAllAppenderData_fault*)&(svc_skeleton_wrapper->fault)); if( AXIS2_FAILURE == ret_val6 ) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from updateAllAppenderData "); } adb_updateAllAppenderData_free(input_val6, env); /* since this has no output params it just returns NULL */ return NULL; } if ( axutil_strcmp(op_name, "getLoggerData") == 0 ) { input_val7 = adb_getLoggerData_create( env); if( AXIS2_FAILURE == adb_getLoggerData_deserialize(input_val7, env, &content_node, NULL, AXIS2_FALSE)) { adb_getLoggerData_free(input_val7, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getLoggerData_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val7 = axis2_skel_LoggingAdmin_getLoggerData(env, msg_ctx,input_val7); if ( NULL == ret_val7 ) { adb_getLoggerData_free(input_val7, env); return NULL; } ret_node = adb_getLoggerDataResponse_serialize(ret_val7, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getLoggerDataResponse_free(ret_val7, env); adb_getLoggerData_free(input_val7, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "updateLoggerData") == 0 ) { input_val8 = adb_updateLoggerData_create( env); if( AXIS2_FAILURE == adb_updateLoggerData_deserialize(input_val8, env, &content_node, NULL, AXIS2_FALSE)) { adb_updateLoggerData_free(input_val8, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_updateLoggerData_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val8 = axis2_skel_LoggingAdmin_updateLoggerData(env, msg_ctx,input_val8, (axis2_skel_LoggingAdmin_updateLoggerData_fault*)&(svc_skeleton_wrapper->fault)); if( AXIS2_FAILURE == ret_val8 ) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from updateLoggerData "); } adb_updateLoggerData_free(input_val8, env); /* since this has no output params it just returns NULL */ return NULL; } } AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "axis2_svc_skel_LoggingAdmin service ERROR: invalid OM parameters in request\n"); return NULL; }
/* * This method invokes the right service method */ axiom_node_t* AXIS2_CALL axis2_svc_skel_TraderExchange_invoke(axis2_svc_skeleton_t *svc_skeleton, const axutil_env_t *env, axiom_node_t *content_node, axis2_msg_ctx_t *msg_ctx) { /* depending on the function name invoke the * corresponding method */ axis2_op_ctx_t *operation_ctx = NULL; axis2_op_t *operation = NULL; axutil_qname_t *op_qname = NULL; axis2_char_t *op_name = NULL; axiom_node_t *ret_node = NULL; axis2_status_t ret_val1 = AXIS2_SUCCESS; axis2_updateRequest_t* input_val1_1; operation_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env); operation = axis2_op_ctx_get_op(operation_ctx, env); op_qname = (axutil_qname_t *)axis2_op_get_qname(operation, env); op_name = axutil_qname_get_localpart(op_qname, env); if (op_name) { if ( axutil_strcmp(op_name, "update") == 0 ) { input_val1_1 = axis2_updateRequest_create( env); axis2_updateRequest_deserialize(input_val1_1, env, content_node ); ret_val1 = axis2_skel_TraderExchange_update(env, input_val1_1 ); if ( AXIS2_FAILURE == ret_val1) { AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from update " " %d :: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return axis2_svc_skel_TraderExchange_on_fault( svc_skeleton, env, NULL); } /*ret_node = axis2__serialize(ret_val1, env, NULL, AXIS2_FALSE); axis2__free(ret_val1, env); axis2_updateRequest_free(input_val1_1, env); */ return ret_node; } } printf("axis2_svc_skel_TraderExchange service ERROR: invalid OM parameters in request\n"); return content_node; }
/* * This method invokes the right service method */ axiom_node_t* AXIS2_CALL axis2_svc_skel_StatisticsAdmin_invoke(axis2_svc_skeleton_t *svc_skeleton, const axutil_env_t *env, axiom_node_t *content_node, axis2_msg_ctx_t *msg_ctx) { /* depending on the function name invoke the * corresponding method */ axis2_op_ctx_t *operation_ctx = NULL; axis2_op_t *operation = NULL; axutil_qname_t *op_qname = NULL; axis2_char_t *op_name = NULL; axis2_msg_ctx_t *in_msg_ctx = NULL; axiom_soap_envelope_t *req_soap_env = NULL; axiom_soap_header_t *req_soap_header = NULL; axiom_soap_envelope_t *res_soap_env = NULL; axiom_soap_header_t *res_soap_header = NULL; axiom_node_t *ret_node = NULL; axiom_node_t *input_header = NULL; axiom_node_t *output_header = NULL; axiom_node_t *header_base_node = NULL; axis2_svc_skel_StatisticsAdmin_t *svc_skeleton_wrapper = NULL; adb_getMaxServiceResponseTimeResponse_t* ret_val1; adb_getMaxServiceResponseTime_t* input_val1; adb_getServiceRequestCountResponse_t* ret_val2; adb_getServiceRequestCount_t* input_val2; adb_getSystemResponseCountResponse_t* ret_val3; adb_getOperationResponseCountResponse_t* ret_val4; adb_getOperationResponseCount_t* input_val4; adb_getAvgOperationResponseTimeResponse_t* ret_val5; adb_getAvgOperationResponseTime_t* input_val5; adb_getOperationStatisticsResponse_t* ret_val6; adb_getOperationStatistics_t* input_val6; adb_getMinSystemResponseTimeResponse_t* ret_val7; adb_getSystemFaultCountResponse_t* ret_val8; adb_getMaxSystemResponseTimeResponse_t* ret_val9; adb_getServiceFaultCountResponse_t* ret_val10; adb_getServiceFaultCount_t* input_val10; adb_getMinServiceResponseTimeResponse_t* ret_val11; adb_getMinServiceResponseTime_t* input_val11; adb_getMaxOperationResponseTimeResponse_t* ret_val12; adb_getMaxOperationResponseTime_t* input_val12; adb_getServiceStatisticsResponse_t* ret_val13; adb_getServiceStatistics_t* input_val13; adb_getOperationFaultCountResponse_t* ret_val14; adb_getOperationFaultCount_t* input_val14; adb_getAvgServiceResponseTimeResponse_t* ret_val15; adb_getAvgServiceResponseTime_t* input_val15; adb_getServiceResponseCountResponse_t* ret_val16; adb_getServiceResponseCount_t* input_val16; adb_getSystemRequestCountResponse_t* ret_val17; adb_getMinOperationResponseTimeResponse_t* ret_val18; adb_getMinOperationResponseTime_t* input_val18; adb_getAvgSystemResponseTimeResponse_t* ret_val19; adb_getSystemStatisticsResponse_t* ret_val20; adb_getOperationRequestCountResponse_t* ret_val21; adb_getOperationRequestCount_t* input_val21; svc_skeleton_wrapper = (axis2_svc_skel_StatisticsAdmin_t*)svc_skeleton; operation_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env); operation = axis2_op_ctx_get_op(operation_ctx, env); op_qname = (axutil_qname_t *)axis2_op_get_qname(operation, env); op_name = axutil_qname_get_localpart(op_qname, env); if (op_name) { if ( axutil_strcmp(op_name, "getMaxServiceResponseTime") == 0 ) { input_val1 = adb_getMaxServiceResponseTime_create( env); if( AXIS2_FAILURE == adb_getMaxServiceResponseTime_deserialize(input_val1, env, &content_node, NULL, AXIS2_FALSE)) { adb_getMaxServiceResponseTime_free(input_val1, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getMaxServiceResponseTime_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val1 = axis2_skel_StatisticsAdmin_getMaxServiceResponseTime(env, msg_ctx,input_val1); if ( NULL == ret_val1 ) { adb_getMaxServiceResponseTime_free(input_val1, env); return NULL; } ret_node = adb_getMaxServiceResponseTimeResponse_serialize(ret_val1, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getMaxServiceResponseTimeResponse_free(ret_val1, env); adb_getMaxServiceResponseTime_free(input_val1, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getServiceRequestCount") == 0 ) { input_val2 = adb_getServiceRequestCount_create( env); if( AXIS2_FAILURE == adb_getServiceRequestCount_deserialize(input_val2, env, &content_node, NULL, AXIS2_FALSE)) { adb_getServiceRequestCount_free(input_val2, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getServiceRequestCount_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val2 = axis2_skel_StatisticsAdmin_getServiceRequestCount(env, msg_ctx,input_val2); if ( NULL == ret_val2 ) { adb_getServiceRequestCount_free(input_val2, env); return NULL; } ret_node = adb_getServiceRequestCountResponse_serialize(ret_val2, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getServiceRequestCountResponse_free(ret_val2, env); adb_getServiceRequestCount_free(input_val2, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getSystemResponseCount") == 0 ) { ret_val3 = axis2_skel_StatisticsAdmin_getSystemResponseCount(env, msg_ctx); if ( NULL == ret_val3 ) { return NULL; } ret_node = adb_getSystemResponseCountResponse_serialize(ret_val3, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getSystemResponseCountResponse_free(ret_val3, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getOperationResponseCount") == 0 ) { input_val4 = adb_getOperationResponseCount_create( env); if( AXIS2_FAILURE == adb_getOperationResponseCount_deserialize(input_val4, env, &content_node, NULL, AXIS2_FALSE)) { adb_getOperationResponseCount_free(input_val4, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getOperationResponseCount_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val4 = axis2_skel_StatisticsAdmin_getOperationResponseCount(env, msg_ctx,input_val4); if ( NULL == ret_val4 ) { adb_getOperationResponseCount_free(input_val4, env); return NULL; } ret_node = adb_getOperationResponseCountResponse_serialize(ret_val4, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getOperationResponseCountResponse_free(ret_val4, env); adb_getOperationResponseCount_free(input_val4, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getAvgOperationResponseTime") == 0 ) { input_val5 = adb_getAvgOperationResponseTime_create( env); if( AXIS2_FAILURE == adb_getAvgOperationResponseTime_deserialize(input_val5, env, &content_node, NULL, AXIS2_FALSE)) { adb_getAvgOperationResponseTime_free(input_val5, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getAvgOperationResponseTime_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val5 = axis2_skel_StatisticsAdmin_getAvgOperationResponseTime(env, msg_ctx,input_val5); if ( NULL == ret_val5 ) { adb_getAvgOperationResponseTime_free(input_val5, env); return NULL; } ret_node = adb_getAvgOperationResponseTimeResponse_serialize(ret_val5, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getAvgOperationResponseTimeResponse_free(ret_val5, env); adb_getAvgOperationResponseTime_free(input_val5, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getOperationStatistics") == 0 ) { input_val6 = adb_getOperationStatistics_create( env); if( AXIS2_FAILURE == adb_getOperationStatistics_deserialize(input_val6, env, &content_node, NULL, AXIS2_FALSE)) { adb_getOperationStatistics_free(input_val6, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getOperationStatistics_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val6 = axis2_skel_StatisticsAdmin_getOperationStatistics(env, msg_ctx,input_val6); if ( NULL == ret_val6 ) { adb_getOperationStatistics_free(input_val6, env); return NULL; } ret_node = adb_getOperationStatisticsResponse_serialize(ret_val6, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getOperationStatisticsResponse_free(ret_val6, env); adb_getOperationStatistics_free(input_val6, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getMinSystemResponseTime") == 0 ) { ret_val7 = axis2_skel_StatisticsAdmin_getMinSystemResponseTime(env, msg_ctx); if ( NULL == ret_val7 ) { return NULL; } ret_node = adb_getMinSystemResponseTimeResponse_serialize(ret_val7, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getMinSystemResponseTimeResponse_free(ret_val7, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getSystemFaultCount") == 0 ) { ret_val8 = axis2_skel_StatisticsAdmin_getSystemFaultCount(env, msg_ctx); if ( NULL == ret_val8 ) { return NULL; } ret_node = adb_getSystemFaultCountResponse_serialize(ret_val8, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getSystemFaultCountResponse_free(ret_val8, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getMaxSystemResponseTime") == 0 ) { ret_val9 = axis2_skel_StatisticsAdmin_getMaxSystemResponseTime(env, msg_ctx); if ( NULL == ret_val9 ) { return NULL; } ret_node = adb_getMaxSystemResponseTimeResponse_serialize(ret_val9, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getMaxSystemResponseTimeResponse_free(ret_val9, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getServiceFaultCount") == 0 ) { input_val10 = adb_getServiceFaultCount_create( env); if( AXIS2_FAILURE == adb_getServiceFaultCount_deserialize(input_val10, env, &content_node, NULL, AXIS2_FALSE)) { adb_getServiceFaultCount_free(input_val10, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getServiceFaultCount_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val10 = axis2_skel_StatisticsAdmin_getServiceFaultCount(env, msg_ctx,input_val10); if ( NULL == ret_val10 ) { adb_getServiceFaultCount_free(input_val10, env); return NULL; } ret_node = adb_getServiceFaultCountResponse_serialize(ret_val10, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getServiceFaultCountResponse_free(ret_val10, env); adb_getServiceFaultCount_free(input_val10, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getMinServiceResponseTime") == 0 ) { input_val11 = adb_getMinServiceResponseTime_create( env); if( AXIS2_FAILURE == adb_getMinServiceResponseTime_deserialize(input_val11, env, &content_node, NULL, AXIS2_FALSE)) { adb_getMinServiceResponseTime_free(input_val11, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getMinServiceResponseTime_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val11 = axis2_skel_StatisticsAdmin_getMinServiceResponseTime(env, msg_ctx,input_val11); if ( NULL == ret_val11 ) { adb_getMinServiceResponseTime_free(input_val11, env); return NULL; } ret_node = adb_getMinServiceResponseTimeResponse_serialize(ret_val11, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getMinServiceResponseTimeResponse_free(ret_val11, env); adb_getMinServiceResponseTime_free(input_val11, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getMaxOperationResponseTime") == 0 ) { input_val12 = adb_getMaxOperationResponseTime_create( env); if( AXIS2_FAILURE == adb_getMaxOperationResponseTime_deserialize(input_val12, env, &content_node, NULL, AXIS2_FALSE)) { adb_getMaxOperationResponseTime_free(input_val12, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getMaxOperationResponseTime_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val12 = axis2_skel_StatisticsAdmin_getMaxOperationResponseTime(env, msg_ctx,input_val12); if ( NULL == ret_val12 ) { adb_getMaxOperationResponseTime_free(input_val12, env); return NULL; } ret_node = adb_getMaxOperationResponseTimeResponse_serialize(ret_val12, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getMaxOperationResponseTimeResponse_free(ret_val12, env); adb_getMaxOperationResponseTime_free(input_val12, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getServiceStatistics") == 0 ) { input_val13 = adb_getServiceStatistics_create( env); if( AXIS2_FAILURE == adb_getServiceStatistics_deserialize(input_val13, env, &content_node, NULL, AXIS2_FALSE)) { adb_getServiceStatistics_free(input_val13, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getServiceStatistics_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val13 = axis2_skel_StatisticsAdmin_getServiceStatistics(env, msg_ctx,input_val13); if ( NULL == ret_val13 ) { adb_getServiceStatistics_free(input_val13, env); return NULL; } ret_node = adb_getServiceStatisticsResponse_serialize(ret_val13, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getServiceStatisticsResponse_free(ret_val13, env); adb_getServiceStatistics_free(input_val13, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getOperationFaultCount") == 0 ) { input_val14 = adb_getOperationFaultCount_create( env); if( AXIS2_FAILURE == adb_getOperationFaultCount_deserialize(input_val14, env, &content_node, NULL, AXIS2_FALSE)) { adb_getOperationFaultCount_free(input_val14, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getOperationFaultCount_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val14 = axis2_skel_StatisticsAdmin_getOperationFaultCount(env, msg_ctx,input_val14); if ( NULL == ret_val14 ) { adb_getOperationFaultCount_free(input_val14, env); return NULL; } ret_node = adb_getOperationFaultCountResponse_serialize(ret_val14, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getOperationFaultCountResponse_free(ret_val14, env); adb_getOperationFaultCount_free(input_val14, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getAvgServiceResponseTime") == 0 ) { input_val15 = adb_getAvgServiceResponseTime_create( env); if( AXIS2_FAILURE == adb_getAvgServiceResponseTime_deserialize(input_val15, env, &content_node, NULL, AXIS2_FALSE)) { adb_getAvgServiceResponseTime_free(input_val15, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getAvgServiceResponseTime_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val15 = axis2_skel_StatisticsAdmin_getAvgServiceResponseTime(env, msg_ctx,input_val15); if ( NULL == ret_val15 ) { adb_getAvgServiceResponseTime_free(input_val15, env); return NULL; } ret_node = adb_getAvgServiceResponseTimeResponse_serialize(ret_val15, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getAvgServiceResponseTimeResponse_free(ret_val15, env); adb_getAvgServiceResponseTime_free(input_val15, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getServiceResponseCount") == 0 ) { input_val16 = adb_getServiceResponseCount_create( env); if( AXIS2_FAILURE == adb_getServiceResponseCount_deserialize(input_val16, env, &content_node, NULL, AXIS2_FALSE)) { adb_getServiceResponseCount_free(input_val16, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getServiceResponseCount_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val16 = axis2_skel_StatisticsAdmin_getServiceResponseCount(env, msg_ctx,input_val16); if ( NULL == ret_val16 ) { adb_getServiceResponseCount_free(input_val16, env); return NULL; } ret_node = adb_getServiceResponseCountResponse_serialize(ret_val16, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getServiceResponseCountResponse_free(ret_val16, env); adb_getServiceResponseCount_free(input_val16, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getSystemRequestCount") == 0 ) { ret_val17 = axis2_skel_StatisticsAdmin_getSystemRequestCount(env, msg_ctx); if ( NULL == ret_val17 ) { return NULL; } ret_node = adb_getSystemRequestCountResponse_serialize(ret_val17, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getSystemRequestCountResponse_free(ret_val17, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getMinOperationResponseTime") == 0 ) { input_val18 = adb_getMinOperationResponseTime_create( env); if( AXIS2_FAILURE == adb_getMinOperationResponseTime_deserialize(input_val18, env, &content_node, NULL, AXIS2_FALSE)) { adb_getMinOperationResponseTime_free(input_val18, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getMinOperationResponseTime_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val18 = axis2_skel_StatisticsAdmin_getMinOperationResponseTime(env, msg_ctx,input_val18); if ( NULL == ret_val18 ) { adb_getMinOperationResponseTime_free(input_val18, env); return NULL; } ret_node = adb_getMinOperationResponseTimeResponse_serialize(ret_val18, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getMinOperationResponseTimeResponse_free(ret_val18, env); adb_getMinOperationResponseTime_free(input_val18, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getAvgSystemResponseTime") == 0 ) { ret_val19 = axis2_skel_StatisticsAdmin_getAvgSystemResponseTime(env, msg_ctx); if ( NULL == ret_val19 ) { return NULL; } ret_node = adb_getAvgSystemResponseTimeResponse_serialize(ret_val19, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getAvgSystemResponseTimeResponse_free(ret_val19, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getSystemStatistics") == 0 ) { ret_val20 = axis2_skel_StatisticsAdmin_getSystemStatistics(env, msg_ctx); if ( NULL == ret_val20 ) { return NULL; } ret_node = adb_getSystemStatisticsResponse_serialize(ret_val20, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getSystemStatisticsResponse_free(ret_val20, env); return ret_node; /* since this has no output params it just returns NULL */ } if ( axutil_strcmp(op_name, "getOperationRequestCount") == 0 ) { input_val21 = adb_getOperationRequestCount_create( env); if( AXIS2_FAILURE == adb_getOperationRequestCount_deserialize(input_val21, env, &content_node, NULL, AXIS2_FALSE)) { adb_getOperationRequestCount_free(input_val21, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DATA_ELEMENT_IS_NULL, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the adb_getOperationRequestCount_deserialize: " "This should be due to an invalid XML"); return NULL; } ret_val21 = axis2_skel_StatisticsAdmin_getOperationRequestCount(env, msg_ctx,input_val21); if ( NULL == ret_val21 ) { adb_getOperationRequestCount_free(input_val21, env); return NULL; } ret_node = adb_getOperationRequestCountResponse_serialize(ret_val21, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); adb_getOperationRequestCountResponse_free(ret_val21, env); adb_getOperationRequestCount_free(input_val21, env); return ret_node; /* since this has no output params it just returns NULL */ } } AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "axis2_svc_skel_StatisticsAdmin service ERROR: invalid OM parameters in request\n"); return NULL; }
axis2_status_t AXIS2_CALL wsf_xml_msg_recv_invoke_business_logic_sync( axis2_msg_recv_t * msg_recv, const axutil_env_t * env, axis2_msg_ctx_t * in_msg_ctx, axis2_msg_ctx_t * out_msg_ctx) { axis2_op_ctx_t *op_ctx = NULL; axis2_op_t *op_desc = NULL; axiom_namespace_t *env_ns = NULL; int soap_version = AXIOM_SOAP12; axis2_status_t status = AXIS2_SUCCESS; axis2_bool_t skel_invoked = AXIS2_FALSE; const axis2_char_t *style = NULL; axis2_char_t *local_name = NULL; axis2_char_t *soap_ns = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI; axis2_char_t *operation_name = NULL; char *classname = NULL; axutil_property_t *svc_info_prop = NULL; axutil_property_t *req_info_prop = NULL; wsf_svc_info_t *svc_info = NULL; wsf_request_info_t *req_info = NULL; /** store in_msg_ctx envelope */ axiom_soap_envelope_t *envelope = NULL; axiom_soap_body_t *body = NULL; axiom_node_t *in_body_node = NULL; /* store out_msg_ctx envelope */ axiom_soap_envelope_t *default_envelope = NULL; axiom_soap_body_t *out_body = NULL; axiom_soap_header_t *out_header = NULL; axiom_soap_fault_t *out_soap_fault = NULL; axiom_node_t *result_node = NULL; axiom_node_t *out_body_content_node = NULL; axiom_element_t *out_body_content_element = NULL; axiom_node_t *out_node = NULL; zval **output_headers_zval = NULL; TSRMLS_FETCH(); AXIS2_PARAM_CHECK(env->error, in_msg_ctx, AXIS2_FAILURE); AXIS2_PARAM_CHECK(env->error, out_msg_ctx, AXIS2_FAILURE); op_ctx = axis2_msg_ctx_get_op_ctx(in_msg_ctx, env); op_desc = axis2_op_ctx_get_op(op_ctx, env); style = axis2_op_get_style(op_desc, env); envelope = axis2_msg_ctx_get_soap_envelope(in_msg_ctx, env); body = axiom_soap_envelope_get_body(envelope, env); in_body_node = axiom_soap_body_get_base_node(body, env); if (0 == axutil_strcmp(AXIS2_STYLE_DOC, style)) { local_name = wsf_xml_msg_recv_get_method_name(in_msg_ctx, env); if (!local_name) { return AXIS2_FAILURE; } } else if (0 == axutil_strcmp(AXIS2_STYLE_RPC, style)) { axiom_node_t *op_node = NULL; axiom_element_t *op_element = NULL; op_node = axiom_node_get_first_child(in_body_node, env); if (!op_node) { return AXIS2_FAILURE; } op_element = axiom_node_get_data_element(op_node, env); if (!op_element) { return AXIS2_FAILURE; } local_name = axiom_element_get_localname(op_element, env); if (!local_name) { return AXIS2_FAILURE; } } /** set soap version and soap namespace to local variables */ if (in_msg_ctx && axis2_msg_ctx_get_is_soap_11(in_msg_ctx, env)) { soap_ns = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI; /* default is 1.2 */ soap_version = AXIOM_SOAP11; } svc_info_prop = axis2_msg_ctx_get_property(in_msg_ctx, env, WSF_SVC_INFO); if (svc_info_prop) { svc_info = (wsf_svc_info_t *) axutil_property_get_value(svc_info_prop, env); if (svc_info) { operation_name = axutil_hash_get(svc_info->ops_to_functions, local_name, AXIS2_HASH_KEY_STRING); if (!operation_name) { return AXIS2_FAILURE; } } else { return AXIS2_FAILURE; } if (svc_info->ops_to_classes) { classname = axutil_hash_get(svc_info->ops_to_classes, local_name, AXIS2_HASH_KEY_STRING); } } req_info_prop = axis2_msg_ctx_get_property(in_msg_ctx, env, WSF_REQ_INFO); if (req_info_prop) { req_info = (wsf_request_info_t *) axutil_property_get_value(req_info_prop, env); if (axis2_msg_ctx_get_doing_rest(in_msg_ctx, env)) { axis2_op_t *op = NULL; axiom_node_t *body_child_node = NULL; axiom_element_t *body_child = NULL; int i = 0; body_child_node = axiom_node_get_first_child(in_body_node, env); if (!body_child_node) { op = axis2_msg_ctx_get_op(in_msg_ctx, env); if (op) { body_child = axiom_element_create_with_qname(env, NULL, axis2_op_get_qname(op, env), &body_child_node); axiom_soap_body_add_child(body, env, body_child_node); } } if (req_info->param_keys && req_info->param_values) { int i = 0; for (i = 0; i < axutil_array_list_size(req_info->param_keys, env); i++) { axiom_node_t *node = NULL; axiom_element_t *element = NULL; axis2_char_t *param_key = NULL; axis2_char_t *param_value = NULL; param_key = axutil_array_list_get(req_info->param_keys, env, i); param_value = axutil_array_list_get(req_info->param_values, env, i); element = axiom_element_create(env, NULL, param_key, NULL, &node); axiom_element_set_text(element, env, param_value, node); axiom_node_add_child(body_child_node, env, node); AXIS2_FREE(env->allocator, param_key); AXIS2_FREE(env->allocator, param_value); } axutil_array_list_free(req_info->param_keys, env); axutil_array_list_free(req_info->param_values, env); } } } if (svc_info->ht_op_params) { zval **tmp; char *function_type = NULL; if (zend_hash_find(svc_info->ht_op_params, operation_name, strlen(operation_name) + 1, (void **) & tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { function_type = Z_STRVAL_PP(tmp); if (strcmp(function_type, WSF_MIXED) == 0) { result_node = wsf_xml_msg_recv_invoke_mixed(env, svc_info, in_msg_ctx, out_msg_ctx, operation_name, classname, &output_headers_zval TSRMLS_CC); } else if (strcmp(function_type, WSF_WSMESSAGE) == 0) { result_node = wsf_xml_msg_recv_invoke_wsmsg(env, operation_name, in_msg_ctx, out_msg_ctx, svc_info, classname, req_info->content_type TSRMLS_CC); } } } else { /* this is where the default value for opParam is set, If the wsdl option is set go for the MIXED mode by default */ if (svc_info->wsdl == NULL || svc_info->omit_wsdl) { result_node = wsf_xml_msg_recv_invoke_wsmsg(env, operation_name, in_msg_ctx, out_msg_ctx, svc_info, classname, req_info->content_type TSRMLS_CC); } else { result_node = wsf_xml_msg_recv_invoke_mixed(env, svc_info, in_msg_ctx, out_msg_ctx, operation_name, classname, &output_headers_zval TSRMLS_CC); } } if (!result_node) { status = AXIS2_ERROR_GET_STATUS_CODE(env->error); } else { AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, WSF_PHP_LOG_PREFIX "Response node is not null"); } if (result_node) { if (0 == axutil_strcmp(style, AXIS2_STYLE_RPC)) { axiom_namespace_t *ns = NULL; axis2_char_t *response_name = NULL; response_name = axutil_stracat(env, local_name, "Response"); ns = axiom_namespace_create(env, "http://soapenc/", "res"); if (!ns) { return AXIS2_FAILURE; } out_body_content_element = axiom_element_create(env, NULL, response_name, ns, &out_body_content_node); axiom_node_add_child(out_body_content_node, env, result_node); } else { out_body_content_node = result_node; } } if (axis2_msg_ctx_get_soap_envelope(out_msg_ctx, env)) { /* service implementation has set the envelope, useful when setting a SOAP fault. No need to further process */ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, WSF_PHP_LOG_PREFIX "soap fault is set"); return AXIS2_SUCCESS; } /* create the soap envelope here */ env_ns = axiom_namespace_create(env, soap_ns, AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX); if (!env_ns) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[wsfphp] error seting the namespces for the " AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX); return AXIS2_FAILURE; } default_envelope = axiom_soap_envelope_create(env, env_ns); if (!default_envelope) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, WSF_PHP_LOG_PREFIX "failed in creating the response soap envelope"); return AXIS2_FAILURE; } out_body = axiom_soap_body_create_with_parent(env, default_envelope); if (!out_body) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[wsfphp] failed in creating the response soap body"); return AXIS2_FAILURE; } out_header = axiom_soap_header_create_with_parent(env, default_envelope); if (!out_header) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, WSF_PHP_LOG_PREFIX "failed in creating the response soap headers"); return AXIS2_FAILURE; } if (output_headers_zval) { axiom_node_t *header_base_node = NULL; HashPosition pos; zval **param; char *header_str; axiom_node_t *header_node; for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(output_headers_zval), &pos); zend_hash_get_current_data_ex(Z_ARRVAL_PP(output_headers_zval), (void **) & param, &pos) == SUCCESS; zend_hash_move_forward_ex(Z_ARRVAL_PP(output_headers_zval), &pos)) { if (Z_TYPE_PP(param) == IS_STRING) { header_base_node = axiom_soap_header_get_base_node(out_header, env); if (header_base_node) { header_str = Z_STRVAL_PP(param); header_node = wsf_util_deserialize_buffer(env, header_str); axiom_node_add_child(header_base_node, env, header_node); } else { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[wsfphp] failed in retrieving the response soap headers node"); return AXIS2_FAILURE; } } } } out_node = axiom_soap_body_get_base_node(out_body, env); if (!out_node) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[wsfphp] failed in retrieving the response soap body node"); return AXIS2_FAILURE; } if (status != AXIS2_SUCCESS) { /* something went wrong, set a SOAP Fault */ axis2_char_t *fault_value_str = AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX ":" AXIOM_SOAP12_SOAP_FAULT_VALUE_SENDER; axis2_char_t *fault_reason_str = NULL; axis2_char_t *err_msg = NULL; if (!skel_invoked) fault_value_str = AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX ":" AXIOM_SOAP12_SOAP_FAULT_VALUE_RECEIVER; ; err_msg = (char *) AXIS2_ERROR_GET_MESSAGE(env->error); if (err_msg) { fault_reason_str = err_msg; } else { fault_reason_str = "Error occurred while processing SOAP message"; } out_soap_fault = axiom_soap_fault_create_default_fault(env, out_body, fault_value_str, fault_reason_str, soap_version); } if (out_body_content_node) { axiom_node_add_child(out_node, env, out_body_content_node); status = axis2_msg_ctx_set_soap_envelope(out_msg_ctx, env, default_envelope); } else if (out_soap_fault) { axis2_msg_ctx_set_soap_envelope(out_msg_ctx, env, default_envelope); status = AXIS2_FAILURE; /* if there is a failure we have to return a failure code */ } else { /* we should free the memory as the envelope is not used, one way case */ axiom_soap_envelope_free(default_envelope, env); default_envelope = NULL; } return AXIS2_SUCCESS; }
axis2_op_t *AXIS2_CALL axis2_rest_disp_find_op( axis2_msg_ctx_t * msg_ctx, const axutil_env_t * env, axis2_svc_t * svc) { axis2_endpoint_ref_t *endpoint_ref = NULL; axis2_op_t *op = NULL; axiom_soap_envelope_t *soap_env = NULL; axiom_soap_body_t *soap_body = NULL; axiom_element_t *body_child = NULL; axiom_node_t *body_child_node = NULL; axiom_node_t *body_element_node = NULL; axis2_bool_t soap_env_exists = AXIS2_TRUE; int i = 0; axutil_array_list_t *param_keys = NULL; axutil_array_list_t *param_values = NULL; AXIS2_PARAM_CHECK(env->error, svc, NULL); if(!axis2_msg_ctx_get_doing_rest(msg_ctx, env)) return NULL; endpoint_ref = axis2_msg_ctx_get_to(msg_ctx, env); if(endpoint_ref) { const axis2_char_t *address = NULL; address = axis2_endpoint_ref_get_address(endpoint_ref, env); if(address) { axis2_char_t **url_tokens = NULL; url_tokens = axutil_parse_request_url_for_svc_and_op(env, address); if(url_tokens) { if(url_tokens[0]) { axis2_char_t *location = NULL; location = strstr(address, url_tokens[0]); if(location) { const axis2_char_t *method = NULL; location += strlen(url_tokens[0]); param_keys = axutil_array_list_create(env, 10); if(!param_keys) { AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create the live rest parameter maps"); return NULL; } param_values = axutil_array_list_create(env, 10); if(!param_values) { axutil_array_list_free(param_keys, env); AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create the live rest parameter maps"); return NULL; } method = axis2_msg_ctx_get_rest_http_method(msg_ctx, env); op = axis2_core_utils_get_rest_op_with_method_and_location(svc, env, method, location, param_keys, param_values); } } if(url_tokens[0]) AXIS2_FREE(env->allocator, url_tokens[0]); if(url_tokens[1]) AXIS2_FREE(env->allocator, url_tokens[1]); AXIS2_FREE(env->allocator, url_tokens); } } } if(!op) { if(param_keys) { for(i = 0; i < axutil_array_list_size(param_keys, env); i++) { void *value = axutil_array_list_get(param_keys, env, i); AXIS2_FREE(env->allocator, value); } axutil_array_list_free(param_keys, env); } if(param_values) { for(i = 0; i < axutil_array_list_size(param_values, env); i++) { void *value = axutil_array_list_get(param_values, env, i); AXIS2_FREE(env->allocator, value); } axutil_array_list_free(param_values, env); } return NULL; } soap_env = axis2_msg_ctx_get_soap_envelope(msg_ctx, env); if(!soap_env) { soap_env_exists = AXIS2_FALSE; soap_env = axiom_soap_envelope_create_default_soap_envelope(env, AXIOM_SOAP11); } if(soap_env) { soap_body = axiom_soap_envelope_get_body(soap_env, env); } if(!soap_body) { AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL, AXIS2_FAILURE); if(param_keys) { for(i = 0; i < axutil_array_list_size(param_keys, env); i++) { void *value = axutil_array_list_get(param_keys, env, i); AXIS2_FREE(env->allocator, value); } axutil_array_list_free(param_keys, env); } if(param_values) { for(i = 0; i < axutil_array_list_size(param_values, env); i++) { void *value = axutil_array_list_get(param_values, env, i); AXIS2_FREE(env->allocator, value); } axutil_array_list_free(param_values, env); } return NULL; } body_element_node = axiom_soap_body_get_base_node(soap_body, env); if(body_element_node) { body_child_node = axiom_node_get_first_child(body_element_node, env); } if(!body_child_node) { body_child = axiom_element_create_with_qname(env, NULL, axis2_op_get_qname(op, env), &body_child_node); axiom_soap_body_add_child(soap_body, env, body_child_node); } if(param_keys && param_values) { for(i = 0; i < axutil_array_list_size(param_keys, env); i++) { axis2_char_t *param_key = NULL; axis2_char_t *param_value = NULL; axiom_node_t *node = NULL; axiom_element_t *element = NULL; param_key = axutil_array_list_get(param_keys, env, i); param_value = axutil_array_list_get(param_values, env, i); element = axiom_element_create(env, NULL, param_key, NULL, &node); axiom_element_set_text(element, env, param_value, node); axiom_node_add_child(body_child_node, env, node); AXIS2_FREE(env->allocator, param_key); AXIS2_FREE(env->allocator, param_value); } axutil_array_list_free(param_keys, env); axutil_array_list_free(param_values, env); } if(!soap_env_exists) { axis2_msg_ctx_set_soap_envelope(msg_ctx, env, soap_env); } return op; }
AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_svc_add_op( axis2_svc_t * svc, const axutil_env_t * env, axis2_op_t * op) { axis2_status_t status = AXIS2_FAILURE; axis2_msg_recv_t *msg_recv = NULL; const axutil_qname_t *qname = NULL; axis2_char_t *key = NULL; const axis2_char_t *svcname = NULL; axutil_array_list_t *mappings_list = NULL; int size = 0; int j = 0; AXIS2_PARAM_CHECK(env->error, op, AXIS2_FAILURE); svcname = axis2_svc_get_name(svc, env); qname = axis2_op_get_qname(op, env); if(qname) key = axutil_qname_get_localpart(qname, env); mappings_list = axis2_op_get_wsamapping_list(op, env); /* Adding action mappings into service */ if(mappings_list) size = axutil_array_list_size(mappings_list, env); for(j = 0; j < size; j++) { axis2_char_t *mapping = NULL; mapping = (axis2_char_t *)axutil_array_list_get(mappings_list, env, j); status = axis2_svc_add_mapping(svc, env, mapping, op); if(AXIS2_SUCCESS != status) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Adding operation %s to service %s mapping list failed", svcname, key); return status; } } status = axis2_op_set_parent(op, env, svc); if(AXIS2_SUCCESS != status) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Setting service %s as operation %s parent failed", svcname, key); return status; } msg_recv = axis2_op_get_msg_recv(op, env); if(msg_recv == NULL) { msg_recv = axis2_desc_builder_load_default_msg_recv(env); axis2_op_set_msg_recv(op, env, msg_recv); } if(key) { /* If service defines the operation, then we should not override with module level * operation. Module operations are global. If any setting to be modified, those operations * can be defined in service */ if(!axutil_hash_get(svc->op_alias_map, key, AXIS2_HASH_KEY_STRING)) { axutil_hash_set(svc->op_alias_map, key, AXIS2_HASH_KEY_STRING, op); } } return AXIS2_SUCCESS; }
/** * Here we extract all operations defined in module.xml and built execution * chains for them by calling axis2_phase_resolver_build_execution_chains_for_module_op() * function. Within that function handlers of the modules defined for that * operation are added to module operation chains appropriately. */ AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_svc_add_module_ops( axis2_svc_t * svc, const axutil_env_t * env, axis2_module_desc_t * module_desc, axis2_conf_t * conf) { axutil_hash_t *map = NULL; axutil_hash_index_t *hash_idx = NULL; axis2_phase_resolver_t *phase_resolver = NULL; axis2_op_t *op_desc = NULL; axis2_status_t status = AXIS2_FAILURE; const axis2_char_t *svcname = NULL; axis2_char_t *modname = NULL; axis2_char_t *opname = NULL; AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Entry:axis2_svc_add_module_ops"); AXIS2_PARAM_CHECK(env->error, module_desc, AXIS2_FAILURE); AXIS2_PARAM_CHECK(env->error, conf, AXIS2_FAILURE); svcname = axis2_svc_get_name(svc, env); modname = axutil_qname_get_localpart(axis2_module_desc_get_qname(module_desc, env), env); map = axis2_module_desc_get_all_ops(module_desc, env); phase_resolver = axis2_phase_resolver_create_with_config_and_svc(env, conf, svc); if(!phase_resolver) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase resolver failed for service %s", svcname); return AXIS2_FAILURE; } for(hash_idx = axutil_hash_first(map, env); hash_idx; hash_idx = axutil_hash_next(env, hash_idx)) { void *v = NULL; axutil_hash_this(hash_idx, NULL, NULL, &v); op_desc = (axis2_op_t *)v; opname = axutil_qname_get_localpart(axis2_op_get_qname(op_desc, env), env); status = axis2_phase_resolver_build_execution_chains_for_module_op(phase_resolver, env, op_desc); if(AXIS2_SUCCESS != status) { axis2_phase_resolver_free(phase_resolver, env); AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Builidng module operation %s failed for module %s", opname, modname); return status; } status = axis2_svc_add_op(svc, env, op_desc); if(AXIS2_SUCCESS != status) { axis2_phase_resolver_free(phase_resolver, env); AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Adding operation %s to service %s failed", opname, svcname); return status; } } axis2_phase_resolver_free(phase_resolver, env); AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_svc_add_module_ops"); return AXIS2_SUCCESS; }
/* * This method invokes the right service method */ axiom_node_t* AXIS2_CALL axis2_svc_skel_TraderClient_invoke(axis2_svc_skeleton_t *svc_skeleton, const axutil_env_t *env, axiom_node_t *content_node, axis2_msg_ctx_t *msg_ctx) { /* depending on the function name invoke the * corresponding method */ axis2_op_ctx_t *operation_ctx = NULL; axis2_op_t *operation = NULL; axutil_qname_t *op_qname = NULL; axis2_char_t *op_name = NULL; axiom_node_t *ret_node = NULL; axis2_buyResponse_t* ret_val1 = NULL; axis2_buyRequest_t* input_val1_1; axis2_getPortfolioResponse_t* ret_val2 = NULL; axis2_getPortfolioRequest_t* input_val2_1; axis2_depositResponse_t* ret_val3 = NULL; axis2_depositRequest_t* input_val3_1; axis2_getSymbolsResponse_t* ret_val4 = NULL; axis2_getSymbolsRequest_t* input_val4_1; axis2_getQuoteResponse_t* ret_val5 = NULL; axis2_getQuoteRequest_t* input_val5_1; axis2_createAccountResponse_t* ret_val6 = NULL; axis2_createAccountRequest_t* input_val6_1; axis2_sellResponse_t* ret_val7 = NULL; axis2_sellRequest_t* input_val7_1; operation_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env); operation = axis2_op_ctx_get_op(operation_ctx, env); op_qname = (axutil_qname_t *)axis2_op_get_qname(operation, env); op_name = axutil_qname_get_localpart(op_qname, env); if (op_name) { if ( axutil_strcmp(op_name, "buy") == 0 ) { input_val1_1 = axis2_buyRequest_create( env); axis2_buyRequest_deserialize(input_val1_1, env, content_node ); ret_val1 = axis2_skel_TraderClient_buy(env, input_val1_1 ); if ( NULL == ret_val1 ) { AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from buy " " %d :: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return axis2_svc_skel_TraderClient_on_fault( svc_skeleton, env, NULL); } ret_node = axis2_buyResponse_serialize(ret_val1, env, NULL, AXIS2_FALSE); axis2_buyResponse_free(ret_val1, env); axis2_buyRequest_free(input_val1_1, env); return ret_node; } if ( axutil_strcmp(op_name, "getPortfolio") == 0 ) { input_val2_1 = axis2_getPortfolioRequest_create( env); axis2_getPortfolioRequest_deserialize(input_val2_1, env, content_node ); ret_val2 = axis2_skel_TraderClient_getPortfolio(env, input_val2_1 ); if ( NULL == ret_val2 ) { AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from getPortfolio " " %d :: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return axis2_svc_skel_TraderClient_on_fault( svc_skeleton, env, NULL); } ret_node = axis2_getPortfolioResponse_serialize(ret_val2, env, NULL, AXIS2_FALSE); axis2_getPortfolioResponse_free(ret_val2, env); axis2_getPortfolioRequest_free(input_val2_1, env); return ret_node; } if ( axutil_strcmp(op_name, "deposit") == 0 ) { input_val3_1 = axis2_depositRequest_create( env); axis2_depositRequest_deserialize(input_val3_1, env, content_node ); ret_val3 = axis2_skel_TraderClient_deposit(env, input_val3_1 ); if ( NULL == ret_val3 ) { AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from deposit " " %d :: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return axis2_svc_skel_TraderClient_on_fault( svc_skeleton, env, NULL); } ret_node = axis2_depositResponse_serialize(ret_val3, env, NULL, AXIS2_FALSE); axis2_depositResponse_free(ret_val3, env); axis2_depositRequest_free(input_val3_1, env); return ret_node; } if ( axutil_strcmp(op_name, "getSymbols") == 0 ) { input_val4_1 = axis2_getSymbolsRequest_create( env); axis2_getSymbolsRequest_deserialize(input_val4_1, env, content_node ); ret_val4 = axis2_skel_TraderClient_getSymbols(env, input_val4_1 ); if ( NULL == ret_val4 ) { AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from getSymbols " " %d :: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return axis2_svc_skel_TraderClient_on_fault( svc_skeleton, env, NULL); } ret_node = axis2_getSymbolsResponse_serialize(ret_val4, env, NULL, AXIS2_FALSE); axis2_getSymbolsResponse_free(ret_val4, env); axis2_getSymbolsRequest_free(input_val4_1, env); return ret_node; } if ( axutil_strcmp(op_name, "getQuote") == 0 ) { input_val5_1 = axis2_getQuoteRequest_create( env); axis2_getQuoteRequest_deserialize(input_val5_1, env, content_node ); ret_val5 = axis2_skel_TraderClient_getQuote(env, input_val5_1 ); if ( NULL == ret_val5 ) { AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from getQuote " " %d :: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return axis2_svc_skel_TraderClient_on_fault( svc_skeleton, env, NULL); } ret_node = axis2_getQuoteResponse_serialize(ret_val5, env, NULL, AXIS2_FALSE); axis2_getQuoteResponse_free(ret_val5, env); axis2_getQuoteRequest_free(input_val5_1, env); return ret_node; } if ( axutil_strcmp(op_name, "createAccount") == 0 ) { input_val6_1 = axis2_createAccountRequest_create( env); axis2_createAccountRequest_deserialize(input_val6_1, env, content_node ); ret_val6 = axis2_skel_TraderClient_createAccount(env, input_val6_1 ); if ( NULL == ret_val6 ) { AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from createAccount " " %d :: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return axis2_svc_skel_TraderClient_on_fault( svc_skeleton, env, NULL); } ret_node = axis2_createAccountResponse_serialize(ret_val6, env, NULL, AXIS2_FALSE); axis2_createAccountResponse_free(ret_val6, env); axis2_createAccountRequest_free(input_val6_1, env); return ret_node; } if ( axutil_strcmp(op_name, "sell") == 0 ) { input_val7_1 = axis2_sellRequest_create( env); axis2_sellRequest_deserialize(input_val7_1, env, content_node ); ret_val7 = axis2_skel_TraderClient_sell(env, input_val7_1 ); if ( NULL == ret_val7 ) { AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from sell " " %d :: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return axis2_svc_skel_TraderClient_on_fault( svc_skeleton, env, NULL); } ret_node = axis2_sellResponse_serialize(ret_val7, env, NULL, AXIS2_FALSE); axis2_sellResponse_free(ret_val7, env); axis2_sellRequest_free(input_val7_1, env); return ret_node; } } printf("axis2_svc_skel_TraderClient service ERROR: invalid OM parameters in request\n"); return content_node; }
AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_engine_receive( axis2_engine_t * engine, const axutil_env_t * env, axis2_msg_ctx_t * msg_ctx) { axis2_conf_ctx_t *conf_ctx = NULL; axis2_conf_t *conf = NULL; axis2_op_ctx_t *op_ctx = NULL; axis2_op_t *op = NULL; axutil_array_list_t *pre_calculated_phases = NULL; axutil_array_list_t *op_specific_phases = NULL; axis2_status_t status = AXIS2_FAILURE; AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Start:axis2_engine_receive"); AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE); conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env); conf = axis2_conf_ctx_get_conf(conf_ctx, env); pre_calculated_phases = axis2_conf_get_in_phases_upto_and_including_post_dispatch(conf, env); if(axis2_msg_ctx_is_paused(msg_ctx, env)) { /* The message has paused, so re-run them from the position they stopped. */ axis2_engine_resume_invocation_phases(engine, env, pre_calculated_phases, msg_ctx); if(axis2_msg_ctx_is_paused(msg_ctx, env)) { AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Message context is paused. So return here."); return AXIS2_SUCCESS; } /* Resume op specific phases */ op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env); if(op_ctx) { op = axis2_op_ctx_get_op(op_ctx, env); op_specific_phases = axis2_op_get_in_flow(op, env); axis2_engine_resume_invocation_phases(engine, env, op_specific_phases, msg_ctx); if(axis2_msg_ctx_is_paused(msg_ctx, env)) { AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Message context is paused. So return here."); return AXIS2_SUCCESS; } } } else { status = axis2_engine_invoke_phases(engine, env, pre_calculated_phases, msg_ctx); if(status != AXIS2_SUCCESS) { if(axis2_msg_ctx_get_server_side(msg_ctx, env)) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Invoking pre-calculated phases failed"); return status; } } if(axis2_msg_ctx_is_paused(msg_ctx, env)) { AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Message context is paused. So return here."); return AXIS2_SUCCESS; } op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env); if(op_ctx) { op = axis2_op_ctx_get_op(op_ctx, env); op_specific_phases = axis2_op_get_in_flow(op, env); status = axis2_engine_invoke_phases(engine, env, op_specific_phases, msg_ctx); if(status != AXIS2_SUCCESS) { axis2_char_t *op_name = NULL; op_name = axutil_qname_get_localpart(axis2_op_get_qname(op, env), env); AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Invoking operation specific phases failed for operation %s", op_name); return status; } if(axis2_msg_ctx_is_paused(msg_ctx, env)) { AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Message context is paused. So return here."); return AXIS2_SUCCESS; } } } if((axis2_msg_ctx_get_server_side(msg_ctx, env)) && !(axis2_msg_ctx_is_paused(msg_ctx, env))) { axis2_msg_recv_t *receiver = NULL; status = axis2_engine_check_must_understand_headers(env, msg_ctx); if(status != AXIS2_SUCCESS) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Check for must understand headers failed"); return status; } /* Invoke the message receivers */ if(!op) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Operation not found"); return AXIS2_FAILURE; } receiver = axis2_op_get_msg_recv(op, env); if(!receiver) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Message receiver not set in operation description"); return AXIS2_FAILURE; } status = axis2_msg_recv_receive(receiver, env, msg_ctx, axis2_msg_recv_get_derived( receiver, env)); } AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_engine_receive"); return status; }