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 2006/03/29 04:39:36 UTC
svn commit: r389659 - in /webservices/axis2/trunk/c:
include/axis2_endpoint_ref.h modules/core/addr/endpoint_ref.c
modules/mod_addr/addr_in_handler.c modules/mod_addr/addr_out_handler.c
Author: samisa
Date: Tue Mar 28 18:39:34 2006
New Revision: 389659
URL: http://svn.apache.org/viewcvs?rev=389659&view=rev
Log:
More improvements to get the addressing interopm tests passed
Modified:
webservices/axis2/trunk/c/include/axis2_endpoint_ref.h
webservices/axis2/trunk/c/modules/core/addr/endpoint_ref.c
webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c
webservices/axis2/trunk/c/modules/mod_addr/addr_out_handler.c
Modified: webservices/axis2/trunk/c/include/axis2_endpoint_ref.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_endpoint_ref.h?rev=389659&r1=389658&r2=389659&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_endpoint_ref.h (original)
+++ webservices/axis2/trunk/c/include/axis2_endpoint_ref.h Tue Mar 28 18:39:34 2006
@@ -25,6 +25,7 @@
#include <axis2_defines.h>
#include <axis2_env.h>
#include <axis2.h>
+#include <axis2_array_list.h>
#include <axis2_any_content_type.h>
#include <axis2_svc_name.h>
#include <axis2_om_node.h>
@@ -93,6 +94,25 @@
set_ref_properties)(struct axis2_endpoint_ref *endpoint_ref,
axis2_env_t **env,
axis2_any_content_type_t *ref_properties);
+
+ axis2_array_list_t* (AXIS2_CALL *
+ get_ref_param_list)(struct axis2_endpoint_ref *endpoint_ref,
+ axis2_env_t **env);
+
+ axis2_array_list_t* (AXIS2_CALL *
+ get_meta_data_list)(struct axis2_endpoint_ref *endpoint_ref,
+ axis2_env_t **env);
+
+ axis2_status_t (AXIS2_CALL *
+ add_ref_param)(struct axis2_endpoint_ref *endpoint_ref,
+ axis2_env_t **env,
+ axis2_om_node_t* ref_param_node);
+
+ axis2_status_t (AXIS2_CALL *
+ add_meta_data)(struct axis2_endpoint_ref *endpoint_ref,
+ axis2_env_t **env,
+ axis2_om_node_t* meta_data_node);
+
/**
* Method get_ref_params
*/
@@ -141,13 +161,13 @@
axis2_env_t **env,
axis2_any_content_type_t *metadata);
-
+ /*
axis2_status_t (AXIS2_CALL *
add_ref_param)(struct axis2_endpoint_ref *endpoint_ref,
axis2_env_t **env,
axis2_qname_t *qname,
axis2_char_t *value);
-
+ */
axis2_status_t (AXIS2_CALL *
free)(struct axis2_endpoint_ref *endpoint_ref,
@@ -217,8 +237,17 @@
#define AXIS2_ENDPOINT_REF_SET_METADATA(endpoint_ref, env, metadata) \
((endpoint_ref)->ops->set_metadata(endpoint_ref, env, metadata))
-#define AXIS2_ENDPOINT_REF_ADD_REF_PARAM(endpoint_ref, env, qname, value) \
- ((endpoint_ref)->ops->add_ref_param(endpoint_ref, env, qname, value))
+#define AXIS2_ENDPOINT_REF_GET_REF_PARAM_LIST(endpoint_ref, env) \
+ ((endpoint_ref)->ops->get_ref_param_list(endpoint_ref, env))
+
+#define AXIS2_ENDPOINT_REF_GET_META_DATA_LIST(endpoint_ref, env) \
+ ((endpoint_ref)->ops->get_meta_data_list(endpoint_ref, env))
+
+#define AXIS2_ENDPOINT_REF_ADD_REF_PARAM(endpoint_ref, env, node) \
+ ((endpoint_ref)->ops->add_ref_param(endpoint_ref, env, node))
+
+#define AXIS2_ENDPOINT_REF_ADD_META_DATA(endpoint_ref, env, node) \
+ ((endpoint_ref)->ops->add_meta_data(endpoint_ref, env, node))
#define AXIS2_ENDPOINT_REF_FREE(endpoint_ref, env) \
((endpoint_ref)->ops->free(endpoint_ref, env))
Modified: webservices/axis2/trunk/c/modules/core/addr/endpoint_ref.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/addr/endpoint_ref.c?rev=389659&r1=389658&r2=389659&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/addr/endpoint_ref.c (original)
+++ webservices/axis2/trunk/c/modules/core/addr/endpoint_ref.c Tue Mar 28 18:39:34 2006
@@ -18,6 +18,7 @@
#include <axis2_endpoint_ref.h>
#include <axis2_string.h>
+#include <axis2_array_list.h>
typedef struct axis2_endpoint_ref_impl
{
@@ -30,6 +31,10 @@
axis2_any_content_type_t *ref_properties;
/** reference parameters */
axis2_any_content_type_t *ref_params;
+ /** reference parameters */
+ axis2_array_list_t *ref_param_list;
+ /** meta data */
+ axis2_array_list_t *meta_data_list;
/** service name */
axis2_svc_name_t *svc_name;
/** policies represented as an OM node */
@@ -70,6 +75,14 @@
axis2_env_t **env,
axis2_any_content_type_t *ref_properties);
+axis2_array_list_t* AXIS2_CALL
+axis2_endpoint_ref_get_ref_param_list(struct axis2_endpoint_ref *endpoint_ref,
+ axis2_env_t **env);
+
+axis2_array_list_t* AXIS2_CALL
+axis2_endpoint_ref_get_meta_data_list(struct axis2_endpoint_ref *endpoint_ref,
+ axis2_env_t **env);
+
axis2_any_content_type_t* AXIS2_CALL
axis2_endpoint_ref_get_ref_params(struct axis2_endpoint_ref *endpoint_ref,
@@ -80,6 +93,16 @@
axis2_env_t **env,
axis2_any_content_type_t* any_content_type);
+axis2_status_t AXIS2_CALL
+axis2_endpoint_ref_add_ref_param(struct axis2_endpoint_ref *endpoint_ref,
+ axis2_env_t **env,
+ axis2_om_node_t* ref_param_node);
+
+axis2_status_t AXIS2_CALL
+axis2_endpoint_ref_add_meta_data(struct axis2_endpoint_ref *endpoint_ref,
+ axis2_env_t **env,
+ axis2_om_node_t* meta_data_node);
+
axis2_svc_name_t* AXIS2_CALL
axis2_endpoint_ref_get_svc_name(struct axis2_endpoint_ref *endpoint_ref,
axis2_env_t **env);
@@ -107,12 +130,13 @@
axis2_env_t **env,
axis2_any_content_type_t *metadata);
-axis2_status_t AXIS2_CALL
+/*axis2_status_t AXIS2_CALL
axis2_endpoint_ref_add_ref_param(struct axis2_endpoint_ref *endpoint_ref,
axis2_env_t **env,
axis2_qname_t *qname,
axis2_char_t *value);
-
+*/
+
axis2_status_t AXIS2_CALL
axis2_endpoint_ref_free (struct axis2_endpoint_ref *endpoint_ref,
axis2_env_t **env);
@@ -140,6 +164,8 @@
endpoint_ref_impl->interface_qname = NULL;
endpoint_ref_impl->ref_properties = NULL;
endpoint_ref_impl->ref_params = NULL;
+ endpoint_ref_impl->ref_param_list = NULL;
+ endpoint_ref_impl->meta_data_list = NULL;
endpoint_ref_impl->svc_name = NULL;
endpoint_ref_impl->policies = NULL;
endpoint_ref_impl->metadata = NULL;
@@ -155,6 +181,22 @@
}
}
+ endpoint_ref_impl->ref_param_list = axis2_array_list_create(env, 0);
+ if (!(endpoint_ref_impl->ref_param_list))
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ axis2_endpoint_ref_free(&(endpoint_ref_impl->endpoint_ref), env);
+ return NULL;
+ }
+
+ endpoint_ref_impl->meta_data_list = axis2_array_list_create(env, 0);
+ if (!(endpoint_ref_impl->meta_data_list))
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ axis2_endpoint_ref_free(&(endpoint_ref_impl->endpoint_ref), env);
+ return NULL;
+ }
+
/* initialize ops */
endpoint_ref_impl->endpoint_ref.ops =
AXIS2_MALLOC( (*env)->allocator, sizeof(axis2_endpoint_ref_ops_t) );
@@ -206,10 +248,19 @@
endpoint_ref_impl->endpoint_ref.ops->set_metadata =
axis2_endpoint_ref_set_metadata;
-
+
+ endpoint_ref_impl->endpoint_ref.ops->get_ref_param_list =
+ axis2_endpoint_ref_get_ref_param_list;
+
+ endpoint_ref_impl->endpoint_ref.ops->get_meta_data_list =
+ axis2_endpoint_ref_get_meta_data_list;
+
endpoint_ref_impl->endpoint_ref.ops->add_ref_param =
axis2_endpoint_ref_add_ref_param;
+ endpoint_ref_impl->endpoint_ref.ops->add_meta_data =
+ axis2_endpoint_ref_add_meta_data;
+
endpoint_ref_impl->endpoint_ref.ops->free =
axis2_endpoint_ref_free;
@@ -385,7 +436,7 @@
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
+/*axis2_status_t AXIS2_CALL
axis2_endpoint_ref_add_ref_param(struct axis2_endpoint_ref *endpoint_ref,
axis2_env_t **env,
axis2_qname_t *qname,
@@ -405,7 +456,7 @@
}
return AXIS2_ANY_CONTENT_TYPE_ADD_VALUE(endpoint_ref_impl->ref_params, env, qname, value);
-}
+}*/
axis2_status_t AXIS2_CALL
axis2_endpoint_ref_free (struct axis2_endpoint_ref *endpoint_ref,
@@ -433,10 +484,89 @@
{
AXIS2_ANY_CONTENT_TYPE_FREE(endpoint_ref_impl->ref_params, env);
endpoint_ref_impl->ref_params = NULL;
- }
+ }
+
+ if (endpoint_ref_impl->ref_param_list)
+ {
+ AXIS2_ARRAY_LIST_FREE(endpoint_ref_impl->ref_param_list, env);
+ endpoint_ref_impl->ref_param_list = NULL;
+ }
+
+ if (endpoint_ref_impl->meta_data_list)
+ {
+ AXIS2_ARRAY_LIST_FREE(endpoint_ref_impl->meta_data_list, env);
+ endpoint_ref_impl->meta_data_list = NULL;
+ }
AXIS2_FREE((*env)->allocator, endpoint_ref_impl);
endpoint_ref_impl = NULL;
return AXIS2_SUCCESS;
}
+
+axis2_array_list_t* AXIS2_CALL
+axis2_endpoint_ref_get_ref_param_list(struct axis2_endpoint_ref *endpoint_ref,
+ axis2_env_t **env)
+{
+ axis2_endpoint_ref_impl_t *endpoint_ref_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ endpoint_ref_impl = AXIS2_INTF_TO_IMPL(endpoint_ref);
+
+ return endpoint_ref_impl->ref_param_list;
+}
+
+axis2_array_list_t* AXIS2_CALL
+axis2_endpoint_ref_get_meta_data_list(struct axis2_endpoint_ref *endpoint_ref,
+ axis2_env_t **env)
+{
+ axis2_endpoint_ref_impl_t *endpoint_ref_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ endpoint_ref_impl = AXIS2_INTF_TO_IMPL(endpoint_ref);
+
+ return endpoint_ref_impl->meta_data_list;
+}
+
+
+axis2_status_t AXIS2_CALL
+axis2_endpoint_ref_add_ref_param(struct axis2_endpoint_ref *endpoint_ref,
+ axis2_env_t **env,
+ axis2_om_node_t* ref_param_node)
+{
+ axis2_endpoint_ref_impl_t *endpoint_ref_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ endpoint_ref_impl = AXIS2_INTF_TO_IMPL(endpoint_ref);
+
+ if (endpoint_ref_impl->ref_param_list && ref_param_node)
+ {
+ return AXIS2_ARRAY_LIST_ADD(endpoint_ref_impl->ref_param_list, env, ref_param_node);
+ }
+
+ return AXIS2_FAILURE;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_endpoint_ref_add_meta_data(struct axis2_endpoint_ref *endpoint_ref,
+ axis2_env_t **env,
+ axis2_om_node_t* meta_data_node)
+{
+ axis2_endpoint_ref_impl_t *endpoint_ref_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ endpoint_ref_impl = AXIS2_INTF_TO_IMPL(endpoint_ref);
+
+ if (endpoint_ref_impl->meta_data_list && meta_data_node)
+ {
+ return AXIS2_ARRAY_LIST_ADD(endpoint_ref_impl->meta_data_list, env, meta_data_node);
+ }
+
+ return AXIS2_FAILURE;
+}
+
+
Modified: webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c?rev=389659&r1=389658&r2=389659&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c (original)
+++ webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c Tue Mar 28 18:39:34 2006
@@ -611,9 +611,10 @@
attr_value = AXIS2_OM_ATTRIBUTE_GET_LOCALNAME(is_ref_param_attr, env);
if(AXIS2_STRCMP("true", attr_value) == 0)
{
- AXIS2_ENDPOINT_REF_ADD_REF_PARAM(to_epr, env,
+ AXIS2_ENDPOINT_REF_ADD_REF_PARAM(to_epr, env, header_block_node);
+ /*
AXIS2_OM_ELEMENT_GET_QNAME(header_block_ele, env),
- AXIS2_OM_ELEMENT_GET_TEXT(header_block_ele, env, header_block_node));
+ AXIS2_OM_ELEMENT_GET_TEXT(header_block_ele, env, header_block_node));*/
}
}
}
Modified: webservices/axis2/trunk/c/modules/mod_addr/addr_out_handler.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/mod_addr/addr_out_handler.c?rev=389659&r1=389658&r2=389659&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/mod_addr/addr_out_handler.c (original)
+++ webservices/axis2/trunk/c/modules/mod_addr/addr_out_handler.c Tue Mar 28 18:39:34 2006
@@ -544,6 +544,8 @@
axis2_soap_header_block_t *header_block = NULL;
axis2_char_t *address = NULL;
axis2_any_content_type_t *reference_param = NULL;
+ axis2_array_list_t *ref_param_list = NULL;
+ axis2_array_list_t *meta_data_list = NULL;
axis2_om_node_t *header_block_node = NULL;
axis2_om_node_t *header_node = NULL;
axis2_om_namespace_t *addr_ns_obj = NULL;
@@ -602,7 +604,7 @@
axis2_addr_out_handler_add_to_header (env, endpoint_ref,
&header_block_node, addr_ns);
- reference_param = AXIS2_ENDPOINT_REF_GET_REF_PARAMS (endpoint_ref, env);
+ /*reference_param = AXIS2_ENDPOINT_REF_GET_REF_PARAMS (endpoint_ref, env);
if (reference_param)
{
@@ -631,8 +633,60 @@
addr_ns_obj = NULL;
}
}
+ }*/
+
+ ref_param_list = AXIS2_ENDPOINT_REF_GET_REF_PARAM_LIST(endpoint_ref, env);
+ if (ref_param_list && AXIS2_ARRAY_LIST_SIZE(ref_param_list, env) > 0)
+ {
+ axis2_om_node_t *reference_node = NULL;
+ axis2_om_element_t *reference_ele = NULL;
+ int i = 0;
+
+ addr_ns_obj = axis2_om_namespace_create (env, addr_ns, AXIS2_WSA_DEFAULT_PREFIX);
+
+ reference_ele = axis2_om_element_create (env,
+ header_block_node,
+ EPR_REFERENCE_PARAMETERS,
+ addr_ns_obj,
+ &reference_node);
+ for (i = 0; i < AXIS2_ARRAY_LIST_SIZE(ref_param_list, env); i ++)
+ {
+ axis2_om_node_t *ref_node = (axis2_om_node_t *)AXIS2_ARRAY_LIST_GET(ref_param_list, env, i);
+ if (ref_node)
+ {
+ AXIS2_OM_NODE_ADD_CHILD(reference_node, env, ref_node);
+ }
+ }
}
-
+
+ meta_data_list = AXIS2_ENDPOINT_REF_GET_META_DATA_LIST(endpoint_ref, env);
+ if (meta_data_list && AXIS2_ARRAY_LIST_SIZE(meta_data_list, env) > 0)
+ {
+ axis2_om_node_t *reference_node = NULL;
+ axis2_om_element_t *reference_ele = NULL;
+ int i = 0;
+
+ if (!reference_node) /* may be we alredy created this in ref params block */
+ {
+ addr_ns_obj = axis2_om_namespace_create (env, addr_ns, AXIS2_WSA_DEFAULT_PREFIX);
+
+ reference_ele = axis2_om_element_create (env,
+ header_block_node,
+ AXIS2_WSA_METADATA,
+ addr_ns_obj,
+ &reference_node);
+ }
+
+ for (i = 0; i < AXIS2_ARRAY_LIST_SIZE(meta_data_list, env); i ++)
+ {
+ axis2_om_node_t *ref_node = (axis2_om_node_t *)AXIS2_ARRAY_LIST_GET(meta_data_list, env, i);
+ if (ref_node)
+ {
+ AXIS2_OM_NODE_ADD_CHILD(reference_node, env, ref_node);
+ }
+ }
+ }
+
if (AXIS2_STRCMP (AXIS2_WSA_NAMESPACE_SUBMISSION, addr_ns) == 0)
{
axis2_any_content_type_t *referece_properties = NULL;