You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by na...@apache.org on 2005/12/22 09:28:18 UTC
svn commit: r358528 - in /webservices/axis2/trunk/c: include/
modules/xml/soap/src/
Author: nandika
Date: Thu Dec 22 00:28:03 2005
New Revision: 358528
URL: http://svn.apache.org/viewcvs?rev=358528&view=rev
Log: (empty)
Added:
webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_code.c
webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_detail.c
Modified:
webservices/axis2/trunk/c/include/axis2_error.h
webservices/axis2/trunk/c/include/axis2_soap_fault_code.h
webservices/axis2/trunk/c/include/axis2_soap_fault_detail.h
webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_node.c
webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_role.c
webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_sub_code.c
Modified: webservices/axis2/trunk/c/include/axis2_error.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_error.h?rev=358528&r1=358527&r2=358528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_error.h (original)
+++ webservices/axis2/trunk/c/include/axis2_error.h Thu Dec 22 00:28:03 2005
@@ -289,7 +289,7 @@
AXIS2_ERROR_NULL_CONFIGURATION_CONTEXT,
/* We need transport_info in msg_ctx*/
AXIS2_ERROR_OUT_TRNSPORT_INFO_NULL,
-
+ /** invalid type passed */
AXIS2_ERROR_INVALID_BASE_TYPE,
/** Response timed out */
AXIS2_ERROR_RESPONSE_TIMED_OUT,
@@ -297,6 +297,9 @@
AXIS2_ERROR_BLOCKING_INVOCATION_EXPECTS_RESPONSE,
/** Client side support only one configuration context */
AXIS2_ERROR_CLIENT_SIDE_SUPPORT_ONLY_ONE_CONF_CTX,
+ /** om element is expected */
+ AXIS2_ERROR_OM_ELEMENT_EXPECTED,
+
AXIS2_ERROR_INVALID_HTTP_INVALID_HEADER_START_LINE
};
Modified: webservices/axis2/trunk/c/include/axis2_soap_fault_code.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap_fault_code.h?rev=358528&r1=358527&r2=358528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_fault_code.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_fault_code.h Thu Dec 22 00:28:03 2005
@@ -60,12 +60,12 @@
axis2_env_t **env,
axis2_soap_fault_value_t *fault_val);
- axis2_soap_fault_sub_code_t* (AXIS2_CALL *set_subcode)
+ axis2_status_t (AXIS2_CALL *set_sub_code)
(axis2_soap_fault_code_t *fault_code,
axis2_env_t **env,
axis2_soap_fault_sub_code_t *fault_subcode);
- axis2_status_t (AXIS2_CALL *get_subcode)
+ axis2_soap_fault_sub_code_t* (AXIS2_CALL *get_sub_code)
(axis2_soap_fault_code_t *fault_code,
axis2_env_t **env);
@@ -79,9 +79,18 @@
axis2_om_node_t *node);
axis2_om_node_t* (AXIS2_CALL *get_base_node)
- (axis2_soap_fault_code_t *fault_code,
- axis2_env_t **env);
-
+ (axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env);
+
+ int (AXIS2_CALL *get_soap_version)
+ (axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env);
+
+ axis2_status_t (AXIS2_CALL *set_soap_version)
+ (axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env,
+ int soap_version);
+
};
/**
@@ -101,7 +110,8 @@
*/
AXIS2_DECLARE(axis2_soap_fault_code_t *)
axis2_soap_fault_code_create_with_parent(axis2_env_t **env,
- axis2_soap_fault_t *fault);
+ axis2_soap_fault_t *fault,
+ axis2_bool_t extract_ns_from_parent);
AXIS2_DECLARE(axis2_soap_fault_code_t *)
@@ -115,28 +125,32 @@
((fault_code)->ops->free_fn(fault_code, env))
#define AXIS2_SOAP_FAULT_CODE_SET_SUB_CODE(fault_code , env, subcode) \
- ((fault_code)->ops->set_subcode(fault_code, env, subcode))
+ ((fault_code)->ops->set_sub_code(fault_code, env, subcode))
+
+#define AXIS2_SOAP_FAULT_CODE_GET_SUB_CODE(fault_code , env) \
+ ((fault_code)->ops->get_sub_code(fault_code, env))
#define AXIS2_SOAP_FAULT_CODE_SET_VALUE(fault_code , env, value) \
((fault_code)->ops->set_value(fault_code, env, value))
-
#define AXIS2_SOAP_FAULT_CODE_GET_VALUE(fault_code , env) \
((fault_code)->ops->get_node(fault_code, env))
-#define AXIS2_SOAP_FAULT_CODE_GET_SUB_CODE(fault_code , env) \
- ((fault_code)->ops->get_subcode(fault_code, env))
-
#define AXIS2_SOAP_FAULT_CODE_GET_BASE_NODE(fault_code, env) \
((fault_code)->ops->get_base_node(fault_code, env))
#define AXIS2_SOAP_FAULT_CODE_SET_BASE_NODE(fault_code, env, node) \
((fault_code)->ops->set_base_node(fault_code, env, node))
+
+#define AXIS2_SOAP_FAULT_CODE_SET_SOAP_VERSION(fault_code, env, version) \
+ ((fault_code)->ops->set_soap_version(fault_code, env, version))
+
+#define AXIS2_SOAP_FAULT_CODE_GET_SOAP_VERSION(fault_code, env) \
+ ((fault_code)->ops->get_soap_version(fault_code, env))
+
/** @} */
#ifdef __cplusplus
}
#endif
-
-
- #endif /* AXIS2_SOAP_FAULT_CODE_H */
\ No newline at end of file
+#endif /* AXIS2_SOAP_FAULT_CODE_H */
\ No newline at end of file
Modified: webservices/axis2/trunk/c/include/axis2_soap_fault_detail.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap_fault_detail.h?rev=358528&r1=358527&r2=358528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_fault_detail.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_fault_detail.h Thu Dec 22 00:28:03 2005
@@ -68,13 +68,22 @@
axis2_env_t **env);
axis2_status_t (AXIS2_CALL *set_base_node)
- (axis2_soap_fault_code_t *fault_code,
+ (axis2_soap_fault_detail_t *fault_detail,
axis2_env_t **env,
axis2_om_node_t *node);
axis2_om_node_t* (AXIS2_CALL *get_base_node)
- (axis2_soap_fault_code_t *fault_code,
+ (axis2_soap_fault_detail_t *fault_code,
axis2_env_t **env);
+
+ int (AXIS2_CALL *get_soap_version)
+ (axis2_soap_fault_detail_t *fault_node,
+ axis2_env_t **env);
+
+ axis2_status_t (AXIS2_CALL *set_soap_version)
+ (axis2_soap_fault_detail_t *fault_node,
+ axis2_env_t **env,
+ int soap_version);
};
@@ -93,19 +102,15 @@
* creates a soap struct
* @param env Environment. MUST NOT be NULL
*/
-AXIS2_DECLARE(axis2_soap_fault_detail_t *)
-axis2_soap_fault_detail_create_with_parent(axis2_env_t **env,
- axis2_soap_fault_t *fault);
-
AXIS2_DECLARE(axis2_soap_fault_detail_t *)
axis2_soap_fault_detail_create(axis2_env_t **env);
AXIS2_DECLARE(axis2_soap_fault_detail_t *)
-axis2_soap_fault_detail_create_with_parent_extract
- (axis2_env_t **env,
- axis2_soap_fault_t *fault,
- axis2_bool_t *extract_ns_from_parent);
+axis2_soap_fault_detail_create_with_parent
+ (axis2_env_t **env,
+ axis2_soap_fault_t *fault,
+ axis2_bool_t *extract_ns_from_parent);
/******************** Macros **************************************************/
@@ -124,7 +129,13 @@
((fault_detail)->ops->get_base_node(fault_detail, env))
#define AXIS2_SOAP_FAULT_DETAIL_SET_BASE(fault_detail, env, node) \
- ((fault_detail)->ops->set_base_node(fault_detail, env, node))
+ ((fault_detail)->ops->set_base_node(fault_detail, env, node))
+
+#define AXIS2_SOAP_FAULT_DETAIL_GET_SOAP_VERSION(fault_detail, env) \
+ ((fault_detail)->ops->get_soap_version(fault_detail, env))
+
+#define AXIS2_SOAP_FAULT_DETAIL_SET_SOAP_VERSION(fault_detail, env, version) \
+ ((fault_detail)->ops->set_soap_version(fault_detail, env, version))
/** @} */
#ifdef __cplusplus
Added: webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_code.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_code.c?rev=358528&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_code.c (added)
+++ webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_code.c Thu Dec 22 00:28:03 2005
@@ -0,0 +1,397 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ #include <axis2_soap_fault_code.h>
+ #include <axis2_soap_fault_sub_code.h>
+ #include <axis2_soap_fault_value.h>
+ #include <axis2_soap_utils.h>
+
+ /***************** impl struct ***********************************************/
+
+ typedef struct axis2_soap_fault_code_impl_t
+ {
+ axis2_soap_fault_code_t fault_code;
+
+ axis2_om_element_t *om_ele;
+
+ axis2_om_node_t *om_ele_node;
+
+ int soap_version;
+
+ axis2_soap_fault_sub_code_t *subcode;
+
+ axis2_soap_fault_value_t *value;
+
+ axis2_soap_fault_t *parent;
+
+ }axis2_soap_fault_code_impl_t;
+
+ /******************** Macro **************************************************/
+
+ #define AXIS2_INTF_TO_IMPL(code) ((axis2_soap_fault_code_impl_t*)code)
+
+ /******************** function prototypes ************************************/
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_code_free(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_code_set_value(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env,
+ axis2_soap_fault_value_t *fault_val);
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_code_set_sub_code(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env,
+ axis2_soap_fault_sub_code_t *fault_subcode);
+
+axis2_soap_fault_sub_code_t* AXIS2_CALL
+axis2_soap_fault_code_get_sub_code(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env);
+
+axis2_soap_fault_value_t* AXIS2_CALL
+axis2_soap_fault_code_get_value(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_code_set_base_node(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env,
+ axis2_om_node_t *node);
+
+axis2_om_node_t* AXIS2_CALL
+axis2_soap_fault_code_get_base_node(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_code_set_soap_version(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env,
+ int soap_version);
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_code_get_soap_version(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env);
+
+/********************* function implementation ********************************/
+
+AXIS2_DECLARE(axis2_soap_fault_code_t *)
+axis2_soap_fault_code_create(axis2_env_t **env)
+{
+ axis2_soap_fault_code_impl_t *fault_code_impl = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ fault_code_impl = (axis2_soap_fault_code_impl_t*) AXIS2_MALLOC(
+ (*env)->allocator,
+ sizeof(axis2_soap_fault_code_impl_t));
+ if(!fault_code_impl)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ fault_code_impl->fault_code.ops = NULL;
+ fault_code_impl->om_ele = NULL;
+ fault_code_impl->om_ele_node = NULL;
+
+ fault_code_impl->soap_version = AXIS2_SOAP_VERSION_NOT_SET;
+ fault_code_impl->parent = NULL;
+
+ fault_code_impl->fault_code.ops =
+ (axis2_soap_fault_code_ops_t*)AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_soap_fault_code_ops_t));
+
+ if(!(fault_code_impl->fault_code.ops))
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_FREE((*env)->allocator, fault_code_impl);
+ return NULL;
+ }
+
+ fault_code_impl->fault_code.ops->free_fn =
+ axis2_soap_fault_code_free;
+
+ fault_code_impl->fault_code.ops->get_sub_code =
+ axis2_soap_fault_code_get_sub_code;
+
+ fault_code_impl->fault_code.ops->set_sub_code =
+ axis2_soap_fault_code_set_sub_code;
+
+ fault_code_impl->fault_code.ops->set_value =
+ axis2_soap_fault_code_set_value;
+
+ fault_code_impl->fault_code.ops->get_value =
+ axis2_soap_fault_code_get_value;
+
+ fault_code_impl->fault_code.ops->set_base_node =
+ axis2_soap_fault_code_set_base_node;
+
+ fault_code_impl->fault_code.ops->get_base_node =
+ axis2_soap_fault_code_get_base_node;
+
+ fault_code_impl->fault_code.ops->get_soap_version =
+ axis2_soap_fault_code_get_soap_version;
+
+ fault_code_impl->fault_code.ops->set_soap_version =
+ axis2_soap_fault_code_set_soap_version;
+
+ return &(fault_code_impl->fault_code);
+}
+
+AXIS2_DECLARE(axis2_soap_fault_code_t *)
+axis2_soap_fault_code_create_with_parent(axis2_env_t **env,
+ axis2_soap_fault_t *fault,
+ axis2_bool_t extract_ns_from_parent)
+{
+ axis2_soap_fault_code_impl_t *fault_code_impl = NULL;
+ axis2_soap_fault_code_t *fault_code = NULL;
+ axis2_om_element_t *this_ele = NULL;
+ axis2_om_node_t *this_node = NULL;
+ axis2_om_node_t *parent_node = NULL;
+ axis2_om_element_t *parent_ele = NULL;
+ axis2_om_namespace_t *parent_ns = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ AXIS2_PARAM_CHECK((*env)->error, fault, NULL);
+
+ fault_code = axis2_soap_fault_code_create(env);
+ if(!fault_code)
+ return NULL;
+
+ fault_code_impl = AXIS2_INTF_TO_IMPL(fault_code);
+
+ fault_code_impl->parent = fault;
+
+ parent_node = AXIS2_SOAP_FAULT_GET_BASE_NODE(fault, env);
+
+ parent_ele = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(
+ fault_code_impl->om_ele_node, env);
+
+ if(extract_ns_from_parent)
+ {
+ parent_ns = AXIS2_OM_ELEMENT_GET_NAMESPACE(parent_ele, env);
+ }
+
+ this_ele = axis2_om_element_create(env,
+ parent_node,
+ AXIS2_SOAP12_SOAP_FAULT_CODE_LOCAL_NAME,
+ parent_ns,
+ &this_node);
+ fault_code_impl->om_ele = this_ele;
+ fault_code_impl->om_ele_node = this_node;
+ return &(fault_code_impl->fault_code);
+}
+
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_code_free(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env)
+{
+ axis2_soap_fault_code_impl_t *fault_code_impl = NULL;
+ AXIS2_FUNC_PARAM_CHECK(fault_code, env, AXIS2_FAILURE);
+ fault_code_impl = AXIS2_INTF_TO_IMPL(fault_code);
+ if(fault_code_impl->subcode)
+ {
+ AXIS2_SOAP_FAULT_SUB_CODE_FREE(fault_code_impl->subcode, env);
+ fault_code_impl->subcode = NULL;
+ }
+ if(fault_code_impl->value)
+ {
+ AXIS2_SOAP_FAULT_VALUE_FREE(fault_code_impl->value, env);
+ fault_code_impl->value = NULL;
+ }
+ if(fault_code->ops)
+ {
+ AXIS2_FREE((*env)->allocator, fault_code->ops);
+ fault_code->ops = NULL;
+ }
+ AXIS2_FREE((*env)->allocator, fault_code_impl);
+ fault_code_impl = NULL;
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_code_set_value(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env,
+ axis2_soap_fault_value_t *fault_val)
+{
+ axis2_soap_fault_code_impl_t *fault_code_impl = NULL;
+ axis2_om_node_t *value_node = NULL;
+ axis2_om_node_t *this_node = NULL;
+ axis2_om_node_t *my_node = NULL;
+
+ AXIS2_FUNC_PARAM_CHECK(fault_code, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, fault_val, AXIS2_FAILURE);
+
+ fault_code_impl = AXIS2_INTF_TO_IMPL(fault_code);
+ if(fault_code_impl->value)
+ {
+ my_node = AXIS2_SOAP_FAULT_VALUE_GET_BASE_NODE(
+ fault_code_impl->value, env);
+ AXIS2_SOAP_FAULT_SUB_CODE_FREE(fault_code_impl->value, env);
+ fault_code_impl->value = NULL;
+ }
+
+ value_node = AXIS2_SOAP_FAULT_VALUE_GET_BASE_NODE(
+ fault_val, env);
+
+ axis2_soap_utils_set_new_node(env,
+ fault_code_impl->om_ele_node,
+ &my_node,
+ value_node);
+
+ fault_code_impl->value = fault_val;
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_code_set_sub_code(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env,
+ axis2_soap_fault_sub_code_t *fault_subcode)
+{
+ axis2_soap_fault_code_impl_t *fault_code_impl = NULL;
+ axis2_om_node_t *subcode_node = NULL;
+ axis2_om_node_t *this_node = NULL;
+ axis2_om_node_t *my_node = NULL;
+
+ AXIS2_FUNC_PARAM_CHECK(fault_code, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, fault_subcode, AXIS2_FAILURE);
+
+ fault_code_impl = AXIS2_INTF_TO_IMPL(fault_code);
+ if(fault_code_impl->subcode)
+ {
+ my_node = AXIS2_SOAP_FAULT_SUB_CODE_GET_BASE_NODE(
+ fault_code_impl->subcode, env);
+ AXIS2_SOAP_FAULT_SUB_CODE_FREE(fault_code_impl->subcode, env);
+ fault_code_impl->subcode = NULL;
+ }
+
+ subcode_node = AXIS2_SOAP_FAULT_SUB_CODE_GET_BASE_NODE(
+ fault_subcode, env);
+
+ axis2_soap_utils_set_new_node(env,
+ fault_code_impl->om_ele_node,
+ &my_node,
+ subcode_node);
+
+ fault_code_impl->subcode = fault_subcode;
+ return AXIS2_SUCCESS;
+}
+
+axis2_soap_fault_sub_code_t* AXIS2_CALL
+axis2_soap_fault_code_get_sub_code(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env)
+{
+ axis2_soap_fault_code_impl_t *fault_code_impl = NULL;
+ axis2_om_node_t *subcode_node = NULL;
+ axis2_om_node_t *this_node = NULL;
+ axis2_soap_fault_sub_code_t* subcode = NULL;
+
+ AXIS2_FUNC_PARAM_CHECK(fault_code, env, NULL);
+ AXIS2_PARAM_CHECK((*env)->error, fault_code, NULL);
+ fault_code_impl = AXIS2_INTF_TO_IMPL(fault_code);
+ this_node = fault_code_impl->om_ele_node;
+
+
+ if(!(fault_code_impl->subcode))
+ {
+ subcode_node = axis2_soap_utils_get_child_with_name(env,
+ this_node,
+ AXIS2_SOAP12_SOAP_FAULT_SUB_CODE_LOCAL_NAME);
+
+ subcode = axis2_soap_fault_sub_code_create(env);
+ AXIS2_SOAP_FAULT_SUB_CODE_SET_BASE_NODE(subcode , env, subcode_node);
+ fault_code_impl->subcode = subcode;
+ }
+ return fault_code_impl->subcode;
+
+}
+
+axis2_soap_fault_value_t* AXIS2_CALL
+axis2_soap_fault_code_get_value(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env)
+{
+ axis2_soap_fault_code_impl_t *fault_code_impl = NULL;
+ axis2_om_node_t *value_node = NULL;
+ axis2_om_node_t *this_node = NULL;
+ axis2_soap_fault_value_t* fault_value = NULL;
+
+ AXIS2_FUNC_PARAM_CHECK(fault_code, env, NULL);
+ fault_code_impl = AXIS2_INTF_TO_IMPL(fault_code);
+ this_node = AXIS2_SOAP_FAULT_SUB_CODE_GET_BASE_NODE(fault_code, env);
+
+
+ if(!(fault_code_impl->value))
+ {
+ value_node = axis2_soap_utils_get_child_with_name(env,
+ this_node,
+ AXIS2_SOAP12_SOAP_FAULT_VALUE_LOCAL_NAME);
+
+ fault_value = axis2_soap_fault_value_create(env);
+ AXIS2_SOAP_FAULT_VALUE_SET_BASE_NODE(fault_value, env, value_node);
+ AXIS2_SOAP_FAULT_VALUE_SET_SOAP_VERSION(fault_value, env, AXIS2_SOAP11);
+ fault_code_impl->value = fault_value;
+ }
+ return fault_code_impl->value;
+
+}
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_code_set_base_node(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env,
+ axis2_om_node_t *node)
+{
+ axis2_soap_fault_code_impl_t *fault_code_impl = NULL;
+ AXIS2_FUNC_PARAM_CHECK(fault_code, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, node, AXIS2_FAILURE);
+ fault_code_impl = AXIS2_INTF_TO_IMPL(fault_code);
+
+ if(AXIS2_OM_NODE_GET_NODE_TYPE(node, env) != AXIS2_OM_ELEMENT)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+ fault_code_impl->om_ele_node = node;
+ fault_code_impl->om_ele = (axis2_om_element_t *)
+ AXIS2_OM_NODE_GET_DATA_ELEMENT(node, env);
+ return AXIS2_SUCCESS;
+
+}
+
+axis2_om_node_t* AXIS2_CALL
+axis2_soap_fault_code_get_base_node(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(fault_code, env, NULL);
+ return AXIS2_INTF_TO_IMPL(fault_code)->om_ele_node;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_code_set_soap_version(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env,
+ int soap_version)
+{
+ AXIS2_FUNC_PARAM_CHECK(fault_code, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, soap_version, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(fault_code)->soap_version = soap_version;
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_code_get_soap_version(axis2_soap_fault_code_t *fault_code,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(fault_code, env, AXIS2_FAILURE);
+ return AXIS2_INTF_TO_IMPL(fault_code)->soap_version;
+}
Added: webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_detail.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_detail.c?rev=358528&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_detail.c (added)
+++ webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_detail.c Thu Dec 22 00:28:03 2005
@@ -0,0 +1,286 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ #include <axis2_soap_fault.h>
+ #include <axis2_om_element.h>
+ #include <axis2_om_node.h>
+ #include <axis2_soap_fault_detail.h>
+
+/******************** impl struct ********************************************/
+
+ typedef struct axis2_soap_fault_detail_impl_t
+ {
+ axis2_soap_fault_detail_t fault_detail;
+
+ axis2_om_node_t *om_ele_node;
+
+ axis2_om_element_t *om_ele;
+
+ int soap_version;
+
+ axis2_soap_fault_t *parent;
+
+ }axis2_soap_fault_detail_impl_t;
+
+/***************** Macro *****************************************************/
+
+ #define AXIS2_INTF_TO_IMPL(detail) ((axis2_soap_fault_detail_impl_t*)detail)
+
+/****************** function prototypes ***************************************/
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_detail_free(axis2_soap_fault_detail_t *fault_detail,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_detail_add_detail_entry
+ (axis2_soap_fault_detail_t *fault_detail,
+ axis2_env_t **env,
+ axis2_om_node_t *ele_node);
+
+axis2_om_children_iterator_t* AXIS2_CALL
+axis2_soap_fault_detail_get_all_detail_entries
+ (axis2_soap_fault_detail_t *fault_detail,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_detail_set_base_node
+ (axis2_soap_fault_detail_t *fault_detail,
+ axis2_env_t **env,
+ axis2_om_node_t *node);
+
+axis2_om_node_t* AXIS2_CALL
+axis2_soap_fault_detail_get_base_node
+ (axis2_soap_fault_detail_t *fault_code,
+ axis2_env_t **env);
+
+int AXIS2_CALL
+axis2_soap_fault_detail_get_soap_version
+ (axis2_soap_fault_detail_t *fault_node,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_detail_set_soap_version
+ (axis2_soap_fault_detail_t *fault_node,
+ axis2_env_t **env,
+ int soap_version);
+
+/******************** function implementations ********************************/
+
+AXIS2_DECLARE(axis2_soap_fault_detail_t *)
+axis2_soap_fault_detail_create(axis2_env_t **env)
+{
+ axis2_soap_fault_detail_impl_t *fault_detail_impl = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+
+ fault_detail_impl = (axis2_soap_fault_detail_impl_t*)AXIS2_MALLOC(
+ (*env)->allocator,
+ sizeof(axis2_soap_fault_detail_impl_t));
+ if(!fault_detail_impl)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ fault_detail_impl->fault_detail.ops = NULL;
+ fault_detail_impl->om_ele = NULL;
+ fault_detail_impl->om_ele_node = NULL;
+ fault_detail_impl->soap_version = AXIS2_SOAP_VERSION_NOT_SET;
+ fault_detail_impl->parent = NULL;
+
+
+ fault_detail_impl->fault_detail.ops = (axis2_soap_fault_detail_ops_t*)AXIS2_MALLOC(
+ (*env)->allocator,
+ sizeof(axis2_soap_fault_detail_ops_t));
+ if(!(fault_detail_impl->fault_detail.ops))
+ {
+ AXIS2_FREE((*env)->allocator, fault_detail_impl);
+ fault_detail_impl = NULL;
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ fault_detail_impl->fault_detail.ops->free_fn =
+ axis2_soap_fault_detail_free;
+
+ fault_detail_impl->fault_detail.ops->add_detail_entry =
+ axis2_soap_fault_detail_add_detail_entry;
+
+ fault_detail_impl->fault_detail.ops->get_all_detail_entries =
+ axis2_soap_fault_detail_get_all_detail_entries;
+
+ fault_detail_impl->fault_detail.ops->get_base_node =
+ axis2_soap_fault_detail_get_base_node;
+
+ fault_detail_impl->fault_detail.ops->set_base_node =
+ axis2_soap_fault_detail_set_base_node;
+
+ fault_detail_impl->fault_detail.ops->get_soap_version =
+ axis2_soap_fault_detail_get_soap_version;
+
+ fault_detail_impl->fault_detail.ops->set_soap_version =
+ axis2_soap_fault_detail_set_soap_version;
+
+ return &(fault_detail_impl->fault_detail);
+}
+
+AXIS2_DECLARE(axis2_soap_fault_detail_t *)
+axis2_soap_fault_detail_create_with_parent
+ (axis2_env_t **env,
+ axis2_soap_fault_t *fault,
+ axis2_bool_t *extract_ns_from_parent)
+{
+ axis2_soap_fault_detail_impl_t *fault_detail_impl = NULL;
+ axis2_soap_fault_detail_t *fault_detail = NULL;
+ axis2_om_element_t *this_ele = NULL;
+ axis2_om_node_t *this_node = NULL;
+ axis2_om_node_t *parent_node = NULL;
+ axis2_om_element_t *parent_ele = NULL;
+ axis2_om_namespace_t *parent_ns = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ AXIS2_PARAM_CHECK((*env)->error, fault, NULL);
+
+ fault_detail = axis2_soap_fault_detail_create(env);
+ if(!fault_detail)
+ return NULL;
+
+ fault_detail_impl = AXIS2_INTF_TO_IMPL(fault_detail);
+
+ fault_detail_impl->parent = fault;
+
+ parent_node = AXIS2_SOAP_FAULT_GET_BASE_NODE(fault, env);
+
+ parent_ele = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(
+ fault_detail_impl->om_ele_node, env);
+
+ if(extract_ns_from_parent)
+ {
+ parent_ns = AXIS2_OM_ELEMENT_GET_NAMESPACE(parent_ele, env);
+ }
+
+ this_ele = axis2_om_element_create(env,
+ parent_node,
+ AXIS2_SOAP12_SOAP_FAULT_DETAIL_LOCAL_NAME,
+ parent_ns,
+ &this_node);
+ fault_detail_impl->om_ele = this_ele;
+ fault_detail_impl->om_ele_node = this_node;
+ return &(fault_detail_impl->fault_detail);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_detail_free(axis2_soap_fault_detail_t *fault_detail,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(fault_detail, env, AXIS2_FAILURE);
+ if(fault_detail->ops)
+ {
+ AXIS2_FREE((*env)->allocator, fault_detail->ops);
+ fault_detail->ops = NULL;
+ }
+ AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(fault_detail));
+ fault_detail = NULL;
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_detail_add_detail_entry
+ (axis2_soap_fault_detail_t *fault_detail,
+ axis2_env_t **env,
+ axis2_om_node_t *node)
+{
+ axis2_soap_fault_detail_impl_t *fault_detail_impl = NULL;
+ AXIS2_FUNC_PARAM_CHECK(fault_detail, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, node, AXIS2_FAILURE);
+ fault_detail_impl = AXIS2_INTF_TO_IMPL(fault_detail);
+
+ if(AXIS2_OM_NODE_GET_NODE_TYPE(node, env) != AXIS2_OM_ELEMENT)
+ {
+ AXIS2_ERROR_SET((*env)->error,
+ AXIS2_ERROR_OM_ELEMENT_EXPECTED, AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+
+ AXIS2_OM_NODE_ADD_CHILD(node, env, fault_detail_impl->om_ele_node);
+ return AXIS2_SUCCESS;
+}
+
+axis2_om_children_iterator_t* AXIS2_CALL
+axis2_soap_fault_detail_get_all_detail_entries
+ (axis2_soap_fault_detail_t *fault_detail,
+ axis2_env_t **env)
+{
+ axis2_soap_fault_detail_impl_t *fault_detail_impl = NULL;
+ AXIS2_FUNC_PARAM_CHECK(fault_detail, env, NULL);
+ fault_detail_impl = AXIS2_INTF_TO_IMPL(fault_detail);
+
+ return AXIS2_OM_ELEMENT_GET_CHILDREN(fault_detail_impl->om_ele, env,
+ fault_detail_impl->om_ele_node);
+}
+
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_detail_set_base_node
+ (axis2_soap_fault_detail_t *fault_detail,
+ axis2_env_t **env,
+ axis2_om_node_t *node)
+{
+ axis2_soap_fault_detail_impl_t *fault_detail_impl = NULL;
+ AXIS2_FUNC_PARAM_CHECK(fault_detail, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, node, AXIS2_FAILURE);
+ fault_detail_impl = AXIS2_INTF_TO_IMPL(fault_detail);
+
+ if(AXIS2_OM_NODE_GET_NODE_TYPE(node, env) != AXIS2_OM_ELEMENT)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+ fault_detail_impl->om_ele_node = node;
+ fault_detail_impl->om_ele = (axis2_om_element_t *)
+ AXIS2_OM_NODE_GET_DATA_ELEMENT(node, env);
+ return AXIS2_SUCCESS;
+}
+
+axis2_om_node_t* AXIS2_CALL
+axis2_soap_fault_detail_get_base_node
+ (axis2_soap_fault_detail_t *fault_detail,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(fault_detail, env, NULL);
+ return AXIS2_INTF_TO_IMPL(fault_detail)->om_ele_node;
+}
+
+int AXIS2_CALL
+axis2_soap_fault_detail_get_soap_version
+ (axis2_soap_fault_detail_t *fault_detail,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(fault_detail, env, AXIS2_FAILURE);
+ return AXIS2_INTF_TO_IMPL(fault_detail)->soap_version;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_soap_fault_detail_set_soap_version
+ (axis2_soap_fault_detail_t *fault_detail,
+ axis2_env_t **env,
+ int soap_version)
+{
+ AXIS2_FUNC_PARAM_CHECK(fault_detail, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, soap_version, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(fault_detail)->soap_version = soap_version;
+ return AXIS2_SUCCESS;
+}
\ No newline at end of file
Modified: webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_node.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_node.c?rev=358528&r1=358527&r2=358528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_node.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_node.c Thu Dec 22 00:28:03 2005
@@ -161,7 +161,7 @@
parent_ns = AXIS2_OM_ELEMENT_GET_NAMESPACE(parent_ele, env);
this_ele = axis2_om_element_create(env,
parent_node,
- AXIS2_SOAP12_SOAP_FAULT_ROLE_LOCAL_NAME,
+ AXIS2_SOAP12_SOAP_FAULT_NODE_LOCAL_NAME,
parent_ns,
&this_node);
fault_node_impl->om_ele = this_ele;
Modified: webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_role.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_role.c?rev=358528&r1=358527&r2=358528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_role.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_role.c Thu Dec 22 00:28:03 2005
@@ -252,8 +252,6 @@
fault_role_impl->om_ele = (axis2_om_element_t *)
AXIS2_OM_NODE_GET_DATA_ELEMENT(node, env);
return AXIS2_SUCCESS;
-
-
}
axis2_om_node_t* AXIS2_CALL
Modified: webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_sub_code.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_sub_code.c?rev=358528&r1=358527&r2=358528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_sub_code.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_fault_sub_code.c Thu Dec 22 00:28:03 2005
@@ -326,7 +326,6 @@
axis2_soap_fault_sub_code_t* subcode = NULL;
AXIS2_FUNC_PARAM_CHECK(fault_sub_code, env, NULL);
- AXIS2_PARAM_CHECK((*env)->error, fault_sub_code, NULL);
fault_subcode_impl = AXIS2_INTF_TO_IMPL(fault_sub_code);
this_node = fault_subcode_impl->om_ele_node;