/** * auto generated method signature * for "registerClient|http://www.wso2.org" operation. * @param registerClientRequest14 * @return */ axis2_registerClientResponse_t* axis2_stub_ExchangeTrader_registerClient( axis2_stub_t *stub, const axutil_env_t *env, axis2_registerClientRequest_t* registerClientRequest14) { axis2_svc_client_t *svc_client = NULL; axis2_options_t *options = NULL; axiom_node_t *ret_node = NULL; const axis2_char_t *soap_action = NULL; axutil_qname_t *op_qname = NULL; axiom_node_t *payload = NULL; axis2_registerClientResponse_t* ret_val = NULL; payload = axis2_registerClientRequest_serialize(registerClientRequest14, env, NULL, AXIS2_FALSE); options = axis2_stub_get_options( stub, env); if ( NULL == options ) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "options is null in stub: Error code:" " %d :: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return NULL; } svc_client = axis2_stub_get_svc_client(stub, env ); soap_action = axis2_options_get_action( options, env ); if ( NULL == soap_action ) { soap_action = "\"\""; axis2_options_set_action( options, env, soap_action ); } axis2_options_set_soap_version(options, env, AXIOM_SOAP11 ); op_qname = axutil_qname_create(env, "registerClient" , "http://www.wso2.org", NULL); ret_node = axis2_svc_client_send_receive_with_op_qname( svc_client, env, op_qname, payload); if ( NULL == ret_node ) { return NULL; } ret_val = axis2_registerClientResponse_create(env); axis2_registerClientResponse_deserialize(ret_val, env, ret_node ); return ret_val; }
AXIS2_EXTERN const axis2_char_t *AXIS2_CALL axis2_options_get_action( const axis2_options_t * options, const axutil_env_t * env) { const axis2_char_t *action = NULL; action = axis2_msg_info_headers_get_action(options->msg_info_headers, env); if(!action && options->parent) { return axis2_options_get_action(options->parent, env); } return action; }
void axis2_stub_ExchangeTrader_registerClient_start( axis2_stub_t *stub, const axutil_env_t *env, axis2_registerClientRequest_t* registerClientRequest14, axis2_status_t ( AXIS2_CALL *on_complete ) (struct axis2_callback *, const axutil_env_t *) , axis2_status_t ( AXIS2_CALL *on_error ) (struct axis2_callback *, const axutil_env_t *, int ) ) { axis2_callback_t *callback = NULL; axis2_svc_client_t *svc_client = NULL; axis2_options_t *options = NULL; const axis2_char_t *soap_action = NULL; axiom_node_t *payload = NULL; payload = axis2_registerClientRequest_serialize(registerClientRequest14, env, NULL, AXIS2_FALSE); options = axis2_stub_get_options( stub, env); if ( NULL == options ) { AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "options is null in stub: Error code:" " %d :: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return; } svc_client = axis2_stub_get_svc_client (stub, env ); soap_action =axis2_options_get_action ( options, env ); if ( NULL == soap_action ) { soap_action = "\"\""; axis2_options_set_action( options, env, soap_action ); } axis2_options_set_soap_version(options, env, AXIOM_SOAP11 ); callback = axis2_callback_create(env); /* Set our on_complete fucntion pointer to the callback object */ axis2_callback_set_on_complete(callback, on_complete); /* Set our on_error function pointer to the callback object */ axis2_callback_set_on_error(callback, on_error); /* Send request */ axis2_svc_client_send_receive_non_blocking(svc_client, env, payload, callback); }
/** * auto generated method signature for in only mep invocations * for "sell|http://www.wso2.org" operation. * @param sellRequest_ex17 * @param on_complete callback to handle on complete * @param on_error callback to handle on error */ axis2_status_t axis2_stub_ExchangeTrader_sell( axis2_stub_t *stub, const axutil_env_t *env , axis2_sellRequest_ex_t* sellRequest_ex17) { axis2_status_t status; axis2_svc_client_t *svc_client = NULL; axis2_options_t *options = NULL; const axis2_char_t *soap_action = NULL; axutil_qname_t *op_qname = NULL; axiom_node_t *payload = NULL; payload = axis2_sellRequest_ex_serialize(sellRequest_ex17, env, NULL, AXIS2_FALSE); options = axis2_stub_get_options( stub, env); if ( NULL == options ) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "options is null in stub: Error code:" " %d :: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return AXIS2_FAILURE; } svc_client = axis2_stub_get_svc_client (stub, env ); soap_action = axis2_options_get_action ( options, env ); if ( NULL == soap_action ) { soap_action = "\"\""; axis2_options_set_action( options, env, soap_action ); } axis2_options_set_soap_version(options, env, AXIOM_SOAP11 ); op_qname = axutil_qname_create(env, "sell" , "http://www.wso2.org", NULL); status = axis2_svc_client_send_robust_with_op_qname( svc_client, env, op_qname, payload); return status; }
AXIS2_EXTERN axis2_status_t AXIS2_CALL savan_client_unsubscribe( savan_client_t *client, const axutil_env_t *env, axis2_svc_client_t *svc_client) { axis2_options_t *wsa_options = NULL; const axis2_char_t *old_action = NULL; axiom_namespace_t *ns = NULL; axiom_node_t *reply = NULL; axiom_node_t *unsub_node = NULL; axiom_element_t *unsub_elem = NULL; axis2_status_t status = AXIS2_FAILURE; AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[savan] Entry:savan_client_unsubscribe"); /* set wsa action as Unsub. remember the old action */ wsa_options = (axis2_options_t*)axis2_svc_client_get_options(svc_client, env); old_action = axis2_options_get_action(wsa_options, env); axis2_options_set_action(wsa_options, env, SAVAN_ACTIONS_UNSUB); /* create the body of the Unsub request */ ns = axiom_namespace_create (env, EVENTING_NAMESPACE, EVENTING_NS_PREFIX); unsub_elem = axiom_element_create(env, NULL, ELEM_NAME_UNSUB, ns, &unsub_node); savan_client_add_sub_id_to_soap_header(client, env, svc_client); /* send the Unsub request and wait for the response */ reply = axis2_svc_client_send_receive(svc_client, env, unsub_node); /* reset the old action */ axis2_options_set_action(wsa_options, env, old_action); if (!reply) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[savan] Failed to send unsubscribe " "request. Error: %d Reason: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); status = AXIS2_FAILURE; } else status = AXIS2_SUCCESS; AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[savan] Exit:savan_client_unsubscribe"); return status; }
/** * auto generated method signature for asynchronous invocations * for "getEvents|http://esb.callbackservice.services.hdviper.psnc.pl/" operation. * * @param _getEvents * @param on_complete callback to handle on complete * @param on_error callback to handle on error */ void axis2_stub_start_op_CallbackServiceUserStubService_getEvents( axis2_stub_t *stub, const axutil_env_t *env, adb_getEvents3_t* _getEvents, void *user_data, axis2_status_t ( AXIS2_CALL *on_complete ) (const axutil_env_t *, adb_getEventsResponse0_t* _getEventsResponse, void *data) , axis2_status_t ( AXIS2_CALL *on_error ) (const axutil_env_t *, int exception, void *data) ) { axis2_callback_t *callback = NULL; axis2_svc_client_t *svc_client = NULL; axis2_options_t *options = NULL; const axis2_char_t *soap_action = NULL; axiom_node_t *payload = NULL; axis2_bool_t is_soap_act_set = AXIS2_TRUE; axutil_string_t *soap_act = NULL; struct axis2_stub_CallbackServiceUserStubService_getEvents_callback_data *callback_data; callback_data = (struct axis2_stub_CallbackServiceUserStubService_getEvents_callback_data*) AXIS2_MALLOC(env->allocator, sizeof(struct axis2_stub_CallbackServiceUserStubService_getEvents_callback_data)); if(NULL == callback_data) { AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "Can not allocate memeory for the callback data structures"); return; } payload = adb_getEvents3_serialize(_getEvents, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); options = axis2_stub_get_options( stub, env); if (NULL == options) { AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE); AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "options is null in stub"); return; } svc_client = axis2_stub_get_svc_client (stub, env); soap_action =axis2_options_get_action (options, env); if (NULL == soap_action) { is_soap_act_set = AXIS2_FALSE; soap_action = "\"\""; soap_act = axutil_string_create(env, "\"\""); axis2_options_set_soap_action(options, env, soap_act); axis2_options_set_action( options, env, soap_action); } axis2_options_set_soap_version(options, env, AXIOM_SOAP11); callback = axis2_callback_create(env); /* Set our on_complete fucntion pointer to the callback object */ axis2_callback_set_on_complete(callback, axis2_stub_on_complete_CallbackServiceUserStubService_getEvents); /* Set our on_error function pointer to the callback object */ axis2_callback_set_on_error(callback, axis2_stub_on_error_CallbackServiceUserStubService_getEvents); callback_data-> data = user_data; callback_data-> on_complete = on_complete; callback_data-> on_error = on_error; axis2_callback_set_data(callback, (void*)callback_data); /* Send request */ axis2_svc_client_send_receive_non_blocking(svc_client, env, payload, callback); if (!is_soap_act_set) { axis2_options_set_soap_action(options, env, NULL); axis2_options_set_action(options, env, NULL); } }
/** * auto generated method signature * for "getEvents|http://esb.callbackservice.services.hdviper.psnc.pl/" operation. * * @param _getEvents * * @return adb_getEventsResponse0_t* */ adb_getEventsResponse0_t* axis2_stub_op_CallbackServiceUserStubService_getEvents( axis2_stub_t *stub, const axutil_env_t *env, adb_getEvents3_t* _getEvents) { axis2_svc_client_t *svc_client = NULL; axis2_options_t *options = NULL; axiom_node_t *ret_node = NULL; const axis2_char_t *soap_action = NULL; axutil_qname_t *op_qname = NULL; axiom_node_t *payload = NULL; axis2_bool_t is_soap_act_set = AXIS2_TRUE; axutil_string_t *soap_act = NULL; adb_getEventsResponse0_t* ret_val = NULL; payload = adb_getEvents3_serialize(_getEvents, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); svc_client = axis2_stub_get_svc_client(stub, env ); options = axis2_stub_get_options( stub, env); if (NULL == options) { AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE); AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "options is null in stub"); return NULL; } soap_action = axis2_options_get_action( options, env ); if (NULL == soap_action) { is_soap_act_set = AXIS2_FALSE; soap_action = "\"\""; soap_act = axutil_string_create(env, "\"\""); axis2_options_set_soap_action(options, env, soap_act); axis2_options_set_action( options, env, soap_action ); } axis2_options_set_soap_version(options, env, AXIOM_SOAP11 ); ret_node = axis2_svc_client_send_receive_with_op_qname( svc_client, env, op_qname, payload); if (!is_soap_act_set) { axis2_options_set_soap_action(options, env, NULL); axis2_options_set_action( options, env, NULL); } if ( NULL == ret_node ) { return NULL; } ret_val = adb_getEventsResponse0_create(env); if(adb_getEventsResponse0_deserialize(ret_val, env, &ret_node, NULL, AXIS2_FALSE ) == AXIS2_FAILURE) { if(ret_val != NULL) { adb_getEventsResponse0_free(ret_val, env); } AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the getEventsResponse0_deserialize: " "This should be due to an invalid XML"); return NULL; } return ret_val; }
AXIS2_EXTERN axis2_status_t AXIS2_CALL savan_client_subscribe( savan_client_t *client, const axutil_env_t *env, axis2_svc_client_t *svc_client, axutil_hash_t *options) { axis2_options_t *wsa_options = NULL; const axis2_char_t *old_action = NULL; axiom_node_t *reply = NULL; axiom_node_t *sub_node = NULL; axiom_element_t *body_elem = NULL; axis2_char_t *sub_id = NULL; axis2_char_t *sub_url = NULL; axis2_char_t *sub_elem_local_name = NULL; savan_subscriber_t *subscriber = NULL; /*axis2_char_t *endto = NULL;*/ axis2_char_t *notify = NULL; axis2_char_t *filter = NULL; axis2_char_t *filter_dialect = NULL; axis2_char_t *expires = NULL; axis2_status_t status = AXIS2_SUCCESS; axis2_endpoint_ref_t *endpoint_ref = NULL; AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[savan] Entry:savan_client_subscribe"); /* set wsa action as Subscribe. remember the old action */ wsa_options = (axis2_options_t*)axis2_svc_client_get_options(svc_client, env); old_action = axis2_options_get_action(wsa_options, env); axis2_options_set_action(wsa_options, env, SAVAN_ACTIONS_SUB); /* extract the values from the options map */ /* endto endpoint reference is used by the event source to send a subscription end message. Default is not * to send this message by the event source. How this should be provided by the client? */ /*endto = axutil_hash_get(options, SAVAN_OP_KEY_ENDTO_EPR, AXIS2_HASH_KEY_STRING);*/ notify = axutil_hash_get(options, SAVAN_OP_KEY_NOTIFY_EPR, AXIS2_HASH_KEY_STRING); filter = axutil_hash_get(options, SAVAN_OP_KEY_FILTER, AXIS2_HASH_KEY_STRING); filter_dialect = axutil_hash_get(options, SAVAN_OP_KEY_FILTER_DIALECT, AXIS2_HASH_KEY_STRING); expires = axutil_hash_get(options, SAVAN_OP_KEY_EXPIRES, AXIS2_HASH_KEY_STRING); subscriber = savan_subscriber_create(env); /*endpoint_ref = axis2_endpoint_ref_create(env, endto); savan_subscriber_set_end_to(subscriber, env, endpoint_ref);*/ endpoint_ref = axis2_endpoint_ref_create(env, notify); savan_subscriber_set_notify_to(subscriber, env, endpoint_ref); savan_subscriber_set_filter(subscriber, env, filter); savan_subscriber_set_filter_dialect(subscriber, env, filter_dialect); if(expires) { savan_subscriber_set_expires(subscriber, env, expires); } /* Create the Subscriber node */ sub_node = savan_util_create_subscriber_node(env, subscriber, NULL); if(!sub_node) { status = axutil_error_get_status_code(env->error); savan_subscriber_free(subscriber, env); AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[savan] Could not create the subscriber node"); return status; } /* send the Subscription and wait for the response */ reply = axis2_svc_client_send_receive(svc_client, env, sub_node); /* reset the old action */ axis2_options_set_action(wsa_options, env, old_action); if (!reply) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[savan] Failed to send subscription request. Error: %d Reason: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return AXIS2_FAILURE; } /* Extract the subscription id from the response and store for future * requests */ /* Get Body element from body node */ body_elem = (axiom_element_t*)axiom_node_get_data_element(reply, env); /* Check whether we have received a SubscribeResponse */ sub_elem_local_name = axiom_element_get_localname(body_elem, env); if (axutil_strcmp(ELEM_NAME_SUB_RESPONSE, sub_elem_local_name)) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[savan] Subscription failed"); return AXIS2_FAILURE; } sub_id = savan_client_get_sub_id_from_response(body_elem, reply, env); AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "sub_id3:%s", sub_id); client->sub_id = axutil_strdup(env, sub_id); sub_url = savan_client_get_sub_url_from_response(body_elem, reply, env); client->sub_url = axutil_strdup(env, sub_url); AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[savan] Exit:savan_client_subscribe"); return AXIS2_SUCCESS; }
AXIS2_EXTERN axis2_char_t * AXIS2_CALL savan_client_get_status( savan_client_t *client, const axutil_env_t *env, axis2_svc_client_t *svc_client) { axis2_options_t *wsa_options = NULL; const axis2_char_t *old_action = NULL; axutil_qname_t *qname = NULL; axiom_namespace_t *ns = NULL; axiom_node_t *reply = NULL; axiom_node_t *status_node = NULL; axiom_node_t *expires_node = NULL; axiom_element_t *status_elem = NULL; axiom_element_t *expires_elem = NULL; axis2_char_t *expires = NULL; axis2_char_t *status_elem_localname = NULL; AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[savan] Entry:savan_client_get_status"); /* Set wsa action as GetStatus. remember the old action */ wsa_options = (axis2_options_t*)axis2_svc_client_get_options(svc_client, env); old_action = axis2_options_get_action(wsa_options, env); axis2_options_set_action(wsa_options, env, SAVAN_ACTIONS_GET_STATUS); /* Create the body of the GetStatus request */ ns = axiom_namespace_create (env, EVENTING_NAMESPACE, EVENTING_NS_PREFIX); status_elem = axiom_element_create(env, NULL, ELEM_NAME_GETSTATUS, ns, &status_node); savan_client_add_sub_id_to_soap_header(client, env, svc_client); /* Send the GetStatus request and wait for the response */ reply = axis2_svc_client_send_receive(svc_client, env, status_node); /* Reset the old action */ axis2_options_set_action(wsa_options, env, old_action); if (!reply) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[savan] Failed to send get status " "request. Error: %d Reason: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return NULL; } status_elem = (axiom_element_t*)axiom_node_get_data_element(reply, env); /* Check whether we have received a GetStatusResponse */ status_elem_localname = axiom_element_get_localname(status_elem, env); if (axutil_strcmp(ELEM_NAME_GETSTATUS_RESPONSE, status_elem_localname)) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[savan] Failed to retrieve GetStatusResponse"\ "element. Error: %d Reason: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return NULL; } /* Now read Expires sub element */ qname = axutil_qname_create(env, ELEM_NAME_EXPIRES, EVENTING_NAMESPACE, NULL); expires_elem = axiom_element_get_first_child_with_qname(status_elem, env, qname, reply, &expires_node); axutil_qname_free(qname, env); if(!expires_node) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[savan] Failed to retrieve Expires"\ "element. Error: %d Reason: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return NULL; } expires_elem = (axiom_element_t *) axiom_node_get_data_element(expires_node, env); expires = axiom_element_get_text(expires_elem, env, expires_node); AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[savan] Exit:savan_client_get_status"); return expires; }
AXIS2_EXTERN axis2_char_t *AXIS2_CALL savan_client_renew( savan_client_t *client, const axutil_env_t *env, axis2_svc_client_t *svc_client, axutil_hash_t *options) { axis2_options_t *wsa_options = NULL; const axis2_char_t *old_action = NULL; axiom_namespace_t *ns = NULL; axiom_node_t *reply = NULL; axiom_node_t *renew_node = NULL; axiom_node_t *expires_node = NULL; axiom_element_t *renew_elem = NULL; axiom_element_t *expires_elem = NULL; axis2_char_t *expires = NULL; axis2_char_t *renew_elem_localname = NULL; axutil_qname_t *qname = NULL; AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[savan] Entry:savan_client_renew"); /* Set wsa action as Renew. remember the old action */ wsa_options = (axis2_options_t*)axis2_svc_client_get_options(svc_client, env); old_action = axis2_options_get_action(wsa_options, env); axis2_options_set_action(wsa_options, env, SAVAN_ACTIONS_RENEW); /* Create the body of the Renew request */ ns = axiom_namespace_create (env, EVENTING_NAMESPACE, EVENTING_NS_PREFIX); renew_elem = axiom_element_create(env, NULL, ELEM_NAME_RENEW, ns, &renew_node); /* Extract the values from the options map */ expires = axutil_hash_get(options, SAVAN_OP_KEY_EXPIRES, AXIS2_HASH_KEY_STRING); if(expires) { /* Expires element */ expires_elem = axiom_element_create(env, renew_node, ELEM_NAME_EXPIRES, ns, &expires_node); axiom_element_set_text(expires_elem, env, expires, expires_node); } savan_client_add_sub_id_to_soap_header(client, env, svc_client); /* send the Renew request and wait for the response */ reply = axis2_svc_client_send_receive(svc_client, env, renew_node); /* reset the old action */ axis2_options_set_action(wsa_options, env, old_action); if (!reply) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[savan] Failed to send renew request. Error: %d Reason: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return NULL; } renew_elem = (axiom_element_t*)axiom_node_get_data_element(reply, env); /* Check whether we have received a RenewResponse */ renew_elem_localname = axiom_element_get_localname(renew_elem, env); if (axutil_strcmp(ELEM_NAME_RENEW_RESPONSE, renew_elem_localname)) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[savan] Failed to retrieve RenewResponse"\ "element. Error: %d Reason: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return NULL; } /* Get Expires element from RenewResponse element */ qname = axutil_qname_create(env, ELEM_NAME_EXPIRES, EVENTING_NAMESPACE, NULL); expires_elem = axiom_element_get_first_child_with_qname(renew_elem, env, qname, reply, &expires_node); axutil_qname_free(qname, env); if(!expires_node) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[savan] Failed to retrieve Expires"\ "element. Error: %d Reason: %s", env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error)); return NULL; } expires = axiom_element_get_text(expires_elem, env, expires_node); AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[savan] Exit:savan_client_renew"); return expires; }