AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_engine_receive_fault( axis2_engine_t * engine, const axutil_env_t * env, axis2_msg_ctx_t * msg_ctx) { axis2_op_ctx_t *op_ctx = NULL; AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Start:axis2_engine_receive_fault"); AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE); op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env); if(!op_ctx) { /* If we do not have an op context that means this may be an incoming dual channel response. So try to dispatch the service */ axis2_conf_ctx_t *conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env); if(conf_ctx) { axis2_conf_t *conf = axis2_conf_ctx_get_conf(conf_ctx, env); if(conf) { axutil_array_list_t *phases = axis2_conf_get_in_phases_upto_and_including_post_dispatch(conf, env); if(phases) { if(axis2_msg_ctx_is_paused(msg_ctx, env)) { axis2_engine_resume_invocation_phases(engine, env, phases, msg_ctx); } else { axis2_engine_invoke_phases(engine, env, phases, msg_ctx); } } } } } op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env); /* Find and execute the fault in flow handlers */ if(op_ctx) { axis2_op_t *op = axis2_op_ctx_get_op(op_ctx, env); axutil_array_list_t *phases = axis2_op_get_fault_in_flow(op, env); if(axis2_msg_ctx_is_paused(msg_ctx, env)) { axis2_engine_resume_invocation_phases(engine, env, phases, msg_ctx); } else { axis2_engine_invoke_phases(engine, env, phases, msg_ctx); } } AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_engine_receive_fault"); return AXIS2_SUCCESS; }
AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_engine_resume_receive( axis2_engine_t * engine, const axutil_env_t * env, axis2_msg_ctx_t * msg_ctx) { axis2_status_t status = AXIS2_FAILURE; axis2_conf_ctx_t *conf_ctx = NULL; axis2_conf_t *conf = NULL; axutil_array_list_t *phases = NULL; AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Start:axis2_engine_resume_receive"); /* Find and invoke the phases */ conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env); conf = axis2_conf_ctx_get_conf(conf_ctx, env); phases = axis2_conf_get_in_phases_upto_and_including_post_dispatch(conf, env); axis2_engine_resume_invocation_phases(engine, env, phases, msg_ctx); /* Invoking the message receiver */ if(axis2_msg_ctx_get_server_side(msg_ctx, env) && !axis2_msg_ctx_is_paused(msg_ctx, env)) { /* Invoke the message receivers */ axis2_op_ctx_t *op_ctx = NULL; status = axis2_engine_check_must_understand_headers(env, msg_ctx); if(status != AXIS2_SUCCESS) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Checking for must understand headers failed"); return status; } op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env); if(op_ctx) { axis2_op_t *op = axis2_op_ctx_get_op(op_ctx, env); if(op) { axis2_msg_recv_t *receiver = NULL; 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_resume_receive"); return status; }
AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_engine_resume_send( axis2_engine_t * engine, const axutil_env_t * env, axis2_msg_ctx_t * msg_ctx) { axis2_op_ctx_t *op_ctx = NULL; axutil_array_list_t *phases = NULL; axis2_status_t status = AXIS2_FAILURE; AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Start:axis2_engine_resume_send"); /* Invoke the phases */ op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env); if(op_ctx) { axis2_op_t *op = axis2_op_ctx_get_op(op_ctx, env); if(op) { phases = axis2_op_get_out_flow(op, env); } } axis2_engine_resume_invocation_phases(engine, env, phases, msg_ctx); /* Invoking transport sender */ if(!axis2_msg_ctx_is_paused(msg_ctx, env)) { /* Write the message to the wire */ axis2_transport_out_desc_t *transport_out = NULL; axis2_transport_sender_t *sender = NULL; transport_out = axis2_msg_ctx_get_transport_out_desc(msg_ctx, env); if(transport_out) { sender = axis2_transport_out_desc_get_sender(transport_out, env); if(sender) { status = AXIS2_TRANSPORT_SENDER_INVOKE(sender, env, msg_ctx); } } } AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_engine_resume_send"); return status; }
/** * 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; }
static axis2_status_t AXIS2_CALL axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync( axis2_msg_recv_t * msg_recv, const axutil_env_t * env, axis2_msg_ctx_t * msg_ctx, axis2_msg_ctx_t * new_msg_ctx) { axis2_svc_skeleton_t *svc_obj = NULL; axis2_op_ctx_t *op_ctx = NULL; axis2_op_t *op_desc = NULL; const axis2_char_t *style = NULL; axiom_node_t *om_node = NULL; axiom_element_t *om_element = NULL; axis2_char_t *local_name = NULL; axiom_node_t *result_node = NULL; axiom_node_t *body_content_node = NULL; axiom_element_t *body_content_element = NULL; 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 *soap_fault = NULL; axiom_node_t *out_node = NULL; axis2_status_t status = AXIS2_SUCCESS; axis2_bool_t skel_invoked = AXIS2_FALSE; const axis2_char_t *soap_ns = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI; int soap_version = AXIOM_SOAP12; axiom_namespace_t *env_ns = NULL; axiom_node_t *fault_node = NULL; axiom_soap_fault_detail_t *fault_detail; axis2_bool_t is_fault = AXIS2_FALSE; AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE); AXIS2_PARAM_CHECK(env->error, new_msg_ctx, AXIS2_FAILURE); AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[axis2]Entry:axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync"); /* get the implementation class for the Web Service */ svc_obj = axis2_msg_recv_make_new_svc_obj(msg_recv, env, msg_ctx); if(!svc_obj) { const axis2_char_t *svc_name = NULL; axis2_svc_t *svc = axis2_msg_ctx_get_svc(msg_ctx, env); if(svc) { svc_name = axis2_svc_get_name(svc, env); } else { svc_name = "unknown"; } AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Impl object for service '%s' not set in message receiver. %d :: %s", svc_name, env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); status = AXIS2_FAILURE; } else { op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env); op_desc = axis2_op_ctx_get_op(op_ctx, env); style = axis2_op_get_style(op_desc, env); if(0 == axutil_strcmp(AXIS2_STYLE_DOC, style)) { axiom_soap_envelope_t *envelope = NULL; axiom_soap_body_t *body = NULL; envelope = axis2_msg_ctx_get_soap_envelope(msg_ctx, env); body = axiom_soap_envelope_get_body(envelope, env); om_node = axiom_soap_body_get_base_node(body, env); om_element = axiom_node_get_data_element(om_node, env); om_node = axiom_node_get_first_element(om_node, env); } else if(0 == axutil_strcmp(AXIS2_STYLE_RPC, style)) { axiom_soap_envelope_t *envelope = NULL; axiom_soap_body_t *body = NULL; axiom_node_t *op_node = NULL; axiom_element_t *op_element = NULL; envelope = axis2_msg_ctx_get_soap_envelope(msg_ctx, env); body = axiom_soap_envelope_get_body(envelope, env); op_node = axiom_soap_body_get_base_node(body, env); op_element = axiom_node_get_data_element(op_node, env); if(op_element) { local_name = axiom_element_get_localname(op_element, env); if(local_name) { axutil_array_list_t *function_arr = NULL; int i = 0; int size = 0; axis2_bool_t matches = AXIS2_FALSE; function_arr = svc_obj->func_array; if(function_arr) { size = axutil_array_list_size(function_arr, env); } for(i = 0; i < size; i++) { axis2_char_t *function_name = NULL; function_name = (axis2_char_t *)axutil_array_list_get(function_arr, env, i); if(!axutil_strcmp(function_name, local_name)) { matches = AXIS2_TRUE; } } if(matches) { om_node = axiom_node_get_first_child(op_node, env); om_element = axiom_node_get_data_element(om_node, env); } else { AXIS2_ERROR_SET(env->error, AXIS2_ERROR_OM_ELEMENT_MISMATCH, AXIS2_FAILURE); status = AXIS2_FAILURE; } } else { AXIS2_ERROR_SET(env->error, AXIS2_ERROR_OM_ELEMENT_INVALID_STATE, AXIS2_FAILURE); status = AXIS2_FAILURE; } } else { AXIS2_ERROR_SET(env->error, AXIS2_ERROR_RPC_NEED_MATCHING_CHILD, AXIS2_FAILURE); status = AXIS2_FAILURE; } } else { AXIS2_ERROR_SET(env->error, AXIS2_ERROR_UNKNOWN_STYLE, AXIS2_FAILURE); status = AXIS2_FAILURE; } if(status == AXIS2_SUCCESS) { skel_invoked = AXIS2_TRUE; result_node = AXIS2_SVC_SKELETON_INVOKE(svc_obj, env, om_node, new_msg_ctx); } if(result_node) { if(0 == axutil_strcmp(style, AXIS2_STYLE_RPC)) { axiom_namespace_t *ns = NULL; axis2_char_t *res_name = NULL; res_name = axutil_stracat(env, local_name, "Response"); ns = axiom_namespace_create(env, "http://soapenc/", "res"); if(!ns) { status = AXIS2_FAILURE; } else { body_content_element = axiom_element_create(env, NULL, res_name, ns, &body_content_node); axiom_node_add_child(body_content_node, env, result_node); } } else { body_content_node = result_node; } } else { axis2_char_t *mep = (axis2_char_t *)axis2_op_get_msg_exchange_pattern(op_desc, env); if(axutil_strcmp(mep, AXIS2_MEP_URI_IN_ONLY) && axutil_strcmp(mep, AXIS2_MEP_URI_ROBUST_IN_ONLY) && axutil_strcmp(mep, AXIS2_MEP_URI_IN_ONLY_WSDL2) && axutil_strcmp(mep, AXIS2_MEP_URI_ROBUST_IN_ONLY_WSDL2)) { status = AXIS2_ERROR_GET_STATUS_CODE(env->error); if(status == AXIS2_SUCCESS) { axis2_msg_ctx_set_no_content(new_msg_ctx, env, AXIS2_TRUE); } else { axis2_msg_ctx_set_status_code(msg_ctx, env, axis2_msg_ctx_get_status_code( new_msg_ctx, env)); } /* The new_msg_ctx is passed to the service. The status code must * be taken from here and set to the old message context which is * used by the worker when the request processing fails. */ if(svc_obj->ops->on_fault) { fault_node = AXIS2_SVC_SKELETON_ON_FAULT(svc_obj, env, om_node); } is_fault = AXIS2_TRUE; } else { /* If we have a in only message result node is NULL. We create fault only if * an error is set */ status = AXIS2_ERROR_GET_STATUS_CODE(env->error); if(status == AXIS2_SUCCESS) { axis2_msg_ctx_set_no_content(new_msg_ctx, env, AXIS2_TRUE); } else { axis2_msg_ctx_set_status_code(msg_ctx, env, axis2_msg_ctx_get_status_code( new_msg_ctx, env)); if((!axutil_strcmp(mep, AXIS2_MEP_URI_ROBUST_IN_ONLY)) || (!axutil_strcmp(mep, AXIS2_MEP_URI_ROBUST_IN_ONLY_WSDL2))) { /* The new_msg_ctx is passed to the service. The status code must * be taken from here and set to the old message context which is * used by the worker when the request processing fails. */ if(svc_obj->ops->on_fault) { fault_node = AXIS2_SVC_SKELETON_ON_FAULT(svc_obj, env, om_node); } is_fault = AXIS2_TRUE; } } } } } if(msg_ctx && axis2_msg_ctx_get_is_soap_11(msg_ctx, env)) { soap_ns = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI; /* default is 1.2 */ soap_version = AXIOM_SOAP11; } if(axis2_msg_ctx_get_soap_envelope(new_msg_ctx, env)) { /* service implementation has set the envelope, useful when setting a SOAP fault. No need to further process */ return AXIS2_SUCCESS; } /* create the soap envelope here */ env_ns = axiom_namespace_create(env, soap_ns, "soapenv"); if(!env_ns) { return AXIS2_FAILURE; } default_envelope = axiom_soap_envelope_create(env, env_ns); axiom_namespace_free(env_ns, env); if(!default_envelope) { return AXIS2_FAILURE; } out_header = axiom_soap_header_create_with_parent(env, default_envelope); if(!out_header) { return AXIS2_FAILURE; } out_body = axiom_soap_body_create_with_parent(env, default_envelope); if(!out_body) { return AXIS2_FAILURE; } out_node = axiom_soap_body_get_base_node(out_body, env); if(!out_node) { return AXIS2_FAILURE; } if(status != AXIS2_SUCCESS || is_fault) { /* something went wrong. set a SOAP Fault */ const axis2_char_t *fault_value_str = "soapenv:Sender"; const axis2_char_t *fault_reason_str = NULL; const axis2_char_t *err_msg = NULL; if(!skel_invoked) { if(axis2_msg_ctx_get_is_soap_11(msg_ctx, env)) { fault_value_str = AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX ":" AXIOM_SOAP11_FAULT_CODE_RECEIVER; } else { fault_value_str = AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX ":" AXIOM_SOAP12_SOAP_FAULT_VALUE_RECEIVER; } } err_msg = AXIS2_ERROR_GET_MESSAGE(env->error); if (err_msg && axutil_strcmp(err_msg, "")) { if(!axutil_strcmp(err_msg, "No Error")) { fault_reason_str = "An error has occurred, but could not determine exact details"; } else { fault_reason_str = err_msg; } } else { fault_reason_str = "An error has occurred, but could not determine exact details"; } soap_fault = axiom_soap_fault_create_default_fault(env, out_body, fault_value_str, fault_reason_str, soap_version); if (fault_node) { axiom_node_t *fault_detail_node = NULL; axis2_char_t *om_str = NULL; fault_detail = axiom_soap_fault_detail_create_with_parent(env, soap_fault); fault_detail_node = axiom_soap_fault_detail_get_base_node(fault_detail, env); om_str = axiom_node_to_string(fault_detail_node, env); if (om_str) { AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "fault_detail:%s", om_str); AXIS2_FREE(env->allocator, om_str); } axiom_soap_fault_detail_add_detail_entry(fault_detail, env, fault_node); } } if (body_content_node) { axiom_node_add_child(out_node, env, body_content_node); status = axis2_msg_ctx_set_soap_envelope(new_msg_ctx, env, default_envelope); } else if (soap_fault) { axis2_msg_ctx_set_soap_envelope(new_msg_ctx, env, default_envelope); status = AXIS2_SUCCESS; } 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; } AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[axis2]Exit:axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync"); return status; }
/** * Create a new create_seq_msg * @param env * @param application_rm_msg * @param internal_seq_id * @param acks_to * @param seq_prop_mgr * @return sandesha2_msg_ctx_t */ sandesha2_msg_ctx_t *AXIS2_CALL sandesha2_msg_creator_create_create_seq_msg( const axutil_env_t *env, sandesha2_msg_ctx_t *application_rm_msg, axis2_char_t *internal_seq_id, axis2_char_t *acks_to, sandesha2_seq_property_mgr_t *seq_prop_mgr) { axis2_msg_ctx_t *application_msg_ctx = NULL; axis2_msg_ctx_t *create_seq_msg_ctx = NULL; axis2_conf_ctx_t *conf_ctx = NULL; axis2_op_t *app_msg_op_desc = NULL; axis2_op_ctx_t *op_ctx = NULL; axis2_char_t *create_seq_msg_id = NULL; axis2_char_t *rm_version = NULL; axis2_char_t *rm_ns_value = NULL; axis2_char_t *addressing_ns_value = NULL; axis2_char_t *anonymous_uri = NULL; axis2_char_t *temp_value = NULL; axis2_char_t *temp_action = NULL; axutil_string_t *temp_soap_action = NULL; axis2_endpoint_ref_t *to_epr = NULL; axis2_endpoint_ref_t *temp_to = NULL; axis2_endpoint_ref_t *acks_to_epr = NULL; axis2_endpoint_ref_t *temp_reply_to = NULL; sandesha2_create_seq_t *create_seq_part = NULL; sandesha2_seq_property_bean_t *reply_to_bean = NULL; sandesha2_seq_property_bean_t *to_bean = NULL; sandesha2_msg_ctx_t *create_seq_rm_msg = NULL; sandesha2_address_t *temp_address = NULL; sandesha2_acks_to_t *temp_acks_to = NULL; axutil_property_t *property = NULL; const axis2_char_t *reply_to_address = NULL; application_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(application_rm_msg, env); if(!application_msg_ctx) { AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_APPLICATION_MSG_NULL, AXIS2_FAILURE); return NULL; } conf_ctx = axis2_msg_ctx_get_conf_ctx(application_msg_ctx, env); if(!conf_ctx) { AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_CONF_CTX_NULL, AXIS2_FAILURE); return NULL; } /* Creating by copying common contents. */ create_seq_msg_ctx = sandesha2_utils_create_new_related_msg_ctx(env, application_rm_msg); sandesha2_msg_creator_init_creation(env, application_msg_ctx, create_seq_msg_ctx); create_seq_msg_id = axutil_uuid_gen(env); axis2_msg_ctx_set_message_id(create_seq_msg_ctx, env, create_seq_msg_id); AXIS2_FREE(env->allocator, create_seq_msg_id); app_msg_op_desc = axis2_msg_ctx_get_op(application_msg_ctx, env); property = axis2_msg_ctx_get_property(application_msg_ctx, env, AXIS2_TARGET_EPR); if(property) { temp_to = axutil_property_get_value(property, env); to_epr = axis2_endpoint_ref_create(env, axis2_endpoint_ref_get_address(temp_to, env)); } if (!to_epr) { temp_to = sandesha2_msg_ctx_get_to(application_rm_msg, env); if (temp_to) { to_epr = axis2_endpoint_ref_create(env, axis2_endpoint_ref_get_address(temp_to, env)); } } if (to_epr) { axis2_msg_ctx_set_to(create_seq_msg_ctx, env, to_epr); to_epr = NULL; } temp_reply_to = sandesha2_msg_ctx_get_reply_to(application_rm_msg, env); if(temp_reply_to) { axis2_endpoint_ref_t *reply_to_epr = NULL; reply_to_address = axis2_endpoint_ref_get_address(temp_reply_to, env); reply_to_epr = axis2_endpoint_ref_create(env, reply_to_address); if(reply_to_epr) { axis2_msg_ctx_set_reply_to(create_seq_msg_ctx, env, reply_to_epr); } } create_seq_rm_msg = sandesha2_msg_ctx_create(env, create_seq_msg_ctx); AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "create_seq_internal_seq_id:%s", internal_seq_id); rm_version = sandesha2_utils_get_rm_version(env, application_msg_ctx); if(!rm_version) { AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_CANNOT_FIND_RM_VERSION_OF_GIVEN_MSG, AXIS2_FAILURE); return NULL; } rm_ns_value = sandesha2_spec_specific_consts_get_rm_ns_val(env, rm_version); addressing_ns_value = sandesha2_utils_get_seq_property(env, internal_seq_id, SANDESHA2_SEQ_PROP_ADDRESSING_NAMESPACE_VALUE, seq_prop_mgr); create_seq_part = sandesha2_create_seq_create(env, addressing_ns_value, rm_ns_value); if(!create_seq_part) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] creating create sequence message failed"); return NULL; } /* Adding sequence offer if present */ op_ctx = axis2_msg_ctx_get_op_ctx(application_msg_ctx, env); if(op_ctx) { axis2_op_t *operation = NULL; int mep = -1; axis2_char_t *offered_seq_id = NULL; /*axutil_property_t *property = NULL; axis2_ctx_t *ctx = NULL; ctx = axis2_msg_ctx_get_base(application_msg_ctx, env); property = axis2_ctx_get_property(ctx, env, SANDESHA2_CLIENT_OFFERED_SEQ_ID); if(property) { offered_seq_id = axutil_property_get_value(property, env); }*/ operation = axis2_op_ctx_get_op(op_ctx, env); mep = axis2_op_get_axis_specific_mep_const(operation, env); if(mep == AXIS2_MEP_CONSTANT_OUT_IN) { offered_seq_id = axutil_uuid_gen(env); } /*if(offered_seq_id && 0 != axutil_strcmp("", offered_seq_id))*/ if(offered_seq_id) { sandesha2_seq_offer_t *offer_part = NULL; sandesha2_identifier_t *identifier = NULL; sandesha2_endpoint_t *endpoint = NULL; offer_part = sandesha2_seq_offer_create(env, rm_ns_value, addressing_ns_value); identifier = sandesha2_identifier_create(env, rm_ns_value); sandesha2_identifier_set_identifier(identifier, env, offered_seq_id); sandesha2_seq_offer_set_identifier(offer_part, env, identifier); if(!axutil_strcmp(SANDESHA2_SPEC_VERSION_1_1, rm_version)) { axis2_endpoint_ref_t *reply_to_epr = NULL; sandesha2_address_t *address = NULL; reply_to_epr = axis2_endpoint_ref_create(env, reply_to_address); address = sandesha2_address_create(env, addressing_ns_value, reply_to_epr); endpoint = sandesha2_endpoint_create(env, address, rm_ns_value, addressing_ns_value); sandesha2_seq_offer_set_endpoint(offer_part, env, endpoint); } sandesha2_create_seq_set_seq_offer(create_seq_part, env, offer_part); } } reply_to_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, internal_seq_id, SANDESHA2_SEQ_PROP_REPLY_TO_EPR); to_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, internal_seq_id, SANDESHA2_SEQ_PROP_TO_EPR); if (to_bean) { temp_value = sandesha2_seq_property_bean_get_value(to_bean, env); if (temp_value) { to_epr = axis2_endpoint_ref_create(env, temp_value); } sandesha2_seq_property_bean_free(to_bean, env); } anonymous_uri = sandesha2_spec_specific_consts_get_anon_uri(env, addressing_ns_value); if(reply_to_bean) { axis2_endpoint_ref_t *reply_to_epr = NULL; temp_value = sandesha2_seq_property_bean_get_value(reply_to_bean, env); if(temp_value) { AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "dam_reply_to:%s", temp_value); reply_to_epr = axis2_endpoint_ref_create(env, temp_value); acks_to = axutil_strdup(env, temp_value); } if(reply_to_epr) { sandesha2_msg_ctx_set_reply_to(create_seq_rm_msg, env, reply_to_epr); } sandesha2_seq_property_bean_free(reply_to_bean, env); } if(!acks_to || !axutil_strcmp("", acks_to)) { acks_to = axutil_strdup(env, anonymous_uri); } acks_to_epr = axis2_endpoint_ref_create(env, acks_to); temp_to = sandesha2_msg_ctx_get_to(create_seq_rm_msg, env); if(!temp_to && to_epr) { sandesha2_msg_ctx_set_to(create_seq_rm_msg, env, to_epr); } else { axis2_endpoint_ref_free(to_epr, env); } temp_address = sandesha2_address_create(env, addressing_ns_value, acks_to_epr); temp_acks_to = sandesha2_acks_to_create(env, temp_address, rm_ns_value, addressing_ns_value); if(addressing_ns_value) { AXIS2_FREE(env->allocator, addressing_ns_value); } sandesha2_create_seq_set_acks_to(create_seq_part, env, temp_acks_to); sandesha2_msg_ctx_set_create_seq(create_seq_rm_msg, env, create_seq_part); sandesha2_msg_ctx_add_soap_envelope(create_seq_rm_msg, env); temp_action = sandesha2_spec_specific_consts_get_create_seq_action(env, rm_version); sandesha2_msg_ctx_set_wsa_action(create_seq_rm_msg, env, temp_action); temp_soap_action = axutil_string_create(env, temp_action); if(temp_soap_action) { sandesha2_msg_ctx_set_soap_action(create_seq_rm_msg, env, temp_soap_action); axutil_string_free(temp_soap_action, env); } /*sandesha2_msg_creator_finalize_creation(env, application_msg_ctx, create_seq_msg_ctx);*/ return create_seq_rm_msg; }
/* * 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_send( axis2_engine_t * engine, const axutil_env_t * env, axis2_msg_ctx_t * msg_ctx) { axis2_status_t status = AXIS2_SUCCESS; axis2_op_ctx_t *op_ctx = NULL; axutil_array_list_t *phases = NULL; axis2_conf_ctx_t *conf_ctx = NULL; axis2_conf_t *conf = NULL; AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "axis2_engine_send start"); AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE); /* Find and invoke the phases */ op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env); if(op_ctx) { axis2_op_t *op = axis2_op_ctx_get_op(op_ctx, env); if(op) { phases = axis2_op_get_out_flow(op, env); } } if(axis2_msg_ctx_is_paused(msg_ctx, env)) { /* Message has paused, so rerun it from the position it stopped. The handler which paused the message will be the first one to resume invocation */ status = axis2_engine_resume_invocation_phases(engine, env, phases, msg_ctx); if(status != AXIS2_SUCCESS) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Resuming invocation of phases failed"); return status; } conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env); if(conf_ctx) { conf = axis2_conf_ctx_get_conf(conf_ctx, env); if(conf) { axutil_array_list_t *global_out_phase = axis2_conf_get_out_phases(conf, env); if(global_out_phase) { axis2_engine_invoke_phases(engine, env, global_out_phase, msg_ctx); } } } } else { status = axis2_engine_invoke_phases(engine, env, phases, msg_ctx); if(status != AXIS2_SUCCESS) { return status; } conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env); if(conf_ctx) { conf = axis2_conf_ctx_get_conf(conf_ctx, env); if(conf) { axutil_array_list_t *global_out_phase = axis2_conf_get_out_phases(conf, env); if(global_out_phase) { axis2_engine_invoke_phases(engine, env, global_out_phase, msg_ctx); } } } } if(!(axis2_msg_ctx_is_paused(msg_ctx, env))) { /* Write the message to wire */ axis2_transport_sender_t *transport_sender = NULL; axis2_transport_out_desc_t *transport_out = axis2_msg_ctx_get_transport_out_desc(msg_ctx, env); if(transport_out) { transport_sender = axis2_transport_out_desc_get_sender(transport_out, env); if(!transport_sender) return AXIS2_FAILURE; status = AXIS2_TRANSPORT_SENDER_INVOKE(transport_sender, env, msg_ctx); if(status != AXIS2_SUCCESS) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Transport sender invoke failed"); return status; } } else { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Transport out is not set in message context"); return AXIS2_FAILURE; } } AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "axis2_engine_send end successfully"); return AXIS2_SUCCESS; }
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; }
static axis2_status_t AXIS2_CALL axis2_addr_disp_invoke( axis2_handler_t * handler, const axutil_env_t * env, struct axis2_msg_ctx *msg_ctx) { axis2_relates_to_t *relates_to = NULL; relates_to = axis2_msg_ctx_get_relates_to(msg_ctx, env); /** first check if we can dispatch using the relates_to */ if(relates_to) { const axis2_char_t *relates_to_value = NULL; relates_to_value = axis2_relates_to_get_value(relates_to, env); if(relates_to_value && axutil_strcmp(relates_to_value, "") != 0) { axis2_conf_ctx_t *conf_ctx = NULL; conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env); if(conf_ctx) { axis2_op_ctx_t *op_ctx = NULL; const axis2_char_t *msg_id = axis2_msg_ctx_get_msg_id(msg_ctx, env); op_ctx = axis2_conf_ctx_get_op_ctx(conf_ctx, env, msg_id); if(op_ctx) { axis2_op_t *op = NULL; op = axis2_op_ctx_get_op(op_ctx, env); if(op) { axis2_svc_ctx_t *svc_ctx = NULL; axis2_msg_ctx_set_op_ctx(msg_ctx, env, op_ctx); axis2_msg_ctx_set_op(msg_ctx, env, op); axis2_op_register_op_ctx(op, env, msg_ctx, op_ctx); svc_ctx = axis2_op_ctx_get_parent(op_ctx, env); if(svc_ctx) { axis2_svc_t *svc = NULL; axis2_svc_grp_ctx_t *svc_grp_ctx = NULL; axis2_msg_ctx_set_svc_ctx(msg_ctx, env, svc_ctx); svc = axis2_svc_ctx_get_svc(svc_ctx, env); if(svc) { axis2_msg_ctx_set_svc(msg_ctx, env, svc); } svc_grp_ctx = axis2_svc_ctx_get_parent(svc_ctx, env); if(svc_grp_ctx) { axutil_string_t *svc_grp_ctx_id_str = axutil_string_create(env, axis2_svc_grp_ctx_get_id(svc_grp_ctx, env)); axis2_msg_ctx_set_svc_grp_ctx_id(msg_ctx, env, svc_grp_ctx_id_str); axutil_string_free(svc_grp_ctx_id_str, env); } return AXIS2_SUCCESS; } } } } } } axis2_msg_ctx_set_find_svc(msg_ctx, env, axis2_addr_disp_find_svc); axis2_msg_ctx_set_find_op(msg_ctx, env, axis2_addr_disp_find_op); return axis2_disp_find_svc_and_op(handler, env, msg_ctx); }