You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2007/01/16 03:09:51 UTC
svn commit: r496572 [5/5] - in /webservices/axis2/trunk/c: axiom/include/
axiom/src/soap/ util/include/
Modified: webservices/axis2/trunk/c/axiom/src/soap/soap_fault_sub_code.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/soap/soap_fault_sub_code.c?view=diff&rev=496572&r1=496571&r2=496572
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/soap/soap_fault_sub_code.c (original)
+++ webservices/axis2/trunk/c/axiom/src/soap/soap_fault_sub_code.c Mon Jan 15 18:09:50 2007
@@ -19,11 +19,9 @@
#include "_axiom_soap_fault_code.h"
#include <axiom_soap_fault_value.h>
#include <axiom_soap_builder.h>
-/********************** impl struct ******************************************/
-typedef struct axiom_soap_fault_sub_code_impl_t
+struct axiom_soap_fault_sub_code
{
- axiom_soap_fault_sub_code_t fault_sub_code;
/* corresponding om element node */
axiom_node_t *om_ele_node;
/* sub element fault value */
@@ -34,91 +32,34 @@
axiom_soap_builder_t *builder;
int soap_version;
-
-}
-axiom_soap_fault_sub_code_impl_t;
-
-/************************* Macro *********************************************/
-
-#define AXIS2_INTF_TO_IMPL(subcode) \
- ((axiom_soap_fault_sub_code_impl_t*)subcode)
-
-/******************** function prototypes *************************************/
-
-axis2_status_t AXIS2_CALL
-axiom_soap_fault_sub_code_free(axiom_soap_fault_sub_code_t *fault_sub_code,
- const axis2_env_t *env);
-
-
-
-axiom_soap_fault_value_t* AXIS2_CALL
-axiom_soap_fault_sub_code_get_value
-(axiom_soap_fault_sub_code_t *fault_sub_code,
- const axis2_env_t *env);
-
-
-axiom_soap_fault_sub_code_t* AXIS2_CALL
-axiom_soap_fault_sub_code_get_sub_code(
- axiom_soap_fault_sub_code_t *fault_sub_code,
- const axis2_env_t *env);
-
-axiom_node_t* AXIS2_CALL
-axiom_soap_fault_sub_code_get_base_node
-(axiom_soap_fault_sub_code_t *fault_sub_code,
- const axis2_env_t *env);
-
-/********************** function implementations ******************************/
+};
AXIS2_EXTERN axiom_soap_fault_sub_code_t * AXIS2_CALL
axiom_soap_fault_sub_code_create(const axis2_env_t *env)
{
- axiom_soap_fault_sub_code_impl_t *fault_subcode_impl = NULL;
+ axiom_soap_fault_sub_code_t *fault_sub_code = NULL;
AXIS2_ENV_CHECK(env, NULL);
- fault_subcode_impl = (axiom_soap_fault_sub_code_impl_t*) AXIS2_MALLOC(
+ fault_sub_code = (axiom_soap_fault_sub_code_t*) AXIS2_MALLOC(
env->allocator,
- sizeof(axiom_soap_fault_sub_code_impl_t));
- if (!fault_subcode_impl)
- {
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
-
- fault_subcode_impl->fault_sub_code.ops = NULL;
- fault_subcode_impl->om_ele_node = NULL;
- fault_subcode_impl->value = NULL;
- fault_subcode_impl->subcode = NULL;
- fault_subcode_impl->builder = NULL;
-
- fault_subcode_impl->fault_sub_code.ops =
- (axiom_soap_fault_sub_code_ops_t*)AXIS2_MALLOC(env->allocator,
- sizeof(axiom_soap_fault_sub_code_ops_t));
-
- if (!(fault_subcode_impl->fault_sub_code.ops))
+ sizeof(axiom_soap_fault_sub_code_t));
+ if (!fault_sub_code)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- AXIS2_FREE(env->allocator, fault_subcode_impl);
return NULL;
}
- fault_subcode_impl->fault_sub_code.ops->free_fn =
- axiom_soap_fault_sub_code_free;
-
- fault_subcode_impl->fault_sub_code.ops->get_sub_code =
- axiom_soap_fault_sub_code_get_sub_code;
- fault_subcode_impl->fault_sub_code.ops->get_value =
- axiom_soap_fault_sub_code_get_value;
+ fault_sub_code->om_ele_node = NULL;
+ fault_sub_code->value = NULL;
+ fault_sub_code->subcode = NULL;
+ fault_sub_code->builder = NULL;
- fault_subcode_impl->fault_sub_code.ops->get_base_node =
- axiom_soap_fault_sub_code_get_base_node;
-
- return &(fault_subcode_impl->fault_sub_code);
+ return fault_sub_code;
}
AXIS2_EXTERN axiom_soap_fault_sub_code_t * AXIS2_CALL
axiom_soap_fault_sub_code_create_with_parent(const axis2_env_t *env,
axiom_soap_fault_code_t *fault_code)
{
- axiom_soap_fault_sub_code_impl_t *fault_sub_code_impl = NULL;
axiom_soap_fault_sub_code_t *fault_sub_code = NULL;
axiom_element_t *this_ele = NULL;
axiom_node_t *this_node = NULL;
@@ -133,8 +74,6 @@
if (!fault_sub_code)
return NULL;
- fault_sub_code_impl = AXIS2_INTF_TO_IMPL(fault_sub_code);
-
parent_node = AXIOM_SOAP_FAULT_CODE_GET_BASE_NODE(fault_code, env);
if (!parent_node)
{
@@ -149,10 +88,10 @@
AXIOM_SOAP_FAULT_SUB_CODE_FREE(fault_sub_code, env);
return NULL;
}
- fault_sub_code_impl->soap_version =
+ fault_sub_code->soap_version =
axiom_soap_fault_code_get_soap_version(fault_code, env);
- if (fault_sub_code_impl->soap_version == AXIOM_SOAP12)
+ if (fault_sub_code->soap_version == AXIOM_SOAP12)
{
parent_ns = AXIOM_ELEMENT_GET_NAMESPACE(parent_ele, env, parent_node);
}
@@ -167,11 +106,11 @@
return NULL;
}
- fault_sub_code_impl->om_ele_node = this_node;
+ fault_sub_code->om_ele_node = this_node;
axiom_soap_fault_code_set_sub_code(fault_code, env, fault_sub_code);
- return &(fault_sub_code_impl->fault_sub_code);
+ return fault_sub_code;
}
AXIS2_EXTERN axiom_soap_fault_sub_code_t * AXIS2_CALL
@@ -201,52 +140,40 @@
return fault_sub_code;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_fault_sub_code_free(axiom_soap_fault_sub_code_t *fault_sub_code,
const axis2_env_t *env)
{
- axiom_soap_fault_sub_code_impl_t *fault_sub_code_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- fault_sub_code_impl = AXIS2_INTF_TO_IMPL(fault_sub_code);
- if (fault_sub_code_impl->value)
- {
- AXIOM_SOAP_FAULT_VALUE_FREE(fault_sub_code_impl->value, env);
- fault_sub_code_impl->value = NULL;
- }
- if (fault_sub_code_impl->subcode)
+ if (fault_sub_code->value)
{
- AXIOM_SOAP_FAULT_SUB_CODE_FREE(fault_sub_code_impl->subcode, env);
- fault_sub_code_impl->subcode = NULL;
+ AXIOM_SOAP_FAULT_VALUE_FREE(fault_sub_code->value, env);
+ fault_sub_code->value = NULL;
}
- if (fault_sub_code->ops)
+ if (fault_sub_code->subcode)
{
- AXIS2_FREE(env->allocator, fault_sub_code->ops);
- fault_sub_code->ops = NULL;
+ AXIOM_SOAP_FAULT_SUB_CODE_FREE(fault_sub_code->subcode, env);
+ fault_sub_code->subcode = NULL;
}
- AXIS2_FREE(env->allocator, fault_sub_code_impl);
+ AXIS2_FREE(env->allocator, fault_sub_code);
- fault_sub_code_impl = NULL;
+ fault_sub_code = NULL;
return AXIS2_SUCCESS;
}
-/**
- This is an internal function
-*/
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_fault_sub_code_set_sub_code(
axiom_soap_fault_sub_code_t *fault_sub_code,
const axis2_env_t *env,
- axiom_soap_fault_sub_code_t *sub_code)
+ axiom_soap_fault_sub_code_t *subcode)
{
- axiom_soap_fault_sub_code_impl_t *fault_subcode_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK(env->error, sub_code, AXIS2_FAILURE);
- fault_subcode_impl = AXIS2_INTF_TO_IMPL(fault_sub_code);
+ AXIS2_PARAM_CHECK(env->error, subcode, AXIS2_FAILURE);
- if (!(fault_subcode_impl->subcode))
+ if (!(fault_sub_code->subcode))
{
- fault_subcode_impl->subcode = sub_code;
+ fault_sub_code->subcode = subcode;
return AXIS2_SUCCESS;
}
else
@@ -257,49 +184,39 @@
return AXIS2_FAILURE;
}
-axiom_soap_fault_value_t* AXIS2_CALL
+AXIS2_EXTERN axiom_soap_fault_value_t* AXIS2_CALL
axiom_soap_fault_sub_code_get_value
(axiom_soap_fault_sub_code_t *fault_sub_code,
const axis2_env_t *env)
{
- axiom_soap_fault_sub_code_impl_t *fault_subcode_impl = NULL;
int status = AXIS2_SUCCESS;
AXIS2_ENV_CHECK(env, NULL);
- fault_subcode_impl = AXIS2_INTF_TO_IMPL(fault_sub_code);
-
- if (fault_subcode_impl->builder)
+ if (fault_sub_code->builder)
{
- while (!(fault_subcode_impl->value) &&
- !AXIOM_NODE_IS_COMPLETE(fault_subcode_impl->om_ele_node, env))
+ while (!(fault_sub_code->value) &&
+ !AXIOM_NODE_IS_COMPLETE(fault_sub_code->om_ele_node, env))
{
- status = AXIOM_SOAP_BUILDER_NEXT(fault_subcode_impl->builder, env);
+ status = AXIOM_SOAP_BUILDER_NEXT(fault_sub_code->builder, env);
if (status == AXIS2_FAILURE)
break;
}
}
- return fault_subcode_impl->value;
+ return fault_sub_code->value;
}
-/**
- this is an internal function
-*/
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_fault_sub_code_set_value
(axiom_soap_fault_sub_code_t *fault_sub_code,
const axis2_env_t *env,
axiom_soap_fault_value_t *fault_sub_code_val)
{
- axiom_soap_fault_sub_code_impl_t *fault_subcode_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, fault_sub_code_val, AXIS2_FAILURE);
- fault_subcode_impl = AXIS2_INTF_TO_IMPL(fault_sub_code);
-
- if (!(fault_subcode_impl->value))
+ if (!(fault_sub_code->value))
{
- fault_subcode_impl->value = fault_sub_code_val;
+ fault_sub_code->value = fault_sub_code_val;
return AXIS2_SUCCESS;
}
else
@@ -310,98 +227,84 @@
return AXIS2_FAILURE;
}
-axiom_soap_fault_sub_code_t* AXIS2_CALL
-axiom_soap_fault_sub_code_get_sub_code(
+AXIS2_EXTERN axiom_soap_fault_sub_code_t* AXIS2_CALL
+axiom_soap_fault_sub_code_get_subcode(
axiom_soap_fault_sub_code_t *fault_sub_code,
const axis2_env_t *env)
{
- axiom_soap_fault_sub_code_impl_t *fault_subcode_impl = NULL;
int status = AXIS2_SUCCESS;
AXIS2_ENV_CHECK(env, NULL);
- fault_subcode_impl = AXIS2_INTF_TO_IMPL(fault_sub_code);
-
- if (fault_subcode_impl->builder)
+ if (fault_sub_code->builder)
{
- while (!(fault_subcode_impl->subcode) &&
- !AXIOM_NODE_IS_COMPLETE(fault_subcode_impl->om_ele_node, env))
+ while (!(fault_sub_code->subcode) &&
+ !AXIOM_NODE_IS_COMPLETE(fault_sub_code->om_ele_node, env))
{
- status = AXIOM_SOAP_BUILDER_NEXT(fault_subcode_impl->builder, env);
+ status = AXIOM_SOAP_BUILDER_NEXT(fault_sub_code->builder, env);
if (status == AXIS2_FAILURE)
break;
}
}
- return fault_subcode_impl->subcode;
+ return fault_sub_code->subcode;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_fault_sub_code_set_base_node
(axiom_soap_fault_sub_code_t *fault_sub_code,
const axis2_env_t *env,
axiom_node_t *node)
{
- axiom_soap_fault_sub_code_impl_t *fault_subcode_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE);
- fault_subcode_impl = AXIS2_INTF_TO_IMPL(fault_sub_code);
-
if (AXIOM_NODE_GET_NODE_TYPE(node, env) != AXIOM_ELEMENT)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- fault_subcode_impl->om_ele_node = node;
+ fault_sub_code->om_ele_node = node;
return AXIS2_SUCCESS;
}
-axiom_node_t* AXIS2_CALL
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
axiom_soap_fault_sub_code_get_base_node
(axiom_soap_fault_sub_code_t *fault_sub_code,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(fault_sub_code)->om_ele_node;
+ return fault_sub_code->om_ele_node;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_fault_sub_code_set_builder(axiom_soap_fault_sub_code_t *fault_sub_code,
const axis2_env_t *env,
axiom_soap_builder_t *builder)
{
- axiom_soap_fault_sub_code_impl_t *subcode_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, builder, AXIS2_FAILURE);
- subcode_impl = AXIS2_INTF_TO_IMPL(fault_sub_code);
- subcode_impl->builder = builder;
+ fault_sub_code->builder = builder;
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_fault_sub_code_set_soap_version(
axiom_soap_fault_sub_code_t *fault_sub_code,
const axis2_env_t *env,
int soap_version)
{
- axiom_soap_fault_sub_code_impl_t *subcode_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- subcode_impl = AXIS2_INTF_TO_IMPL(fault_sub_code);
- subcode_impl->soap_version = soap_version;
+ fault_sub_code->soap_version = soap_version;
return AXIS2_SUCCESS;
}
-int AXIS2_CALL
+AXIS2_EXTERN int AXIS2_CALL
axiom_soap_fault_sub_code_get_soap_version
(axiom_soap_fault_sub_code_t *fault_sub_code,
const axis2_env_t *env)
{
- axiom_soap_fault_sub_code_impl_t *subcode_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- subcode_impl = AXIS2_INTF_TO_IMPL(fault_sub_code);
- return subcode_impl->soap_version;
+ return fault_sub_code->soap_version;
}
Modified: webservices/axis2/trunk/c/axiom/src/soap/soap_fault_text.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/soap/soap_fault_text.c?view=diff&rev=496572&r1=496571&r2=496572
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/soap/soap_fault_text.c (original)
+++ webservices/axis2/trunk/c/axiom/src/soap/soap_fault_text.c Mon Jan 15 18:09:50 2007
@@ -22,13 +22,8 @@
#include <axiom_namespace.h>
#include <axis2_qname.h>
-
-/****************** impl struct *********************************************/
-
-typedef struct axiom_soap_fault_text_impl_t
+struct axiom_soap_fault_text
{
- axiom_soap_fault_text_t fault_text;
-
axiom_attribute_t *lang_attribute;
axiom_namespace_t *lang_namespace;
@@ -36,104 +31,36 @@
axiom_node_t *om_ele_node;
axis2_bool_t lang_ns_used;
-
-}
-axiom_soap_fault_text_impl_t;
-
-/********************** Macro ************************************************/
-
-#define AXIS2_INTF_TO_IMPL(fault_txt) \
- ((axiom_soap_fault_text_impl_t*)fault_txt)
-
-/********************* function prototypes ***********************************/
-
-axis2_status_t AXIS2_CALL
-axiom_soap_fault_text_free(axiom_soap_fault_text_t *fault_text,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axiom_soap_fault_text_set_lang(axiom_soap_fault_text_t *fault_text,
- const axis2_env_t *env,
- const axis2_char_t* lang);
-
-axis2_char_t* AXIS2_CALL
-axiom_soap_fault_text_get_lang(axiom_soap_fault_text_t *fault_text,
- const axis2_env_t *env);
-
-axiom_node_t* AXIS2_CALL
-axiom_soap_fault_text_get_base_node(axiom_soap_fault_text_t *fault_text,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axiom_soap_fault_text_set_text(axiom_soap_fault_text_t *fault_text,
- const axis2_env_t *env,
- axis2_char_t *value,
- axis2_char_t *lang);
-
-axis2_char_t* AXIS2_CALL
-axiom_soap_fault_text_get_text(axiom_soap_fault_text_t *fault_text,
- const axis2_env_t *env);
-/***************************** functions **************************************/
-
+};
AXIS2_EXTERN axiom_soap_fault_text_t * AXIS2_CALL
axiom_soap_fault_text_create(const axis2_env_t *env)
{
- axiom_soap_fault_text_impl_t *fault_text_impl = NULL;
+ axiom_soap_fault_text_t *fault_text = NULL;
AXIS2_ENV_CHECK(env, NULL);
- fault_text_impl = (axiom_soap_fault_text_impl_t*)AXIS2_MALLOC(
+ fault_text = (axiom_soap_fault_text_t*)AXIS2_MALLOC(
env->allocator,
- sizeof(axiom_soap_fault_text_impl_t));
- if (!fault_text_impl)
+ sizeof(axiom_soap_fault_text_t));
+ if (!fault_text)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- fault_text_impl->fault_text.ops = NULL;
- fault_text_impl->om_ele_node = NULL;
- fault_text_impl->lang_attribute = NULL;
- fault_text_impl->lang_namespace = NULL;
- fault_text_impl->lang_ns_used = AXIS2_FALSE;
+ fault_text->om_ele_node = NULL;
+ fault_text->lang_attribute = NULL;
+ fault_text->lang_namespace = NULL;
+ fault_text->lang_ns_used = AXIS2_FALSE;
- fault_text_impl->lang_namespace = axiom_namespace_create(env,
+ fault_text->lang_namespace = axiom_namespace_create(env,
AXIOM_SOAP12_SOAP_FAULT_TEXT_LANG_ATTR_NS_URI,
AXIOM_SOAP12_SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX);
- if (!(fault_text_impl->lang_namespace))
+ if (!(fault_text->lang_namespace))
return NULL;
- fault_text_impl->fault_text.ops = (axiom_soap_fault_text_ops_t*)AXIS2_MALLOC(
- env->allocator,
- sizeof(axiom_soap_fault_text_ops_t));
- if (!(fault_text_impl->fault_text.ops))
- {
- AXIS2_FREE(env->allocator, fault_text_impl);
- fault_text_impl = NULL;
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
- fault_text_impl->fault_text.ops->free_fn =
- axiom_soap_fault_text_free;
-
- fault_text_impl->fault_text.ops->set_lang =
- axiom_soap_fault_text_set_lang;
-
- fault_text_impl->fault_text.ops->get_lang =
- axiom_soap_fault_text_get_lang;
-
- fault_text_impl->fault_text.ops->get_base_node =
- axiom_soap_fault_text_get_base_node;
-
- fault_text_impl->fault_text.ops->set_text =
- axiom_soap_fault_text_set_text;
-
- fault_text_impl->fault_text.ops->get_text =
- axiom_soap_fault_text_get_text;
-
-
- return &(fault_text_impl->fault_text);
+ return fault_text;
}
@@ -142,7 +69,6 @@
axiom_soap_fault_text_create_with_parent(const axis2_env_t *env,
axiom_soap_fault_reason_t *parent)
{
- axiom_soap_fault_text_impl_t *fault_text_impl = NULL;
axiom_soap_fault_text_t *fault_text = NULL;
int soap_version = -1;
axiom_element_t *this_ele = NULL;
@@ -161,8 +87,6 @@
return NULL;
}
- fault_text_impl = AXIS2_INTF_TO_IMPL(fault_text);
-
parent_node = AXIOM_SOAP_FAULT_REASON_GET_BASE_NODE(parent, env);
if (!parent_node)
{
@@ -192,54 +116,45 @@
return NULL;
}
- fault_text_impl->om_ele_node = this_node;
+ fault_text->om_ele_node = this_node;
AXIOM_SOAP_FAULT_REASON_ADD_SOAP_FAULT_TEXT(parent, env, fault_text);
- return &(fault_text_impl->fault_text);
+ return fault_text;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_fault_text_free(axiom_soap_fault_text_t *fault_text,
const axis2_env_t *env)
{
- axiom_soap_fault_text_impl_t* fault_text_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- fault_text_impl = AXIS2_INTF_TO_IMPL(fault_text);
- if (fault_text->ops)
+ if (fault_text->lang_ns_used == AXIS2_FALSE && fault_text->lang_namespace)
{
- AXIS2_FREE(env->allocator, fault_text->ops);
- fault_text->ops = NULL;
+ AXIOM_NAMESPACE_FREE(fault_text->lang_namespace, env);
+ fault_text->lang_namespace = NULL;
}
- if (fault_text_impl->lang_ns_used == AXIS2_FALSE && fault_text_impl->lang_namespace)
- {
- AXIOM_NAMESPACE_FREE(fault_text_impl->lang_namespace, env);
- fault_text_impl->lang_namespace = NULL;
- }
- AXIS2_FREE(env->allocator, fault_text_impl);
- fault_text_impl = NULL;
+ AXIS2_FREE(env->allocator, fault_text);
+ fault_text = NULL;
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_fault_text_set_lang(axiom_soap_fault_text_t *fault_text,
const axis2_env_t *env,
const axis2_char_t* lang)
{
- axiom_soap_fault_text_impl_t* fault_text_impl = NULL;
int status = AXIS2_SUCCESS;
axiom_element_t *om_ele = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, lang, AXIS2_FAILURE);
- fault_text_impl = AXIS2_INTF_TO_IMPL(fault_text);
- if (fault_text_impl->lang_attribute)
+ if (fault_text->lang_attribute)
{
axis2_char_t *attr_lang = NULL;
- attr_lang = AXIOM_ATTRIBUTE_GET_VALUE(fault_text_impl->lang_attribute, env);
+ attr_lang = AXIOM_ATTRIBUTE_GET_VALUE(fault_text->lang_attribute, env);
if (attr_lang)
{
if (AXIS2_STRCMP(attr_lang, lang) == 0)
@@ -248,56 +163,54 @@
return AXIS2_SUCCESS;
}
}
- AXIOM_ATTRIBUTE_SET_VALUE(fault_text_impl->lang_attribute, env, lang);
+ AXIOM_ATTRIBUTE_SET_VALUE(fault_text->lang_attribute, env, lang);
return AXIS2_SUCCESS;
}
- fault_text_impl->lang_attribute = axiom_attribute_create(env,
+ fault_text->lang_attribute = axiom_attribute_create(env,
AXIOM_SOAP12_SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,
- lang, fault_text_impl->lang_namespace);
- if (!fault_text_impl->lang_attribute)
+ lang, fault_text->lang_namespace);
+ if (!fault_text->lang_attribute)
return AXIS2_FAILURE;
- if (!fault_text_impl->om_ele_node)
+ if (!fault_text->om_ele_node)
return AXIS2_FAILURE;
- om_ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(fault_text_impl->om_ele_node, env);
+ om_ele = (axiom_element_t*)AXIOM_NODE_GET_DATA_ELEMENT(fault_text->om_ele_node, env);
if (!om_ele)
return AXIS2_FAILURE;
- status = AXIOM_ELEMENT_ADD_ATTRIBUTE(om_ele, env, fault_text_impl->lang_attribute,
- fault_text_impl->om_ele_node);
+ status = AXIOM_ELEMENT_ADD_ATTRIBUTE(om_ele, env, fault_text->lang_attribute,
+ fault_text->om_ele_node);
if (status == AXIS2_SUCCESS)
- fault_text_impl->lang_ns_used = AXIS2_TRUE;
+ fault_text->lang_ns_used = AXIS2_TRUE;
else
{
- AXIOM_ATTRIBUTE_FREE(fault_text_impl->lang_attribute, env);
- fault_text_impl->lang_attribute = NULL;
+ AXIOM_ATTRIBUTE_FREE(fault_text->lang_attribute, env);
+ fault_text->lang_attribute = NULL;
}
return status;
}
-axis2_char_t* AXIS2_CALL
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axiom_soap_fault_text_get_lang(axiom_soap_fault_text_t *fault_text,
const axis2_env_t *env)
{
- axiom_soap_fault_text_impl_t* fault_text_impl = NULL;
axiom_element_t* om_ele = NULL;
axis2_qname_t* tmp_qname = NULL;
AXIS2_ENV_CHECK(env, NULL);
- fault_text_impl = AXIS2_INTF_TO_IMPL(fault_text);
- if (!fault_text_impl->om_ele_node)
+ if (!fault_text->om_ele_node)
return NULL;
om_ele = (axiom_element_t*)
- AXIOM_NODE_GET_DATA_ELEMENT(fault_text_impl->om_ele_node, env);
+ AXIOM_NODE_GET_DATA_ELEMENT(fault_text->om_ele_node, env);
if (!om_ele)
return NULL;
- if (!(fault_text_impl->lang_attribute))
+ if (!(fault_text->lang_attribute))
{
/* this logic need to be rechecked */
@@ -306,70 +219,61 @@
AXIOM_SOAP12_SOAP_FAULT_TEXT_LANG_ATTR_NS_URI,
AXIOM_SOAP12_SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX);
- fault_text_impl->lang_attribute =
+ fault_text->lang_attribute =
AXIOM_ELEMENT_GET_ATTRIBUTE(om_ele, env, tmp_qname);
AXIS2_QNAME_FREE(tmp_qname, env);
}
- if (fault_text_impl->lang_attribute)
+ if (fault_text->lang_attribute)
{
- return AXIOM_ATTRIBUTE_GET_VALUE(fault_text_impl->lang_attribute, env);
+ return AXIOM_ATTRIBUTE_GET_VALUE(fault_text->lang_attribute, env);
}
else
return NULL;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_fault_text_set_base_node(axiom_soap_fault_text_t *fault_text,
const axis2_env_t *env,
axiom_node_t *node)
{
- axiom_soap_fault_text_impl_t* fault_text_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE);
- fault_text_impl = AXIS2_INTF_TO_IMPL(fault_text);
-
if (AXIOM_NODE_GET_NODE_TYPE(node, env) != AXIOM_ELEMENT)
{
AXIS2_ERROR_SET(env->error,
AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- fault_text_impl->om_ele_node = node;
+ fault_text->om_ele_node = node;
return AXIS2_SUCCESS;
}
-axiom_node_t* AXIS2_CALL
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
axiom_soap_fault_text_get_base_node(axiom_soap_fault_text_t *fault_text,
const axis2_env_t *env)
{
- axiom_soap_fault_text_impl_t* fault_text_impl = NULL;
AXIS2_ENV_CHECK(env, NULL);
- fault_text_impl = AXIS2_INTF_TO_IMPL(fault_text);
- return fault_text_impl->om_ele_node;
+ return fault_text->om_ele_node;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_fault_text_set_text(axiom_soap_fault_text_t *fault_text,
const axis2_env_t *env,
axis2_char_t *value,
axis2_char_t *lang)
{
- axiom_soap_fault_text_impl_t *text_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE);
- text_impl = AXIS2_INTF_TO_IMPL(fault_text);
-
- if (text_impl->om_ele_node)
+ if (fault_text->om_ele_node)
{
axiom_element_t *text_ele = NULL;
text_ele = (axiom_element_t *)
- AXIOM_NODE_GET_DATA_ELEMENT(text_impl->om_ele_node, env);
+ AXIOM_NODE_GET_DATA_ELEMENT(fault_text->om_ele_node, env);
if (text_ele)
{
- AXIOM_ELEMENT_SET_TEXT(text_ele, env, value, text_impl->om_ele_node);
+ AXIOM_ELEMENT_SET_TEXT(text_ele, env, value, fault_text->om_ele_node);
if (lang)
{
axiom_soap_fault_text_set_lang(fault_text, env, lang);
@@ -380,25 +284,22 @@
return AXIS2_FAILURE;
}
-axis2_char_t* AXIS2_CALL
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axiom_soap_fault_text_get_text(axiom_soap_fault_text_t *fault_text,
const axis2_env_t *env)
{
- axiom_soap_fault_text_impl_t *text_impl = NULL;
axis2_char_t *text = NULL;
AXIS2_ENV_CHECK(env, NULL);
- text_impl = AXIS2_INTF_TO_IMPL(fault_text);
-
- if (text_impl->om_ele_node)
+ if (fault_text->om_ele_node)
{
axiom_element_t *text_ele = NULL;
text_ele = (axiom_element_t *)
- AXIOM_NODE_GET_DATA_ELEMENT(text_impl->om_ele_node, env);
+ AXIOM_NODE_GET_DATA_ELEMENT(fault_text->om_ele_node, env);
if (text_ele)
{
text = AXIOM_ELEMENT_GET_TEXT(text_ele, env,
- text_impl->om_ele_node);
+ fault_text->om_ele_node);
return text;
}
}
Modified: webservices/axis2/trunk/c/axiom/src/soap/soap_fault_value.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/soap/soap_fault_value.c?view=diff&rev=496572&r1=496571&r2=496572
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/soap/soap_fault_value.c (original)
+++ webservices/axis2/trunk/c/axiom/src/soap/soap_fault_value.c Mon Jan 15 18:09:50 2007
@@ -20,85 +20,30 @@
#include <axiom_element.h>
#include <axiom_text.h>
-/****************************** impl struct *********************************/
-
-typedef struct axiom_soap_fault_value_impl_t
+struct axiom_soap_fault_value
{
- axiom_soap_fault_value_t fault_value;
-
/** store om element node */
axiom_node_t *om_ele_node;
-
- /** pointer to parent */
-}
-axiom_soap_fault_value_impl_t;
-
-/*********************** macro ************************************************/
-
-#define AXIS2_INTF_TO_IMPL(fault_val) \
- ((axiom_soap_fault_value_impl_t*)fault_val)
-
-/******************** function prototypes *************************************/
-
-axis2_status_t AXIS2_CALL
-axiom_soap_fault_value_free(axiom_soap_fault_value_t *fault_value,
- const axis2_env_t *env);
-
-axiom_node_t* AXIS2_CALL
-axiom_soap_fault_value_get_base_node(axiom_soap_fault_value_t *fault_value,
- const axis2_env_t *env);
-
-axis2_char_t* AXIS2_CALL
-axiom_soap_fault_value_get_text(axiom_soap_fault_value_t *fault_value,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axiom_soap_fault_value_set_text(axiom_soap_fault_value_t *fault_value,
- const axis2_env_t *env,
- axis2_char_t *text);
-
-/*************************** function implementations *************************/
+};
AXIS2_EXTERN axiom_soap_fault_value_t * AXIS2_CALL
axiom_soap_fault_value_create(const axis2_env_t *env)
{
- axiom_soap_fault_value_impl_t *fault_val_impl = NULL;
+ axiom_soap_fault_value_t *fault_value = NULL;
AXIS2_ENV_CHECK(env, NULL);
- fault_val_impl = (axiom_soap_fault_value_impl_t *)AXIS2_MALLOC(
+ fault_value = (axiom_soap_fault_value_t *)AXIS2_MALLOC(
env->allocator,
- sizeof(axiom_soap_fault_value_impl_t));
- if (!fault_val_impl)
- {
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
-
- fault_val_impl->om_ele_node = NULL;
-
- fault_val_impl->fault_value.ops = NULL;
- fault_val_impl->fault_value.ops = (axiom_soap_fault_value_ops_t *)AXIS2_MALLOC(
- env->allocator, sizeof(axiom_soap_fault_value_ops_t));
- if (!(fault_val_impl->fault_value.ops))
+ sizeof(axiom_soap_fault_value_t));
+ if (!fault_value)
{
- AXIS2_FREE(env->allocator, fault_val_impl);
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- fault_val_impl->fault_value.ops->free_fn =
- axiom_soap_fault_value_free;
-
- fault_val_impl->fault_value.ops->get_base_node =
- axiom_soap_fault_value_get_base_node;
-
- fault_val_impl->fault_value.ops->get_text =
- axiom_soap_fault_value_get_text;
+ fault_value->om_ele_node = NULL;
- fault_val_impl->fault_value.ops->set_text =
- axiom_soap_fault_value_set_text;
-
- return &(fault_val_impl->fault_value);
+ return fault_value;
}
@@ -106,7 +51,6 @@
axiom_soap_fault_value_create_with_subcode(const axis2_env_t *env,
axiom_soap_fault_sub_code_t *parent)
{
- axiom_soap_fault_value_impl_t *fault_val_impl = NULL;
axiom_soap_fault_value_t *fault_value = NULL;
axiom_element_t *this_ele = NULL;
@@ -126,9 +70,6 @@
return NULL;
}
- fault_val_impl = AXIS2_INTF_TO_IMPL(fault_value);
-
-
parent_node = AXIOM_SOAP_FAULT_SUB_CODE_GET_BASE_NODE(parent, env);
if (!parent_node)
@@ -163,18 +104,17 @@
return NULL;
}
- fault_val_impl->om_ele_node = this_node;
+ fault_value->om_ele_node = this_node;
axiom_soap_fault_sub_code_set_value(parent, env, fault_value);
- return &(fault_val_impl->fault_value);
+ return fault_value;
}
AXIS2_EXTERN axiom_soap_fault_value_t * AXIS2_CALL
axiom_soap_fault_value_create_with_code(const axis2_env_t *env,
axiom_soap_fault_code_t *parent)
{
- axiom_soap_fault_value_impl_t *fault_val_impl = NULL;
axiom_soap_fault_value_t *fault_value = NULL;
int soap_version = -1;
axiom_element_t *this_ele = NULL;
@@ -193,8 +133,6 @@
return NULL;
}
- fault_val_impl = AXIS2_INTF_TO_IMPL(fault_value);
-
parent_node = AXIOM_SOAP_FAULT_CODE_GET_BASE_NODE(parent, env);
if (!parent_node)
{
@@ -222,36 +160,29 @@
AXIOM_SOAP_FAULT_VALUE_FREE(fault_value, env);
return NULL;
}
- fault_val_impl->om_ele_node = this_node;
+ fault_value->om_ele_node = this_node;
axiom_soap_fault_code_set_value(parent, env, fault_value);
- return &(fault_val_impl->fault_value);
+ return fault_value;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_fault_value_free(axiom_soap_fault_value_t *fault_value,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
- if (fault_value->ops)
- {
- AXIS2_FREE(env->allocator, fault_value->ops);
- fault_value->ops = NULL;
- }
- AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(fault_value));
+ AXIS2_FREE(env->allocator, fault_value);
fault_value = NULL;
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_fault_value_set_base_node(axiom_soap_fault_value_t *fault_value,
const axis2_env_t *env,
axiom_node_t *node)
{
- axiom_soap_fault_value_impl_t *fault_val_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
if (AXIOM_NODE_GET_NODE_TYPE(node, env) != AXIOM_ELEMENT)
@@ -261,21 +192,18 @@
return AXIS2_FAILURE;
}
- fault_val_impl = AXIS2_INTF_TO_IMPL(fault_value);
- fault_val_impl->om_ele_node = node;
+ fault_value->om_ele_node = node;
return AXIS2_SUCCESS;
}
-axiom_node_t* AXIS2_CALL
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
axiom_soap_fault_value_get_base_node(axiom_soap_fault_value_t *fault_value,
const axis2_env_t *env)
{
- axiom_soap_fault_value_impl_t *fault_val_impl = NULL;
- fault_val_impl = AXIS2_INTF_TO_IMPL(fault_value);
- return fault_val_impl->om_ele_node;
+ return fault_value->om_ele_node;
}
-axis2_char_t* AXIS2_CALL
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axiom_soap_fault_value_get_text(axiom_soap_fault_value_t *fault_value,
const axis2_env_t *env)
{
@@ -296,23 +224,20 @@
return AXIOM_ELEMENT_GET_TEXT(value_element, env, value_node);
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_fault_value_set_text(axiom_soap_fault_value_t *fault_value,
const axis2_env_t *env,
axis2_char_t *text)
{
- axiom_soap_fault_value_impl_t *fault_value_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, text, AXIS2_FAILURE);
- fault_value_impl = AXIS2_INTF_TO_IMPL(fault_value);
- if (fault_value_impl->om_ele_node &&
- AXIOM_NODE_GET_NODE_TYPE(fault_value_impl->om_ele_node, env) == AXIOM_ELEMENT)
+ if (fault_value->om_ele_node &&
+ AXIOM_NODE_GET_NODE_TYPE(fault_value->om_ele_node, env) == AXIOM_ELEMENT)
{
axiom_element_t *om_ele = NULL;
om_ele = (axiom_element_t *)
- AXIOM_NODE_GET_DATA_ELEMENT(fault_value_impl->om_ele_node, env);
- return AXIOM_ELEMENT_SET_TEXT(om_ele, env, text, fault_value_impl->om_ele_node);
+ AXIOM_NODE_GET_DATA_ELEMENT(fault_value->om_ele_node, env);
+ return AXIOM_ELEMENT_SET_TEXT(om_ele, env, text, fault_value->om_ele_node);
}
return AXIS2_FAILURE;
}
Modified: webservices/axis2/trunk/c/axiom/src/soap/soap_header.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/soap/soap_header.c?view=diff&rev=496572&r1=496571&r2=496572
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/soap/soap_header.c (original)
+++ webservices/axis2/trunk/c/axiom/src/soap/soap_header.c Mon Jan 15 18:09:50 2007
@@ -25,12 +25,8 @@
#include <axiom_node_internal.h>
#include <axis2_array_list.h>
-/******************* impl struct *********************************************/
-
-typedef struct axiom_soap_header_impl_t
+struct axiom_soap_header
{
- axiom_soap_header_t soap_header;
-
axiom_node_t *om_ele_node;
int soap_version;
@@ -42,134 +38,43 @@
axiom_soap_builder_t *soap_builder;
axis2_array_list_t *header_block_keys;
+};
-}
-axiom_soap_header_impl_t;
-
-/****************** Macro ****************************************************/
-
-#define AXIS2_INTF_TO_IMPL(header) ((axiom_soap_header_impl_t*)header)
-
-/****************** Function prototypes **************************************/
-
-axis2_status_t AXIS2_CALL
-axiom_soap_header_free(axiom_soap_header_t *header,
- const axis2_env_t *env);
-
-axiom_soap_header_block_t* AXIS2_CALL
-axiom_soap_header_add_header_block(axiom_soap_header_t* header,
- const axis2_env_t *env,
- const axis2_char_t *localname,
- axiom_namespace_t *ns);
-axis2_hash_t* AXIS2_CALL
-axiom_soap_header_examine_header_blocks
-(axiom_soap_header_t* header,
- const axis2_env_t *env,
- axis2_char_t* param_role);
-
-axiom_children_qname_iterator_t* AXIS2_CALL
-axiom_soap_header_examine_all_header_blocks
-(axiom_soap_header_t* header,
- const axis2_env_t *env);
-
-axiom_children_with_specific_attribute_iterator_t *
-AXIS2_CALL axiom_soap_header_extract_header_blocks
-(axiom_soap_header_t *header,
- const axis2_env_t *env,
- axis2_char_t *role);
-
-axiom_node_t* AXIS2_CALL
-axiom_soap_header_get_base_node(axiom_soap_header_t *header,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axiom_soap_header_get_soap_version(axiom_soap_header_t *header,
- const axis2_env_t *env);
-
-axis2_array_list_t* AXIS2_CALL
-axiom_soap_header_get_header_blocks_with_namespace_uri
-(axiom_soap_header_t* header,
- const axis2_env_t *env,
- const axis2_char_t *ns_uri);
-
-axis2_hash_t* AXIS2_CALL
-axiom_soap_header_get_all_header_blocks(axiom_soap_header_t *header,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axiom_soap_header_remove_header_block(axiom_soap_header_t *header,
- const axis2_env_t *env,
- axis2_qname_t *qname);
static axis2_bool_t AXIS2_CALL
axiom_soap_header_qname_matches(const axis2_env_t *env,
axis2_qname_t *element_qname,
axis2_qname_t *qname_to_match);
-/*************** function implementations *************************************/
-
AXIS2_EXTERN axiom_soap_header_t * AXIS2_CALL
axiom_soap_header_create(const axis2_env_t *env)
{
- axiom_soap_header_impl_t *header_impl = NULL;
+ axiom_soap_header_t *soap_header = NULL;
AXIS2_ENV_CHECK(env, NULL);
- header_impl = (axiom_soap_header_impl_t*)AXIS2_MALLOC(
+ soap_header = (axiom_soap_header_t*)AXIS2_MALLOC(
env->allocator,
- sizeof(axiom_soap_header_impl_t));
- if (!header_impl)
+ sizeof(axiom_soap_header_t));
+ if (!soap_header)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- header_impl->soap_header.ops = NULL;
- header_impl->om_ele_node = NULL;
- header_impl->hbnumber = 0;
- header_impl->header_blocks = NULL;
+ soap_header->om_ele_node = NULL;
+ soap_header->hbnumber = 0;
+ soap_header->header_blocks = NULL;
/** default value */
- header_impl->soap_version = AXIOM_SOAP12;
- header_impl->header_block_keys = NULL;
+ soap_header->soap_version = AXIOM_SOAP12;
+ soap_header->header_block_keys = NULL;
-
- header_impl->soap_header.ops = NULL;
- header_impl->soap_header.ops = (axiom_soap_header_ops_t*)AXIS2_MALLOC(env->allocator,
- sizeof(axiom_soap_header_ops_t));
- if (!(header_impl->soap_header.ops))
+ soap_header->header_block_keys = axis2_array_list_create(env, 10);
+ if (!soap_header->header_block_keys)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- AXIS2_FREE(env->allocator, header_impl);
+ AXIS2_FREE(env->allocator, soap_header);
return NULL;
}
- header_impl->header_block_keys = axis2_array_list_create(env, 10);
- if (!header_impl->header_block_keys)
- {
- AXIS2_FREE(env->allocator, header_impl->soap_header.ops);
- AXIS2_FREE(env->allocator, header_impl);
- return NULL;
- }
-
- header_impl->soap_header.ops->free_fn =
- axiom_soap_header_free;
- header_impl->soap_header.ops->add_header_block =
- axiom_soap_header_add_header_block;
- header_impl->soap_header.ops->examine_header_blocks =
- axiom_soap_header_examine_header_blocks;
- header_impl->soap_header.ops->examine_all_header_blocks =
- axiom_soap_header_examine_all_header_blocks;
- header_impl->soap_header.ops->extract_header_blocks =
- axiom_soap_header_extract_header_blocks;
- header_impl->soap_header.ops->get_base_node =
- axiom_soap_header_get_base_node;
- header_impl->soap_header.ops->get_soap_version =
- axiom_soap_header_get_soap_version;
- header_impl->soap_header.ops->get_header_blocks_with_namespace_uri =
- axiom_soap_header_get_header_blocks_with_namespace_uri;
- header_impl->soap_header.ops->get_all_header_blocks =
- axiom_soap_header_get_all_header_blocks;
- header_impl->soap_header.ops->remove_header_block =
- axiom_soap_header_remove_header_block;
- return &(header_impl->soap_header);
+ return soap_header;
}
@@ -177,8 +82,7 @@
axiom_soap_header_create_with_parent(const axis2_env_t *env,
axiom_soap_envelope_t *envelope)
{
- axiom_soap_header_impl_t *header_impl = NULL;
- axiom_soap_header_t *header = NULL;
+ axiom_soap_header_t *soap_header = NULL;
axiom_element_t *this_ele = NULL;
axiom_node_t *this_node = NULL;
@@ -191,21 +95,18 @@
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, envelope, NULL);
- header = axiom_soap_header_create(env);
- if (!header)
+ soap_header = axiom_soap_header_create(env);
+ if (!soap_header)
return NULL;
- header_impl = AXIS2_INTF_TO_IMPL(header);
-
-
- header_impl->soap_version = AXIOM_SOAP_ENVELOPE_GET_SOAP_VERSION(envelope, env);
+ soap_header->soap_version = AXIOM_SOAP_ENVELOPE_GET_SOAP_VERSION(envelope, env);
parent_node = AXIOM_SOAP_ENVELOPE_GET_BASE_NODE(envelope, env);
if (!parent_node ||
AXIOM_NODE_GET_NODE_TYPE(parent_node, env) != AXIOM_ELEMENT)
{
- AXIOM_SOAP_HEADER_FREE(header, env);
+ AXIOM_SOAP_HEADER_FREE(soap_header, env);
return NULL;
}
@@ -213,7 +114,7 @@
AXIOM_NODE_GET_DATA_ELEMENT(parent_node, env);
if (!parent_ele)
{
- AXIOM_SOAP_HEADER_FREE(header, env);
+ AXIOM_SOAP_HEADER_FREE(soap_header, env);
return NULL;
}
if (AXIOM_NODE_GET_FIRST_CHILD(parent_node, env))
@@ -227,35 +128,31 @@
AXIOM_SOAP_HEADER_LOCAL_NAME, parent_ns, &this_node);
if (!this_ele)
{
- AXIOM_SOAP_HEADER_FREE(header, env);
+ AXIOM_SOAP_HEADER_FREE(soap_header, env);
return NULL;
}
- header_impl->om_ele_node = this_node;
- axiom_soap_envelope_set_header(envelope, env, header);
+ soap_header->om_ele_node = this_node;
+ axiom_soap_envelope_set_header(envelope, env, soap_header);
if (body_node)
{
AXIOM_NODE_ADD_CHILD(parent_node, env, body_node);
}
- return &(header_impl->soap_header);
+ return soap_header;
}
-axis2_status_t AXIS2_CALL
-axiom_soap_header_free(axiom_soap_header_t *header,
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axiom_soap_header_free(axiom_soap_header_t *soap_header,
const axis2_env_t *env)
{
- axiom_soap_header_impl_t *header_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- header_impl = AXIS2_INTF_TO_IMPL(header);
-
- if (header_impl->header_blocks)
+ if (soap_header->header_blocks)
{
axis2_hash_index_t *hi = NULL;
void *val = NULL;
- for (hi = axis2_hash_first(header_impl->header_blocks , env); hi;
+ for (hi = axis2_hash_first(soap_header->header_blocks , env); hi;
hi = axis2_hash_next(env, hi))
{
axis2_hash_this(hi, NULL , NULL, &val);
@@ -267,45 +164,39 @@
}
}
- axis2_hash_free(header_impl->header_blocks, env);
+ axis2_hash_free(soap_header->header_blocks, env);
}
- if (header_impl->header_block_keys)
+ if (soap_header->header_block_keys)
{
int size = 0;
void *val = NULL;
int i = 0;
- size = AXIS2_ARRAY_LIST_SIZE(header_impl->header_block_keys, env);
+ size = AXIS2_ARRAY_LIST_SIZE(soap_header->header_block_keys, env);
for (i = 0; i < size; i++)
{
- val = AXIS2_ARRAY_LIST_GET(header_impl->header_block_keys, env, i);
+ val = AXIS2_ARRAY_LIST_GET(soap_header->header_block_keys, env, i);
if (val)
{
AXIS2_FREE(env->allocator, (char*)val);
val = NULL;
}
}
- AXIS2_ARRAY_LIST_FREE(header_impl->header_block_keys, env);
- header_impl->header_block_keys = NULL;
- }
- if (header->ops)
- {
- AXIS2_FREE(env->allocator, header->ops);
- header->ops = NULL;
+ AXIS2_ARRAY_LIST_FREE(soap_header->header_block_keys, env);
+ soap_header->header_block_keys = NULL;
}
- AXIS2_FREE(env->allocator, header_impl);
+ AXIS2_FREE(env->allocator, soap_header);
- header_impl = NULL;
+ soap_header = NULL;
return AXIS2_SUCCESS;
}
-axiom_soap_header_block_t* AXIS2_CALL
-axiom_soap_header_add_header_block(axiom_soap_header_t* header,
+AXIS2_EXTERN axiom_soap_header_block_t* AXIS2_CALL
+axiom_soap_header_add_header_block(axiom_soap_header_t* soap_header,
const axis2_env_t *env,
const axis2_char_t *localname,
axiom_namespace_t *ns)
{
- axiom_soap_header_impl_t *header_impl = NULL;
axiom_soap_header_block_t *header_block = NULL;
axiom_namespace_t *cloned_ns = NULL;
@@ -316,13 +207,11 @@
AXIS2_PARAM_CHECK(env->error, localname, NULL);
AXIS2_PARAM_CHECK(env->error, ns, NULL);
- header_impl = AXIS2_INTF_TO_IMPL(header);
-
cloned_ns = AXIOM_NAMESPACE_CLONE(ns, env);
if (!cloned_ns)
return NULL;
- header_block = axiom_soap_header_block_create_with_parent(env, localname, cloned_ns, header);
+ header_block = axiom_soap_header_block_create_with_parent(env, localname, cloned_ns, soap_header);
if (!header_block)
return NULL;
@@ -362,51 +251,47 @@
return NULL;
}
}
-axis2_hash_t* AXIS2_CALL
+AXIS2_EXTERN axis2_hash_t* AXIS2_CALL
axiom_soap_header_examine_header_blocks
-(axiom_soap_header_t* header,
+(axiom_soap_header_t* soap_header,
const axis2_env_t *env,
axis2_char_t* param_role)
{
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, param_role, NULL);
- return AXIS2_INTF_TO_IMPL(header)->header_blocks;
+ return soap_header->header_blocks;
}
-axiom_children_qname_iterator_t* AXIS2_CALL
+AXIS2_EXTERN axiom_children_qname_iterator_t* AXIS2_CALL
axiom_soap_header_examine_all_header_blocks
-(axiom_soap_header_t* header,
+(axiom_soap_header_t* soap_header,
const axis2_env_t *env)
{
- axiom_soap_header_impl_t *header_impl = NULL;
axiom_element_t *om_ele = NULL;
AXIS2_ENV_CHECK(env, NULL);
- header_impl = AXIS2_INTF_TO_IMPL(header);
- if (!header_impl->om_ele_node)
+ if (!soap_header->om_ele_node)
return NULL;
- om_ele = (axiom_element_t *)AXIOM_NODE_GET_DATA_ELEMENT(header_impl->om_ele_node, env);
+ om_ele = (axiom_element_t *)AXIOM_NODE_GET_DATA_ELEMENT(soap_header->om_ele_node, env);
if (om_ele)
{
return AXIOM_ELEMENT_GET_CHILDREN_WITH_QNAME(om_ele,
- env, NULL, header_impl->om_ele_node);
+ env, NULL, soap_header->om_ele_node);
}
else
return NULL;
}
-axiom_children_with_specific_attribute_iterator_t *
+AXIS2_EXTERN axiom_children_with_specific_attribute_iterator_t *
AXIS2_CALL axiom_soap_header_extract_header_blocks
-(axiom_soap_header_t *header,
+(axiom_soap_header_t *soap_header,
const axis2_env_t *env,
axis2_char_t *role)
{
- axiom_soap_header_impl_t *header_impl = NULL;
-
const axis2_char_t *localname = NULL;
const axis2_char_t *nsuri = NULL;
@@ -420,16 +305,14 @@
AXIS2_ENV_CHECK(env, NULL);
- header_impl = AXIS2_INTF_TO_IMPL(header);
-
- if (header_impl->soap_version == AXIOM_SOAP_VERSION_NOT_SET)
+ if (soap_header->soap_version == AXIOM_SOAP_VERSION_NOT_SET)
return NULL;
- if (header_impl->soap_version == AXIOM_SOAP11)
+ if (soap_header->soap_version == AXIOM_SOAP11)
{
localname = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI;
nsuri = AXIOM_SOAP11_ATTR_ACTOR;
}
- if (header_impl->soap_version == AXIOM_SOAP12)
+ if (soap_header->soap_version == AXIOM_SOAP12)
{
localname = AXIOM_SOAP12_SOAP_ROLE;
nsuri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;
@@ -440,12 +323,12 @@
return NULL;
header_om_ele = (axiom_element_t*)
- AXIOM_NODE_GET_DATA_ELEMENT(header_impl->om_ele_node, env);
+ AXIOM_NODE_GET_DATA_ELEMENT(soap_header->om_ele_node, env);
if (header_om_ele)
{
first_ele = AXIOM_ELEMENT_GET_FIRST_ELEMENT(header_om_ele, env,
- header_impl->om_ele_node, &first_node);
+ soap_header->om_ele_node, &first_node);
if (first_node)
{
return axiom_children_with_specific_attribute_iterator_create(env,
@@ -459,18 +342,14 @@
}
-axis2_status_t AXIS2_CALL
-axiom_soap_header_set_base_node(axiom_soap_header_t *header,
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axiom_soap_header_set_base_node(axiom_soap_header_t *soap_header,
const axis2_env_t *env,
axiom_node_t *node)
{
- axiom_soap_header_impl_t *header_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE);
- header_impl = AXIS2_INTF_TO_IMPL(header);
-
if (AXIOM_NODE_GET_NODE_TYPE(node, env) != AXIOM_ELEMENT)
{
AXIS2_ERROR_SET(env->error,
@@ -478,99 +357,92 @@
return AXIS2_FAILURE;
}
- header_impl->om_ele_node = node;
+ soap_header->om_ele_node = node;
return AXIS2_SUCCESS;
}
-axiom_node_t* AXIS2_CALL
-axiom_soap_header_get_base_node(axiom_soap_header_t *header,
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
+axiom_soap_header_get_base_node(axiom_soap_header_t *soap_header,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(header)->om_ele_node;
+ return soap_header->om_ele_node;
}
/**
set soap version and get soap version are internal functions
*/
-axis2_status_t AXIS2_CALL
-axiom_soap_header_get_soap_version(axiom_soap_header_t *header,
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axiom_soap_header_get_soap_version(axiom_soap_header_t *soap_header,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- return AXIS2_INTF_TO_IMPL(header)->soap_version;
+ return soap_header->soap_version;
}
-axis2_status_t AXIS2_CALL
-axiom_soap_header_set_soap_version(axiom_soap_header_t *header,
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axiom_soap_header_set_soap_version(axiom_soap_header_t *soap_header,
const axis2_env_t *env,
int soap_version)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_INTF_TO_IMPL(header)->soap_version = soap_version;
+ soap_header->soap_version = soap_version;
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
-axiom_soap_header_set_header_block(axiom_soap_header_t *header,
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axiom_soap_header_set_header_block(axiom_soap_header_t *soap_header,
const axis2_env_t *env,
struct axiom_soap_header_block *header_block)
{
axis2_char_t *key = NULL ;
- axiom_soap_header_impl_t *header_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, header_block, AXIS2_FAILURE);
- header_impl = AXIS2_INTF_TO_IMPL(header);
-
key = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t)*10);
if (!key)
return AXIS2_FAILURE;
- sprintf(key, "%d", header_impl->hbnumber++);
+ sprintf(key, "%d", soap_header->hbnumber++);
- if (header_impl->header_blocks)
+ if (soap_header->header_blocks)
{
- axis2_hash_set(header_impl->header_blocks,
+ axis2_hash_set(soap_header->header_blocks,
key , AXIS2_HASH_KEY_STRING, header_block);
}
else
{
- header_impl->header_blocks = axis2_hash_make(env);
- axis2_hash_set(header_impl->header_blocks,
+ soap_header->header_blocks = axis2_hash_make(env);
+ axis2_hash_set(soap_header->header_blocks,
key , AXIS2_HASH_KEY_STRING, header_block);
}
- if (header_impl->header_block_keys)
+ if (soap_header->header_block_keys)
{
- AXIS2_ARRAY_LIST_ADD(header_impl->header_block_keys, env, key);
+ AXIS2_ARRAY_LIST_ADD(soap_header->header_block_keys, env, key);
}
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
-axiom_soap_header_set_builder(axiom_soap_header_t *header,
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axiom_soap_header_set_builder(axiom_soap_header_t *soap_header,
const axis2_env_t *env,
struct axiom_soap_builder *builder)
{
- axiom_soap_header_impl_t *header_impl = NULL;
AXIS2_PARAM_CHECK(env->error, builder, AXIS2_FAILURE);
- header_impl = AXIS2_INTF_TO_IMPL(header);
- header_impl->soap_builder = builder;
+ soap_header->soap_builder = builder;
return AXIS2_SUCCESS;
}
-axis2_array_list_t* AXIS2_CALL
+AXIS2_EXTERN axis2_array_list_t* AXIS2_CALL
axiom_soap_header_get_header_blocks_with_namespace_uri
-(axiom_soap_header_t* header,
+(axiom_soap_header_t* soap_header,
const axis2_env_t *env,
const axis2_char_t *ns_uri)
{
- axiom_soap_header_impl_t *header_impl = NULL;
-
axis2_array_list_t *header_block_list = NULL;
axis2_hash_index_t *hash_index = NULL;
@@ -588,15 +460,14 @@
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, ns_uri, NULL);
- header_impl = AXIS2_INTF_TO_IMPL(header);
- if (!(header_impl->header_blocks))
+ if (!(soap_header->header_blocks))
return NULL;
header_block_list = axis2_array_list_create(env, 10);
if (!header_block_list)
return NULL;
- for (hash_index = axis2_hash_first(header_impl->header_blocks, env);
+ for (hash_index = axis2_hash_first(soap_header->header_blocks, env);
hash_index; hash_index = axis2_hash_next(env, hash_index))
{
axis2_hash_this(hash_index, NULL, NULL, &hb);
@@ -643,21 +514,18 @@
return NULL;
}
-axis2_hash_t* AXIS2_CALL
-axiom_soap_header_get_all_header_blocks(axiom_soap_header_t *header,
+AXIS2_EXTERN axis2_hash_t* AXIS2_CALL
+axiom_soap_header_get_all_header_blocks(axiom_soap_header_t *soap_header,
const axis2_env_t *env)
{
- axiom_soap_header_impl_t *header_impl = NULL;
- header_impl = AXIS2_INTF_TO_IMPL(header);
- return header_impl->header_blocks;
+ return soap_header->header_blocks;
}
-axis2_status_t AXIS2_CALL
-axiom_soap_header_remove_header_block(axiom_soap_header_t *header,
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axiom_soap_header_remove_header_block(axiom_soap_header_t *soap_header,
const axis2_env_t *env,
axis2_qname_t *qname)
{
- axiom_soap_header_impl_t *header_impl = NULL;
axis2_char_t *qn_localname = NULL;
axis2_char_t *qname_ns = NULL;
axis2_char_t *qname_prefix = NULL;
@@ -669,12 +537,11 @@
qname_ns = AXIS2_QNAME_GET_URI(qname, env);
qname_prefix = AXIS2_QNAME_GET_PREFIX(qname, env);
- header_impl = AXIS2_INTF_TO_IMPL(header);
- if (!header_impl->header_blocks)
+ if (!soap_header->header_blocks)
return AXIS2_FAILURE;
- for (hi = axis2_hash_first(header_impl->header_blocks, env);
+ for (hi = axis2_hash_first(soap_header->header_blocks, env);
hi; hi = axis2_hash_next(env, hi))
{
const void *key = NULL;
@@ -699,7 +566,7 @@
{
AXIOM_NODE_DETACH(node, env);
AXIOM_NODE_FREE_TREE(node, env);
- axis2_hash_set(header_impl->header_blocks, key, AXIS2_HASH_KEY_STRING,
+ axis2_hash_set(soap_header->header_blocks, key, AXIS2_HASH_KEY_STRING,
NULL);
AXIOM_SOAP_HEADER_BLOCK_FREE(header_block, env);
return AXIS2_SUCCESS;
Modified: webservices/axis2/trunk/c/axiom/src/soap/soap_header_block.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/soap/soap_header_block.c?view=diff&rev=496572&r1=496571&r2=496572
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/soap/soap_header_block.c (original)
+++ webservices/axis2/trunk/c/axiom/src/soap/soap_header_block.c Mon Jan 15 18:09:50 2007
@@ -21,157 +21,34 @@
#include <axiom_soap_envelope.h>
#include <axiom_soap_builder.h>
-/******************* impl struct **********************************************/
-
-typedef struct axiom_soap_header_block_impl_t
+struct axiom_soap_header_block
{
- axiom_soap_header_block_t header_block;
/** om_element node corresponding to this headerblock */
axiom_node_t *om_ele_node;
/** soap version */
int soap_version;
-
axis2_bool_t processed;
-
-}
-axiom_soap_header_block_impl_t;
-
-/***************** Macro ******************************************************/
-
-#define AXIS2_INTF_TO_IMPL(hblock) ((axiom_soap_header_block_impl_t*)hblock)
-
-/***************** function prototypes ****************************************/
-
-axis2_status_t AXIS2_CALL
-axiom_soap_header_block_free(axiom_soap_header_block_t *header_block,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axiom_soap_header_block_set_role(axiom_soap_header_block_t *header_block,
- const axis2_env_t *env,
- axis2_char_t *uri);
-
-axis2_status_t AXIS2_CALL
-axiom_soap_header_block_set_must_understand_with_bool
-(axiom_soap_header_block_t *header_block,
- const axis2_env_t *env,
- axis2_bool_t must_understand);
-
-axis2_status_t AXIS2_CALL
-axiom_soap_header_block_set_must_understand_with_string
-(axiom_soap_header_block_t *header_block,
- const axis2_env_t *env,
- axis2_char_t *must_understand);
-
-axis2_bool_t AXIS2_CALL
-axiom_soap_header_block_get_must_understand
-(axiom_soap_header_block_t *header_block,
- const axis2_env_t *env);
-
-
-axis2_bool_t AXIS2_CALL
-axiom_soap_header_block_is_processed
-(axiom_soap_header_block_t *header_block,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axiom_soap_header_block_set_processed
-(axiom_soap_header_block_t *header_block,
- const axis2_env_t *env);
-axis2_char_t* AXIS2_CALL
-axiom_soap_header_block_get_role
-(axiom_soap_header_block_t *header_block,
- const axis2_env_t *env);
-
-axiom_node_t* AXIS2_CALL
-axiom_soap_header_block_get_base_node
-(axiom_soap_header_block_t *header_block,
- const axis2_env_t *env);
-
-int AXIS2_CALL
-axiom_soap_header_block_get_soap_version
-(axiom_soap_header_block_t *header_block,
- const axis2_env_t *env);
-
-
-axis2_status_t AXIS2_CALL
-axiom_soap_header_block_set_attribute
-(axiom_soap_header_block_t *header_block,
- const axis2_env_t *env,
- const axis2_char_t *attr_name,
- const axis2_char_t *attr_value,
- const axis2_char_t *soap_envelope_namespace_uri);
-
-axis2_char_t* AXIS2_CALL
-axiom_soap_header_block_get_attribute
-(axiom_soap_header_block_t *header_block,
- const axis2_env_t *env,
- const axis2_char_t *attr_name,
- const axis2_char_t *soap_envelope_namespace_uri);
-
-axis2_status_t AXIS2_CALL
-axiom_soap_header_block_set_soap_version(axiom_soap_header_block_t *header_block,
- const axis2_env_t *env,
- int soap_version);
-
-/*************** function implementations *************************************/
+};
AXIS2_EXTERN axiom_soap_header_block_t * AXIS2_CALL
axiom_soap_header_block_create(const axis2_env_t *env)
{
- axiom_soap_header_block_impl_t *header_block_impl = NULL;
+ axiom_soap_header_block_t *header_block = NULL;
AXIS2_ENV_CHECK(env, NULL);
- header_block_impl = (axiom_soap_header_block_impl_t*)AXIS2_MALLOC(
+ header_block = (axiom_soap_header_block_t*)AXIS2_MALLOC(
env->allocator,
- sizeof(axiom_soap_header_block_impl_t));
- if (!header_block_impl)
+ sizeof(axiom_soap_header_block_t));
+ if (!header_block)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- header_block_impl->header_block.ops = NULL;
- header_block_impl->om_ele_node = NULL;
- header_block_impl->soap_version = AXIOM_SOAP_VERSION_NOT_SET;
- header_block_impl->processed = AXIS2_FALSE;
-
- header_block_impl->header_block.ops = (axiom_soap_header_block_ops_t *)AXIS2_MALLOC(
- env->allocator,
- sizeof(axiom_soap_header_block_ops_t));
- if (!(header_block_impl->header_block.ops))
- {
- AXIS2_FREE(env->allocator, header_block_impl);
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
+ header_block->om_ele_node = NULL;
+ header_block->soap_version = AXIOM_SOAP_VERSION_NOT_SET;
+ header_block->processed = AXIS2_FALSE;
- header_block_impl->header_block.ops->free_fn =
- axiom_soap_header_block_free;
- header_block_impl->header_block.ops->set_role =
- axiom_soap_header_block_set_role;
- header_block_impl->header_block.ops->set_must_understand_with_bool =
- axiom_soap_header_block_set_must_understand_with_bool;
- header_block_impl->header_block.ops->set_must_understand_with_string =
- axiom_soap_header_block_set_must_understand_with_string;
- header_block_impl->header_block.ops->get_must_understand =
- axiom_soap_header_block_get_must_understand;
- header_block_impl->header_block.ops->is_processed =
- axiom_soap_header_block_is_processed;
- header_block_impl->header_block.ops->set_processed =
- axiom_soap_header_block_set_processed;
- header_block_impl->header_block.ops->get_role =
- axiom_soap_header_block_get_role;
- header_block_impl->header_block.ops->set_attribute =
- axiom_soap_header_block_set_attribute;
- header_block_impl->header_block.ops->get_attribute =
- axiom_soap_header_block_get_attribute;
-
- header_block_impl->header_block.ops->get_soap_version =
- axiom_soap_header_block_get_soap_version;
-
- header_block_impl->header_block.ops->get_base_node =
- axiom_soap_header_block_get_base_node;
- return &(header_block_impl->header_block);
+ return header_block;
}
@@ -181,7 +58,6 @@
axiom_namespace_t *ns,
axiom_soap_header_t *header)
{
- axiom_soap_header_block_impl_t *header_block_impl = NULL;
axiom_soap_header_block_t *header_block = NULL;
axiom_node_t *this_node = NULL;
axiom_node_t *parent_node = NULL;
@@ -193,8 +69,6 @@
if (!header_block)
return NULL;
- header_block_impl = AXIS2_INTF_TO_IMPL(header_block);
-
parent_node = AXIOM_SOAP_HEADER_GET_BASE_NODE(header, env);
if (!parent_node)
return NULL;
@@ -206,49 +80,42 @@
AXIOM_SOAP_HEADER_BLOCK_FREE(header_block, env);
return NULL;
}
- header_block_impl->om_ele_node = this_node;
+ header_block->om_ele_node = this_node;
axiom_soap_header_set_header_block(header, env, header_block);
- header_block_impl->soap_version =
+ header_block->soap_version =
AXIOM_SOAP_HEADER_GET_SOAP_VERSION(header, env);
- return &(header_block_impl->header_block);
+ return header_block;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_header_block_free(axiom_soap_header_block_t *header_block,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- if (header_block->ops)
- {
- AXIS2_FREE(env->allocator, header_block->ops);
- header_block->ops = NULL;
- }
- AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(header_block));
+ AXIS2_FREE(env->allocator, header_block);
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_header_block_set_role(axiom_soap_header_block_t *header_block,
const axis2_env_t *env,
axis2_char_t *role_uri)
{
- axiom_soap_header_block_impl_t *header_block_impl = NULL;
const axis2_char_t *attr_localname = NULL;
const axis2_char_t *attr_nsuri = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- header_block_impl = AXIS2_INTF_TO_IMPL(header_block);
- if (header_block_impl->soap_version == AXIOM_SOAP_VERSION_NOT_SET)
+ if (header_block->soap_version == AXIOM_SOAP_VERSION_NOT_SET)
return AXIS2_FAILURE;
- if (header_block_impl->soap_version == AXIOM_SOAP11)
+ if (header_block->soap_version == AXIOM_SOAP11)
{
attr_localname = AXIOM_SOAP11_ATTR_ACTOR;
attr_nsuri = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI;
}
- if (header_block_impl->soap_version == AXIOM_SOAP12)
+ if (header_block->soap_version == AXIOM_SOAP12)
{
attr_localname = AXIOM_SOAP12_SOAP_ROLE;
attr_nsuri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;
@@ -258,26 +125,24 @@
return AXIS2_SUCCESS;
}
-axis2_char_t* AXIS2_CALL
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axiom_soap_header_block_get_role
(axiom_soap_header_block_t *header_block,
const axis2_env_t *env)
{
- axiom_soap_header_block_impl_t *header_block_impl = NULL;
const axis2_char_t *attr_localname = NULL;
const axis2_char_t *attr_nsuri = NULL;
AXIS2_ENV_CHECK(env, NULL);
- header_block_impl = AXIS2_INTF_TO_IMPL(header_block);
- if (header_block_impl->soap_version == AXIOM_SOAP_VERSION_NOT_SET)
+ if (header_block->soap_version == AXIOM_SOAP_VERSION_NOT_SET)
return NULL;
- if (header_block_impl->soap_version == AXIOM_SOAP11)
+ if (header_block->soap_version == AXIOM_SOAP11)
{
attr_localname = AXIOM_SOAP11_ATTR_ACTOR;
attr_nsuri = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI;
}
- if (header_block_impl->soap_version == AXIOM_SOAP12)
+ if (header_block->soap_version == AXIOM_SOAP12)
{
attr_localname = AXIOM_SOAP12_SOAP_ROLE;
attr_nsuri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;
@@ -286,27 +151,25 @@
attr_localname, attr_nsuri);
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_header_block_set_must_understand_with_bool
(axiom_soap_header_block_t *header_block,
const axis2_env_t *env,
axis2_bool_t must_understand)
{
- axiom_soap_header_block_impl_t *header_block_impl = NULL;
const axis2_char_t *attr_nsuri = NULL;
const axis2_char_t* attr_value = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- header_block_impl = AXIS2_INTF_TO_IMPL(header_block);
- if (header_block_impl->soap_version == AXIOM_SOAP_VERSION_NOT_SET)
+ if (header_block->soap_version == AXIOM_SOAP_VERSION_NOT_SET)
return AXIS2_FAILURE;
- if (header_block_impl->soap_version == AXIOM_SOAP11)
+ if (header_block->soap_version == AXIOM_SOAP11)
{
attr_nsuri = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI;
}
- if (header_block_impl->soap_version == AXIOM_SOAP12)
+ if (header_block->soap_version == AXIOM_SOAP12)
{
attr_nsuri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;
}
@@ -323,28 +186,25 @@
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_header_block_set_must_understand_with_string
(axiom_soap_header_block_t *header_block,
const axis2_env_t *env,
axis2_char_t *must_understand)
{
- axiom_soap_header_block_impl_t *header_block_impl = NULL;
const axis2_char_t *attr_nsuri = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, must_understand, AXIS2_FAILURE);
- header_block_impl = AXIS2_INTF_TO_IMPL(header_block);
-
- if (header_block_impl->soap_version == AXIOM_SOAP_VERSION_NOT_SET)
+ if (header_block->soap_version == AXIOM_SOAP_VERSION_NOT_SET)
return AXIS2_FAILURE;
- if (header_block_impl->soap_version == AXIOM_SOAP11)
+ if (header_block->soap_version == AXIOM_SOAP11)
{
attr_nsuri = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI;
}
- if (header_block_impl->soap_version == AXIOM_SOAP12)
+ if (header_block->soap_version == AXIOM_SOAP12)
{
attr_nsuri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;
}
@@ -367,24 +227,22 @@
}
}
-axis2_bool_t AXIS2_CALL
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
axiom_soap_header_block_get_must_understand
(axiom_soap_header_block_t *header_block,
const axis2_env_t *env)
{
const axis2_char_t *must_understand = NULL;
- axiom_soap_header_block_impl_t *header_block_impl = NULL;
const axis2_char_t *attr_nsuri = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- header_block_impl = AXIS2_INTF_TO_IMPL(header_block);
- if (header_block_impl->soap_version == AXIOM_SOAP_VERSION_NOT_SET)
+ if (header_block->soap_version == AXIOM_SOAP_VERSION_NOT_SET)
return AXIS2_FAILURE;
- if (header_block_impl->soap_version == AXIOM_SOAP11)
+ if (header_block->soap_version == AXIOM_SOAP11)
{
attr_nsuri = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI;
}
- if (header_block_impl->soap_version == AXIOM_SOAP12)
+ if (header_block->soap_version == AXIOM_SOAP12)
{
attr_nsuri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;
}
@@ -409,7 +267,7 @@
return AXIS2_FALSE;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_header_block_set_attribute
(axiom_soap_header_block_t *header_block,
const axis2_env_t *env,
@@ -417,7 +275,6 @@
const axis2_char_t *attr_value,
const axis2_char_t *soap_envelope_namespace_uri)
{
- axiom_soap_header_block_impl_t *header_block_impl = NULL;
axiom_attribute_t* om_attr = NULL;
axiom_node_t *header_node = NULL;
axiom_element_t *header_ele = NULL;
@@ -430,9 +287,7 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, attr_name, AXIS2_FAILURE);
- header_block_impl = AXIS2_INTF_TO_IMPL(header_block);
-
- header_node = AXIOM_NODE_GET_PARENT(header_block_impl->om_ele_node, env);
+ header_node = AXIOM_NODE_GET_PARENT(header_block->om_ele_node, env);
if (!header_node)
{
return AXIS2_FAILURE;
@@ -455,12 +310,12 @@
if (!qn)
return AXIS2_FAILURE;
- if (!header_block_impl->om_ele_node)
+ if (!header_block->om_ele_node)
return AXIS2_FAILURE;
om_ele = (axiom_element_t *)AXIOM_NODE_GET_DATA_ELEMENT(
- header_block_impl->om_ele_node, env);
+ header_block->om_ele_node, env);
om_attr = AXIOM_ELEMENT_GET_ATTRIBUTE(om_ele, env, qn);
@@ -484,19 +339,18 @@
}
return AXIOM_ELEMENT_ADD_ATTRIBUTE(om_ele, env, om_attr,
- header_block_impl->om_ele_node);
+ header_block->om_ele_node);
}
return AXIS2_SUCCESS;
}
-axis2_char_t* AXIS2_CALL
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axiom_soap_header_block_get_attribute
(axiom_soap_header_block_t *header_block,
const axis2_env_t *env,
const axis2_char_t *attr_name,
const axis2_char_t *soap_envelope_namespace_uri)
{
- axiom_soap_header_block_impl_t *header_block_impl = NULL;
axiom_attribute_t* om_attr = NULL;
axis2_char_t *attr_value = NULL;
axiom_node_t *header_node = NULL;
@@ -508,9 +362,8 @@
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, attr_name, NULL);
AXIS2_PARAM_CHECK(env->error, soap_envelope_namespace_uri, NULL);
- header_block_impl = AXIS2_INTF_TO_IMPL(header_block);
- header_node = AXIOM_NODE_GET_PARENT(header_block_impl->om_ele_node, env);
+ header_node = AXIOM_NODE_GET_PARENT(header_block->om_ele_node, env);
if (!header_node)
{
return NULL;
@@ -531,7 +384,7 @@
if (!qn)
return NULL;
om_ele = (axiom_element_t *)AXIOM_NODE_GET_DATA_ELEMENT(
- header_block_impl->om_ele_node, env);
+ header_block->om_ele_node, env);
om_attr = AXIOM_ELEMENT_GET_ATTRIBUTE(om_ele, env, qn);
if (om_attr)
attr_value = AXIOM_ATTRIBUTE_GET_VALUE(om_attr, env);
@@ -539,73 +392,69 @@
return attr_value;
}
-axis2_bool_t AXIS2_CALL
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
axiom_soap_header_block_is_processed
(axiom_soap_header_block_t *header_block,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- return AXIS2_INTF_TO_IMPL(header_block)->processed;
+ return header_block->processed;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_header_block_set_processed
(axiom_soap_header_block_t *header_block,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_INTF_TO_IMPL(header_block)->processed = AXIS2_TRUE;
+ header_block->processed = AXIS2_TRUE;
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL axiom_soap_header_block_set_base_node
+AXIS2_EXTERN axis2_status_t AXIS2_CALL axiom_soap_header_block_set_base_node
(axiom_soap_header_block_t *header_block,
const axis2_env_t *env,
axiom_node_t *node)
{
- axiom_soap_header_block_impl_t *header_block_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE);
- header_block_impl = AXIS2_INTF_TO_IMPL(header_block);
if (AXIOM_NODE_GET_NODE_TYPE(node, env) != AXIOM_ELEMENT)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- header_block_impl->om_ele_node = node;
+ header_block->om_ele_node = node;
return AXIS2_SUCCESS;
}
-axiom_node_t* AXIS2_CALL
+AXIS2_EXTERN axiom_node_t* AXIS2_CALL
axiom_soap_header_block_get_base_node
(axiom_soap_header_block_t *header_block,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(header_block)->om_ele_node;
+ return header_block->om_ele_node;
}
-int AXIS2_CALL
+AXIS2_EXTERN int AXIS2_CALL
axiom_soap_header_block_get_soap_version
(axiom_soap_header_block_t *header_block,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- return AXIS2_INTF_TO_IMPL(header_block)->soap_version;
+ return header_block->soap_version;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_header_block_set_soap_version
(axiom_soap_header_block_t *header_block,
const axis2_env_t *env,
int soap_version)
{
- axiom_soap_header_block_impl_t *header_block_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- header_block_impl = AXIS2_INTF_TO_IMPL(header_block);
- header_block_impl->soap_version = soap_version;
+ header_block->soap_version = soap_version;
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/axiom/src/soap/soap_message.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/soap/soap_message.c?view=diff&rev=496572&r1=496571&r2=496572
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/soap/soap_message.c (original)
+++ webservices/axis2/trunk/c/axiom/src/soap/soap_message.c Mon Jan 15 18:09:50 2007
@@ -20,141 +20,80 @@
#include <axiom_output.h>
#include "_axiom_soap_envelope.h"
-/*************************** impl struct **************************************/
-
-typedef struct axiom_soap_message_impl_t
+struct axiom_soap_message
{
- axiom_soap_message_t soap_message;
-
axiom_document_t *om_doc;
axiom_soap_envelope_t *soap_envelope;
-
-}
-axiom_soap_message_impl_t;
-
-/*************************** Macro ********************************************/
-
-#define AXIS2_INTF_TO_IMPL(message) ((axiom_soap_message_impl_t*)message)
-
-/******************************************************************************/
-
-axis2_status_t AXIS2_CALL
-axiom_soap_message_free(axiom_soap_message_t *message,
- const axis2_env_t *env);
-
-axiom_soap_envelope_t* AXIS2_CALL
-axiom_soap_message_get_soap_envelope(axiom_soap_message_t *message,
- const axis2_env_t *env);
-
-
-axis2_status_t AXIS2_CALL
-axiom_soap_message_serialize(axiom_soap_message_t *message,
- const axis2_env_t *env,
- axiom_output_t *om_output);
-
-/************************** function implementations **************************/
+};
AXIS2_EXTERN axiom_soap_message_t* AXIS2_CALL
axiom_soap_message_create(const axis2_env_t *env,
axiom_soap_builder_t *builder,
axiom_document_t *om_doc)
{
- axiom_soap_message_impl_t *soap_message_impl = NULL;
+ axiom_soap_message_t *soap_message = NULL;
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, om_doc, NULL);
AXIS2_PARAM_CHECK(env->error, builder, NULL);
- soap_message_impl = (axiom_soap_message_impl_t *)AXIS2_MALLOC(env->allocator,
- sizeof(axiom_soap_message_impl_t));
- if (!soap_message_impl)
+ soap_message = (axiom_soap_message_t *)AXIS2_MALLOC(env->allocator,
+ sizeof(axiom_soap_message_t));
+ if (!soap_message)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- soap_message_impl->soap_message.ops = NULL;
- soap_message_impl->om_doc = NULL;
- soap_message_impl->soap_envelope = NULL;
+ soap_message->om_doc = NULL;
+ soap_message->soap_envelope = NULL;
- soap_message_impl->soap_message.ops = (axiom_soap_message_ops_t*)AXIS2_MALLOC(env->allocator,
- sizeof(axiom_soap_message_ops_t));
-
- if (!(soap_message_impl->soap_message.ops))
- {
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- AXIS2_FREE(env->allocator, soap_message_impl);
- soap_message_impl = NULL;
- return NULL;
- }
-
- soap_message_impl->om_doc = om_doc;
-
- soap_message_impl->soap_message.ops->free_fn =
- axiom_soap_message_free;
- soap_message_impl->soap_message.ops->serialize =
- axiom_soap_message_serialize;
- soap_message_impl->soap_message.ops->get_soap_envelope =
- axiom_soap_message_get_soap_envelope;
-
-
- return &(soap_message_impl->soap_message);
+ return soap_message;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_message_free(axiom_soap_message_t *message,
const axis2_env_t *env)
{
- axiom_soap_message_impl_t *soap_message_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- soap_message_impl = AXIS2_INTF_TO_IMPL(message);
- if (soap_message_impl->om_doc)
- {
- AXIOM_DOCUMENT_FREE(soap_message_impl->om_doc, env);
- soap_message_impl->om_doc = NULL;
- }
- if (soap_message_impl->soap_envelope)
+ if (soap_message->om_doc)
{
- AXIOM_SOAP_ENVELOPE_FREE(soap_message_impl->soap_envelope, env);
- soap_message_impl->soap_envelope = NULL;
+ AXIOM_DOCUMENT_FREE(soap_message->om_doc, env);
+ soap_message->om_doc = NULL;
}
- if (soap_message_impl->soap_message.ops)
+ if (soap_message->soap_envelope)
{
- AXIS2_FREE(env->allocator, soap_message_impl->soap_message.ops);
- soap_message_impl->soap_message.ops = NULL;
+ AXIOM_SOAP_ENVELOPE_FREE(soap_message->soap_envelope, env);
+ soap_message->soap_envelope = NULL;
}
- AXIS2_FREE(env->allocator, soap_message_impl);
- soap_message_impl = NULL;
+ AXIS2_FREE(env->allocator, soap_message);
+ soap_message = NULL;
return AXIS2_SUCCESS;
}
-axiom_soap_envelope_t* AXIS2_CALL
+AXIS2_EXTERN axiom_soap_envelope_t* AXIS2_CALL
axiom_soap_message_get_soap_envelope(axiom_soap_message_t *message,
const axis2_env_t *env)
{
- axiom_soap_message_impl_t* soap_message_impl = NULL;
AXIS2_ENV_CHECK(env, NULL);
- soap_message_impl = AXIS2_INTF_TO_IMPL(message);
- if (soap_message_impl->soap_envelope)
+ if (soap_message->soap_envelope)
{
- return soap_message_impl->soap_envelope;
+ return soap_message->soap_envelope;
}
else
{
- soap_message_impl->soap_envelope = axiom_soap_envelope_create_null(env);
+ soap_message->soap_envelope = axiom_soap_envelope_create_null(env);
- return soap_message_impl->soap_envelope;
+ return soap_message->soap_envelope;
}
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_soap_message_serialize(axiom_soap_message_t *message,
const axis2_env_t *env,
axiom_output_t *om_output)
{
- axiom_soap_message_impl_t *soap_message_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- soap_message_impl = AXIS2_INTF_TO_IMPL(message);
- return AXIOM_DOCUMENT_SERIALIZE(soap_message_impl->om_doc, env, om_output);
+ return AXIOM_DOCUMENT_SERIALIZE(soap_message->om_doc, env, om_output);
}
Modified: webservices/axis2/trunk/c/util/include/axis2_env.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/include/axis2_env.h?view=diff&rev=496572&r1=496571&r2=496572
==============================================================================
--- webservices/axis2/trunk/c/util/include/axis2_env.h (original)
+++ webservices/axis2/trunk/c/util/include/axis2_env.h Mon Jan 15 18:09:50 2007
@@ -182,11 +182,13 @@
#define AXIS2_LOG(env, message, level) axis2_env_write_log (env,message, level)
-#define AXIS2_ENV_CHECK(env, error_return) \
+/*#define AXIS2_ENV_CHECK(env, error_return) \
if(!env) \
{ \
return error_return; \
- }
+ }*/
+
+#define AXIS2_ENV_CHECK(env, error_return)
/** @} */
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org