AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_options_set_msg_info_headers( axis2_options_t * options, const axutil_env_t * env, axis2_msg_info_headers_t * msg_info_headers) { if(options->msg_info_headers) { axis2_msg_info_headers_free(options->msg_info_headers, env); } options->msg_info_headers = msg_info_headers; return AXIS2_SUCCESS; }
AXIS2_EXTERN axis2_msg_info_headers_t *AXIS2_CALL axis2_msg_info_headers_create( const axutil_env_t * env, axis2_endpoint_ref_t * to, const axis2_char_t * action) { axis2_msg_info_headers_t *msg_info_headers = NULL; msg_info_headers = AXIS2_MALLOC(env->allocator, sizeof(axis2_msg_info_headers_t)); if(!msg_info_headers) { AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); return NULL; } msg_info_headers->to = NULL; msg_info_headers->from = NULL; msg_info_headers->relates_to = NULL; msg_info_headers->reply_to_none = AXIS2_FALSE; msg_info_headers->reply_to_anonymous = AXIS2_FALSE; msg_info_headers->reply_to = NULL; msg_info_headers->fault_to_none = AXIS2_FALSE; msg_info_headers->fault_to_anonymous = AXIS2_FALSE; msg_info_headers->fault_to = NULL; msg_info_headers->action = NULL; msg_info_headers->message_id = NULL; msg_info_headers->ref_params = NULL; if(to) { msg_info_headers->to = to; } if(action) { msg_info_headers->action = axutil_strdup(env, action); if(!(msg_info_headers->action)) { AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); axis2_msg_info_headers_free(msg_info_headers, env); return NULL; } } return msg_info_headers; }
AXIS2_EXTERN void AXIS2_CALL axis2_options_free( axis2_options_t * options, const axutil_env_t * env) { if (options->properties) { axutil_hash_index_t *hi = NULL; void *val = NULL; const void *key = NULL; for (hi = axutil_hash_first(options->properties, env); hi; hi = axutil_hash_next(env, hi)) { axutil_property_t *property = NULL; axutil_hash_this(hi, &key, NULL, &val); property = (axutil_property_t *) val; if (property) { axutil_property_free(property, env); } } axutil_hash_free(options->properties, env); } if (options->soap_version_uri) { AXIS2_FREE(env->allocator, options->soap_version_uri); } if (options->msg_info_headers) { axis2_msg_info_headers_free(options->msg_info_headers, env); } if (options->soap_action) { axutil_string_free(options->soap_action, env); } AXIS2_FREE(env->allocator, options); }