org.apache.axis2.wsdl.template.c.StubSourceTemplate.xsl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of axis2-codegen Show documentation
Show all versions of axis2-codegen Show documentation
Axis2 Code Generation module
/**
* .c
*
* This file was auto-generated from WSDL for " " service
* by the Apache Axis2/Java version: #axisVersion# #today#
*/
#include " .h"
#include <axis2_msg.h>
#include <axis2_policy_include.h>
#include <neethi_engine.h>
/**
* C implementation
*/
axis2_stub_t* AXIS2_CALL
axis2_stub_create_ (const axutil_env_t *env,
const axis2_char_t *client_home,
const axis2_char_t *endpoint_uri)
{
axis2_stub_t *stub = NULL;
axis2_endpoint_ref_t *endpoint_ref = NULL;
AXIS2_FUNC_PARAM_CHECK (client_home, env, NULL)
if (NULL == endpoint_uri)
{
endpoint_uri = axis2_stub_get_endpoint_uri_of_ (env);
}
endpoint_ref = axis2_endpoint_ref_create(env, endpoint_uri);
stub = axis2_stub_create_with_endpoint_ref_and_client_home (env, endpoint_ref, client_home);
if (NULL == stub)
{
if(NULL != endpoint_ref)
{
axis2_endpoint_ref_free(endpoint_ref, env);
}
return NULL;
}
axis2_stub_populate_services_for_ (stub, env);
return stub;
}
void AXIS2_CALL
axis2_stub_populate_services_for_ (axis2_stub_t *stub, const axutil_env_t *env)
{
axis2_svc_client_t *svc_client = NULL;
axutil_qname_t *svc_qname = NULL;
axutil_qname_t *op_qname = NULL;
axis2_svc_t *svc = NULL;
axis2_op_t *op = NULL;
axis2_op_t *annon_op = NULL;
axis2_msg_t *msg_out = NULL;
axis2_msg_t *msg_in = NULL;
axis2_msg_t *msg_out_fault = NULL;
axis2_msg_t *msg_in_fault = NULL;
axis2_policy_include_t *policy_include = NULL;
axis2_desc_t *desc = NULL;
axiom_node_t *policy_node = NULL;
axiom_element_t *policy_root_ele = NULL;
neethi_policy_t *neethi_policy = NULL;
axis2_status_t status;
/* Modifying the Service */
svc_client = axis2_stub_get_svc_client (stub, env );
svc = (axis2_svc_t*)axis2_svc_client_get_svc( svc_client, env );
annon_op = axis2_svc_get_op_with_name(svc, env, AXIS2_ANON_OUT_IN_OP);
msg_out = axis2_op_get_msg(annon_op, env, AXIS2_MSG_OUT);
msg_in = axis2_op_get_msg(annon_op, env, AXIS2_MSG_IN);
msg_out_fault = axis2_op_get_msg(annon_op, env, AXIS2_MSG_OUT_FAULT);
msg_in_fault = axis2_op_get_msg(annon_op, env, AXIS2_MSG_IN_FAULT);
svc_qname = axutil_qname_create(env," " ,NULL, NULL);
axis2_svc_set_qname (svc, env, svc_qname);
axutil_qname_free(svc_qname,env);
/* creating the operations*/
op_qname = axutil_qname_create(env,
" " ,
" ",
NULL);
op = axis2_op_create_with_qname(env, op_qname);
axis2_op_set_msg_exchange_pattern(op, env, AXIS2_MEP_URI_OUT_ONLY);
axis2_op_set_msg_exchange_pattern(op, env, AXIS2_MEP_URI_OUT_IN);
axis2_msg_increment_ref(msg_out, env);
axis2_msg_increment_ref(msg_in, env);
axis2_msg_increment_ref(msg_out_fault, env);
axis2_msg_increment_ref(msg_in_fault, env);
axis2_op_add_msg(op, env, AXIS2_MSG_OUT, msg_out);
axis2_op_add_msg(op, env, AXIS2_MSG_IN, msg_in);
axis2_op_add_msg(op, env, AXIS2_MSG_OUT_FAULT, msg_out_fault);
axis2_op_add_msg(op, env, AXIS2_MSG_IN_FAULT, msg_in_fault);
/* adding the input policies */
policy_node = axiom_node_create_from_buffer(env, " ");
policy_root_ele = (axiom_element_t *) axiom_node_get_data_element (policy_node, env);
neethi_policy = neethi_engine_get_policy (env, policy_node, policy_root_ele);
status = axis2_svc_client_set_policy(svc_client, env, neethi_policy);
if(status == AXIS2_FAILURE)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "neethi policy setting failed");
return;
}
axis2_svc_add_op(svc, env, op);
}
/**
*return end point picked from wsdl
*/
axis2_char_t* AXIS2_CALL
axis2_stub_get_endpoint_uri_of_ ( const axutil_env_t *env )
{
axis2_char_t *endpoint_uri = NULL;
/* set the address from here */
endpoint_uri = " ";
return endpoint_uri;
}
/**
* auto generated method signature
* for " " operation.
* @param stub The stub (axis2_stub_t)
* @param env environment ( mandatory)
* @param _ of the
* @param _ of the
*
* @param dp_ - output header
* @return
*/
,
_
,
_
void AXIS2_CALL
AXIS2_CALL
axis2_stub_op_ _( axis2_stub_t *stub, const axutil_env_t *env
,
*
dp_ /* output header double ptr*/
)
{
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;
ret_val;
axiom_node_t *input_header = NULL;
axis2_op_client_t *op_client = NULL;
const axis2_msg_ctx_t *msg_ctx = NULL;
axiom_soap_envelope_t *res_soap_env = NULL;
axiom_soap_header_t *res_soap_header = NULL;
axiom_node_t *header_base_node = NULL;
axiom_node_t *output_header = NULL;
_ = NULL;
{
wrapper_adb_obj
= _create_with_values(env
,
_create_with_values(env
,
_
) );
payload = _serialize( , env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
}
payload = _serialize(_ , env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
payload = _ ;
svc_client = axis2_stub_get_svc_client(stub, env );
{
wrapper_adb_obj
= _create_with_values(env
,
_create_with_values(env
,
_
) );
input_header = _serialize( , env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
}
input_header = _serialize(_ , env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
input_header = _ ;
axis2_svc_client_add_header(svc_client, env, input_header);
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_act = axis2_options_get_soap_action( options, env );
if (NULL == soap_act)
{
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_soap_version(options, env, AXIOM_SOAP12);
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(soap_act)
{
axutil_string_free(soap_act, env);
}
op_client = axis2_svc_client_get_op_client(svc_client, env);
if(!op_client)
{
AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "op client is NULL");
return ( )NULL;
}
msg_ctx = axis2_op_client_get_msg_ctx(op_client, env, AXIS2_WSDL_MESSAGE_LABEL_OUT);
if(!msg_ctx)
{
AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "response msg ctx is NULL");
return ( )NULL;
}
res_soap_env = axis2_msg_ctx_get_response_soap_envelope(msg_ctx, env);
if(!res_soap_env)
{
AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "response evelope is NULL");
return ( )NULL;
}
res_soap_header = axiom_soap_envelope_get_header(res_soap_env, env);
if(res_soap_header)
{
header_base_node = axiom_soap_header_get_base_node(res_soap_header, env);
}
if(!header_base_node)
{
AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "Required response header is NULL");
}
output_header = axiom_node_get_first_child(header_base_node, env);
while(output_header && axiom_node_get_node_type(output_header, env) != AXIOM_ELEMENT)
{
output_header = axiom_node_get_next_sibling(output_header, env);
}
output_header = axiom_node_get_next_sibling(output_header, env);
while(output_header && axiom_node_get_node_type(output_header, env) != AXIOM_ELEMENT)
{
output_header = axiom_node_get_next_sibling(output_header, env);
}
_
if( NULL == output_header)
{
AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "Response header is NULL");
/* you can't have a response header NULL, just free things and exit */
axis2_stub_op_ _ _free_output_headers(env, ,
_
);
return;
return ( )NULL;
}
/* you can have these parameters NULL, to avoid deserializing them */
if(dp_ )
{
= _create(env);
if( _deserialize( , env, &output_header, NULL, AXIS2_FALSE ) == AXIS2_FAILURE)
{
AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the _deserialize: "
"This should be due to an invalid output header");
axis2_stub_op_ _ _free_output_headers(env, ,
_
);
return;
return ( )NULL;
}
_ = input_header;
*dp_ = _ ;
}
return;
if ( NULL == ret_node )
{
return ( )NULL;
}
ret_val = _create(env);
if( _deserialize(ret_val, env, &ret_node, NULL, AXIS2_FALSE ) == AXIS2_FAILURE)
{
if(ret_val != NULL)
{
_free(ret_val, env);
}
AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the _deserialize: "
"This should be due to an invalid XML");
return ( )NULL;
}
return
_free_popping_value(
_free_popping_value(ret_val, env), env) ;
return ret_val;
return ret_node;
}
,
_
,
_
struct axis2_stub_ _ _callback_data
{
void *data;
axis2_status_t ( AXIS2_CALL *on_complete ) (const axutil_env_t *, _ ,
, void *data);
axis2_status_t ( AXIS2_CALL *on_error ) (const axutil_env_t *, int exception, void *data);
};
static axis2_status_t AXIS2_CALL axis2_stub_on_error_ _ (axis2_callback_t *callback, const axutil_env_t *env, int exception)
{
axis2_status_t ( AXIS2_CALL *on_error ) (const axutil_env_t *, int, void *data);
struct axis2_stub_ _ _callback_data* callback_data = NULL;
void *user_data = NULL;
axis2_status_t status;
callback_data = (struct axis2_stub_ _ _callback_data*)axis2_callback_get_data(callback);
user_data = callback_data->data;
on_error = callback_data->on_error;
status = on_error(env, exception, user_data);
if(callback_data)
{
AXIS2_FREE(env->allocator, callback_data);
}
return status;
}
axis2_status_t AXIS2_CALL axis2_stub_on_complete_ _ (axis2_callback_t *callback, const axutil_env_t *env)
{
axis2_status_t ( AXIS2_CALL *on_complete ) (const axutil_env_t *, _ ,
, void *data);
struct axis2_stub_ _ _callback_data* callback_data = NULL;
void *user_data = NULL;
axis2_status_t status = AXIS2_SUCCESS;
ret_val;
axiom_node_t *ret_node = NULL;
axiom_soap_envelope_t *soap_envelope = NULL;
axiom_soap_header_t *res_soap_header = NULL;
axiom_node_t *header_base_node = NULL;
axiom_node_t *output_header = NULL;
_ = NULL;
callback_data = (struct axis2_stub_ _ _callback_data*)axis2_callback_get_data(callback);
soap_envelope = axis2_callback_get_envelope(callback, env);
if(soap_envelope)
{
axiom_soap_body_t *soap_body;
soap_body = axiom_soap_envelope_get_body(soap_envelope, env);
if(soap_body)
{
axiom_node_t *body_node = axiom_soap_body_get_base_node(soap_body, env);
if(body_node)
{
ret_node = axiom_node_get_first_child(body_node, env);
}
}
res_soap_header = axiom_soap_envelope_get_header(soap_envelope, env);
if(res_soap_header)
{
header_base_node = axiom_soap_header_get_base_node(res_soap_header, env);
}
if(!header_base_node)
{
AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "Required response header is NULL");
}
if(header_base_node)
{
if(status == AXIS2_SUCCESS)
{
output_header = axiom_node_get_first_child(header_base_node, env);
while(output_header && axiom_node_get_node_type(output_header, env) != AXIOM_ELEMENT)
{
output_header = axiom_node_get_next_sibling(output_header, env);
}
output_header = axiom_node_get_next_sibling(output_header, env);
while(output_header && axiom_node_get_node_type(output_header, env) != AXIOM_ELEMENT)
{
output_header = axiom_node_get_next_sibling(output_header, env);
}
_
if( NULL == output_header)
{
AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "Response header is NULL");
/* you can't have a response header NULL, just free things and exit */
axis2_stub_op_ _ _free_output_headers(env, ,
_
);
status = AXIS2_FAILURE;
}
else
{
= _create(env);
if( _deserialize( , env, &output_header, NULL, AXIS2_FALSE ) == AXIS2_FAILURE)
{
AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the _deserialize: "
"This should be due to an invalid output header");
axis2_stub_op_ _ _free_output_headers(env, ,
_
);
status = AXIS2_FAILURE;
}
_ = output_header;
}
}
if(status == AXIS2_FAILURE)
{
_ = NULL;
}
}
}
user_data = callback_data->data;
on_complete = callback_data->on_complete;
if(ret_node != NULL)
{
ret_val = _create(env);
if( _deserialize(ret_val, env, &ret_node, NULL, AXIS2_FALSE ) == AXIS2_FAILURE)
{
AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the LendResponse_deserialize: "
"This should be due to an invalid XML");
_free(ret_val, env);
ret_val = NULL;
}
}
else
{
ret_val = NULL;
}
if(ret_val == NULL) {
status = on_complete(env, ( )NULL,
_
, user_data);
}
else {
status = on_complete(env,
_free_popping_value(
_free_popping_value(ret_val, env), env) ,
_
, user_data);
}
status = on_complete(env, ret_val,
_
, user_data);
status = on_complete(env, ret_node,
_
, user_data);
if(callback_data)
{
AXIS2_FREE(env->allocator, callback_data);
}
return status;
}
/**
* auto generated method signature for asynchronous invocations
* for "" operation.
* @param stub The stub
* @param env environment ( mandatory)
* @param _ of the
* @param _ of the
* @param user_data user data to be accessed by the callbacks
* @param on_complete callback to handle on complete
* @param on_error callback to handle on error
*/
void AXIS2_CALL
axis2_stub_start_op_ _ ( axis2_stub_t *stub, const axutil_env_t *env ,
void *user_data,
axis2_status_t ( AXIS2_CALL *on_complete ) (const axutil_env_t *, _ ,
, 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;
axiom_node_t *input_header = NULL;
struct axis2_stub_ _ _callback_data *callback_data;
callback_data = (struct axis2_stub_ _ _callback_data*) AXIS2_MALLOC(env->allocator,
sizeof(struct axis2_stub_ _ _callback_data));
if(NULL == callback_data)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "Can not allocate memeory for the callback data structures");
return;
}
{
wrapper_adb_obj
= _create_with_values(env
,
_create_with_values(env
,
_
) );
payload = _serialize( , env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
}
payload = _serialize(_ , env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
payload = _ ;
svc_client = axis2_stub_get_svc_client(stub, env );
{
wrapper_adb_obj
= _create_with_values(env
,
_create_with_values(env
,
_
) );
input_header = _serialize( , env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
}
input_header = _serialize(_ , env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
input_header = _ ;
axis2_svc_client_add_header(svc_client, env, input_header);
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;
}
soap_act =axis2_options_get_soap_action (options, env);
if (NULL == soap_act)
{
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_soap_version(options, env, AXIOM_SOAP12);
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_ _ );
/* Set our on_error function pointer to the callback object */
axis2_callback_set_on_error(callback, axis2_stub_on_error_ _ );
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 in only mep invocations
* for " " operation.
* @param stub The stub (axis2_stub_t)
* @param env environment ( mandatory)
* @param _ of the
* @param _ of the
*
* @param dp_ - output header
* @return
*/
axis2_status_t AXIS2_CALL
axis2_stub_op_ _( axis2_stub_t *stub, const axutil_env_t *env
)
{
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;
axutil_string_t *soap_act = NULL;
axiom_node_t *input_header = NULL;
{
wrapper_adb_obj
_t * = _create_with_values(env
,
_create_with_values(env
,
_
) );
payload = _serialize( , env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
}
payload = _serialize(_ , env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
payload = _ ;
svc_client = axis2_stub_get_svc_client(stub, env );
{
wrapper_adb_obj
= _create_with_values(env
,
_create_with_values(env
,
_
) );
input_header = _serialize( , env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
}
input_header = _serialize(_ , env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
input_header = _ ;
axis2_svc_client_add_header(svc_client, env, input_header);
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 AXIS2_FAILURE;
}
svc_client = axis2_stub_get_svc_client (stub, env );
soap_act = axis2_options_get_soap_action ( options, env );
if ( NULL == soap_act )
{
soap_action = " ";
soap_act = axutil_string_create(env, " ");
axis2_options_set_soap_action(options, env, soap_act);
}
axis2_options_set_soap_version(options, env, AXIOM_SOAP12 );
axis2_options_set_soap_version(options, env, AXIOM_SOAP11 );
op_qname = axutil_qname_create(env,
" " ,
" ",
NULL);
status = axis2_svc_client_send_robust_with_op_qname( svc_client, env, op_qname, payload);
return status;
}
/**
* function to free any soap input headers
*/
void AXIS2_CALL
axis2_stub_op_ _ _free_input_headers(const axutil_env_t *env, ,
_
)
{
_
if( )
{
_free( , env);
}
/* we don't have anything to free on */
}
/**
* function to free any soap output headers
*/
void AXIS2_CALL
axis2_stub_op_ _ _free_output_headers(const axutil_env_t *env, ,
_
)
{
_
if( )
{
_free( , env);
}
/* we don't have anything to free on */
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy