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/23 12:00:34 UTC
svn commit: r358789 - in /webservices/axis2/trunk/c:
include/axis2_soap_envelope.h include/axis2_soap_header.h
modules/xml/soap/src/axis2_soap_header.c
Author: nandika
Date: Fri Dec 23 03:00:25 2005
New Revision: 358789
URL: http://svn.apache.org/viewcvs?rev=358789&view=rev
Log: (empty)
Added:
webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_header.c
Modified:
webservices/axis2/trunk/c/include/axis2_soap_envelope.h
webservices/axis2/trunk/c/include/axis2_soap_header.h
Modified: webservices/axis2/trunk/c/include/axis2_soap_envelope.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap_envelope.h?rev=358789&r1=358788&r2=358789&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_envelope.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_envelope.h Fri Dec 23 03:00:25 2005
@@ -128,7 +128,7 @@
((envelope)->ops->get_body(envelope, env))
#define AXIS2_SOAP_ENVELOPE_GET_BASE_NODE(envelope , env) \
- ((envelope)->ops->GET_BASE_NODE(envelope, env))
+ ((envelope)->ops->get_base_node(envelope, env))
#define AXIS2_SOAP_ENVELOPE_SET_BASE_NODE(envelope , env) \
((envelope)->ops->set_base_node(envelope, env))
Modified: webservices/axis2/trunk/c/include/axis2_soap_header.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap_header.h?rev=358789&r1=358788&r2=358789&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_header.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_header.h Fri Dec 23 03:00:25 2005
@@ -89,18 +89,18 @@
* destination.
*/
axis2_hash_t* (AXIS2_CALL *examine_header_blocks)
- (axis2_soap_header_t* header,
- axis2_env_t **env,
- axis2_char_t* param_role);
+ (axis2_soap_header_t* header,
+ axis2_env_t **env,
+ axis2_char_t* param_role);
axis2_om_children_qname_iterator_t* (AXIS2_CALL *examine_all_header_blocks)
- (axis2_soap_header_t* header,
- axis2_env_t **env);
+ (axis2_soap_header_t* header,
+ axis2_env_t **env);
axis2_om_children_with_specific_attribute_iterator_t *
- (AXIS2_CALL *extract_header_blocks)(axis2_soap_header_t *header,
- axis2_env_t **env,
- axis2_char_t *role);
+ (AXIS2_CALL *extract_header_blocks)(axis2_soap_header_t *header,
+ axis2_env_t **env,
+ axis2_char_t *role);
@@ -108,12 +108,23 @@
* This is only intended to be used by the builder,
* do not use this function in other places
*/
- axis2_status_t (AXIS2_CALL *set_base_node)(axis2_soap_header_t *header,
- axis2_env_t **env,
- axis2_om_node_t *node);
+ axis2_status_t (AXIS2_CALL *set_base_node)
+ (axis2_soap_header_t *header,
+ axis2_env_t **env,
+ axis2_om_node_t *node);
- axis2_om_node_t* (AXIS2_CALL *get_base_node)(axis2_soap_header_t *header,
- axis2_env_t **env);
+ axis2_om_node_t* (AXIS2_CALL *get_base_node)
+ (axis2_soap_header_t *header,
+ axis2_env_t **env);
+
+ axis2_status_t (AXIS2_CALL *get_soap_version)
+ (axis2_soap_header_t *header,
+ axis2_env_t **env);
+
+ axis2_status_t (AXIS2_CALL *set_soap_version)
+ (axis2_soap_header_t *header,
+ axis2_env_t **env,
+ int soap_version);
};
@@ -133,13 +144,13 @@
* @param env Environment. MUST NOT be NULL
*/
AXIS2_DECLARE(axis2_soap_header_t *)
-axis2_soap_header_create_with_parent(axis2_env_t **env,
- axis2_soap_envelope_t *envelope);
-
-
-AXIS2_DECLARE(axis2_soap_header_t *)
axis2_soap_header_create(axis2_env_t **env);
+
+AXIS2_DECLARE(axis2_soap_header_t *)
+axis2_soap_header_create_with_parent(axis2_env_t **env,
+ axis2_soap_envelope_t *envelope);
+
/******************** Macros **************************************************/
@@ -163,7 +174,13 @@
((header)->ops->set_base_node(header, env, node))
#define AXIS2_SOAP_HEADER_GET_BASE_NODE(header, env) \
- ((header)->ops->get_base_node(header, env))
+ ((header)->ops->get_base_node(header, env))
+
+#define AXIS2_SOAP_HEADER_SET_SOAP_VERSION(header, env, version) \
+ ((header)->ops->set_soap_version(header, env, version))
+
+#define AXIS2_SOAP_HEADER_GET_SOAP_VERSION(header, env) \
+ ((header)->ops->get_soap_version(header, env))
/** @} */
Added: webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_header.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_header.c?rev=358789&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_header.c (added)
+++ webservices/axis2/trunk/c/modules/xml/soap/src/axis2_soap_header.c Fri Dec 23 03:00:25 2005
@@ -0,0 +1,200 @@
+/*
+ * 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_envelope.h>
+ #include <axis2_soap_header.h>
+ #include <axis2_hash.h>
+ #include <axis2_soap.h>
+
+ /******************* impl struct *********************************************/
+
+ typedef struct axis2_soap_header_impl_t
+ {
+ axis2_soap_header_t soap_header;
+
+ axis2_om_node_t *om_ele_node;
+
+ axis2_om_element_t *om_ele;
+
+ int soap_version;
+
+ axis2_hash_t *header_blocks;
+
+ }axis2_soap_header_impl_t;
+
+ /****************** Macro ****************************************************/
+
+ #define AXIS2_INTF_TO_IMPL(header) ((axis2_soap_header_impl_t*)header)
+
+ /****************** Function prototypes **************************************/
+
+axis2_status_t AXIS2_CALL
+axis2_soap_header_free(axis2_soap_header_t *header,
+ axis2_env_t **env);
+
+axis2_soap_header_block_t* AXIS2_CALL
+axis2_soap_header_add_header_block(axis2_soap_header_t* header,
+ axis2_env_t **env,
+ axis2_char_t *localname,
+ axis2_om_namespace_t *ns);
+axis2_hash_t* AXIS2_CALL
+axis2_soap_header_examine_header_blocks
+ (axis2_soap_header_t* header,
+ axis2_env_t **env,
+ axis2_char_t* param_role);
+
+axis2_om_children_qname_iterator_t* AXIS2_CALL
+axis2_soap_header_examine_all_header_blocks
+ (axis2_soap_header_t* header,
+ axis2_env_t **env);
+
+axis2_om_children_with_specific_attribute_iterator_t *
+AXIS2_CALL axis2_soap_header_extract_header_blocks
+ (axis2_soap_header_t *header,
+ axis2_env_t **env,
+ axis2_char_t *role);
+
+axis2_status_t AXIS2_CALL
+axis2_soap_header_set_base_node(axis2_soap_header_t *header,
+ axis2_env_t **env,
+ axis2_om_node_t *node);
+
+axis2_om_node_t* AXIS2_CALL
+axis2_soap_header_get_base_node(axis2_soap_header_t *header,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_soap_header_get_soap_version(axis2_soap_header_t *header,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_soap_header_set_soap_version(axis2_soap_header_t *header,
+ axis2_env_t **env,
+ int soap_version);
+
+/*************** function implementations *************************************/
+
+AXIS2_DECLARE(axis2_soap_header_t *)
+axis2_soap_header_create(axis2_env_t **env)
+{
+ axis2_soap_header_impl_t *header_impl = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ header_impl = (axis2_soap_header_impl_t*)AXIS2_MALLOC(
+ (*env)->allocator,
+ sizeof(axis2_soap_header_impl_t));
+ if(!header_impl)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ header_impl->soap_header.ops = NULL;
+ header_impl->om_ele = NULL;
+ header_impl->om_ele_node = NULL;
+
+ header_impl->soap_header.ops->free_fn =
+ axis2_soap_header_free;
+ header_impl->soap_header.ops->add_header_block =
+ axis2_soap_header_add_header_block;
+ header_impl->soap_header.ops->examine_header_blocks =
+ axis2_soap_header_examine_header_blocks;
+ header_impl->soap_header.ops->examine_all_header_blocks =
+ axis2_soap_header_examine_all_header_blocks;
+ header_impl->soap_header.ops->extract_header_blocks =
+ axis2_soap_header_extract_header_blocks;
+ header_impl->soap_header.ops->set_base_node =
+ axis2_soap_header_set_base_node;
+ header_impl->soap_header.ops->get_base_node =
+ axis2_soap_header_get_base_node;
+ header_impl->soap_header.ops->set_soap_version =
+ axis2_soap_header_set_soap_version;
+ header_impl->soap_header.ops->get_soap_version =
+ axis2_soap_header_get_soap_version;
+ return &(header_impl->soap_header);
+}
+
+
+AXIS2_DECLARE(axis2_soap_header_t *)
+axis2_soap_header_create_with_parent(axis2_env_t **env,
+ axis2_soap_envelope_t *envelope)
+{
+ axis2_soap_header_impl_t *header_impl = NULL;
+ axis2_soap_header_t *header = 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, envelope, NULL);
+ header = axis2_soap_header_create(env);
+ if(!header)
+ return NULL;
+ header_impl = AXIS2_INTF_TO_IMPL(header);
+
+ parent_node = AXIS2_SOAP_ENVELOPE_GET_BASE_NODE(envelope, env);
+ parent_ele = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(parent_node, env);
+ parent_ns = AXIS2_OM_ELEMENT_GET_NAMESPACE(parent_ele, env);
+
+ this_ele = axis2_om_element_create(env, parent_node,
+ AXIS2_SOAP_HEADER_LOCAL_NAME, parent_ns, &this_node);
+ header_impl->om_ele = this_ele;
+ header_impl->om_ele_node = this_node;
+ return &(header_impl->soap_header);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_soap_header_free(axis2_soap_header_t *header,
+ axis2_env_t **env){}
+
+axis2_soap_header_block_t* AXIS2_CALL
+axis2_soap_header_add_header_block(axis2_soap_header_t* header,
+ axis2_env_t **env,
+ axis2_char_t *localname,
+ axis2_om_namespace_t *ns){}
+axis2_hash_t* AXIS2_CALL
+axis2_soap_header_examine_header_blocks
+ (axis2_soap_header_t* header,
+ axis2_env_t **env,
+ axis2_char_t* param_role){}
+
+axis2_om_children_qname_iterator_t* AXIS2_CALL
+axis2_soap_header_examine_all_header_blocks
+ (axis2_soap_header_t* header,
+ axis2_env_t **env){}
+
+axis2_om_children_with_specific_attribute_iterator_t *
+AXIS2_CALL axis2_soap_header_extract_header_blocks
+ (axis2_soap_header_t *header,
+ axis2_env_t **env,
+ axis2_char_t *role){}
+
+axis2_status_t AXIS2_CALL
+axis2_soap_header_set_base_node(axis2_soap_header_t *header,
+ axis2_env_t **env,
+ axis2_om_node_t *node){}
+
+axis2_om_node_t* AXIS2_CALL
+axis2_soap_header_get_base_node(axis2_soap_header_t *header,
+ axis2_env_t **env){}
+
+axis2_status_t AXIS2_CALL
+axis2_soap_header_get_soap_version(axis2_soap_header_t *header,
+ axis2_env_t **env){}
+
+axis2_status_t AXIS2_CALL
+axis2_soap_header_set_soap_version(axis2_soap_header_t *header,
+ axis2_env_t **env,
+ int soap_version){}