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 da...@apache.org on 2006/07/27 11:01:41 UTC
svn commit: r426010 - in /webservices/axis2/trunk/c/woden:
include/woden_wsdl10_soap_address_exts.h
src/wsdl10/extensions/soap/soap_address_exts.c
Author: damitha
Date: Thu Jul 27 02:01:41 2006
New Revision: 426010
URL: http://svn.apache.org/viewvc?rev=426010&view=rev
Log:
Added new files
Added:
webservices/axis2/trunk/c/woden/include/woden_wsdl10_soap_address_exts.h
webservices/axis2/trunk/c/woden/src/wsdl10/extensions/soap/soap_address_exts.c
Added: webservices/axis2/trunk/c/woden/include/woden_wsdl10_soap_address_exts.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/include/woden_wsdl10_soap_address_exts.h?rev=426010&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/include/woden_wsdl10_soap_address_exts.h (added)
+++ webservices/axis2/trunk/c/woden/include/woden_wsdl10_soap_address_exts.h Thu Jul 27 02:01:41 2006
@@ -0,0 +1,152 @@
+/*
+ * 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.
+ */
+
+#ifndef WODEN_WSDL10_SOAP_ADDRESS_EXTS_H
+#define WODEN_WSDL10_SOAP_ADDRESS_EXTS_H
+
+/**
+ * @file woden_wsdl10_soap_address_exts.h
+ * @brief Axis2 Soap Binding Operation Extensions Interface
+ * This interface represents the properties from the SOAP namespace
+ * added to the WSDL 2.0 <code>address</code> component as part
+ * of the SOAP binding extension.
+ * <p>
+ * These include:
+ * <ul>
+ * <li>{soap mep}</li>
+ * <li>{soap address}</li>
+ * <li>{soap modules}</li>
+ * </ul>
+ *
+ */
+
+#include <woden.h>
+#include <woden_component_exts.h>
+#include <axis2_array_list.h>
+
+/** @defgroup woden_wsdl10_soap_address_exts Soap Binding Operation Extensions
+ * @ingroup woden
+ * @{
+ */
+
+typedef union woden_wsdl10_soap_address_exts_base woden_wsdl10_soap_address_exts_base_t;
+typedef struct woden_wsdl10_soap_address_exts woden_wsdl10_soap_address_exts_t;
+typedef struct woden_wsdl10_soap_address_exts_ops woden_wsdl10_soap_address_exts_ops_t;
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+struct woden_wsdl10_soap_address_exts_ops
+{
+ /**
+ * Deallocate memory
+ * @return status code
+ */
+ axis2_status_t (AXIS2_CALL *
+ free) (void *soap_address_exts,
+ const axis2_env_t *env);
+
+ axis2_hash_t *(AXIS2_CALL *
+ super_objs) (void *soap_address_exts,
+ const axis2_env_t *env);
+
+ woden_obj_types_t (AXIS2_CALL *
+ type) (void *soap_address_exts,
+ const axis2_env_t *env);
+ /**
+ * @return the base implementation class
+ */
+ struct woden_component_exts *(AXIS2_CALL *
+ get_base_impl) (
+ void *soap_address_exts,
+ const axis2_env_t *env);
+
+ axis2_status_t (AXIS2_CALL *
+ set_soap_address) (
+ void *address_exts,
+ const axis2_env_t *env,
+ axis2_uri_t *address);
+
+ axis2_uri_t *(AXIS2_CALL *
+ get_soap_address) (
+ void *address_exts,
+ const axis2_env_t *env);
+
+ axis2_array_list_t *(AXIS2_CALL *
+ get_soap_modules) (
+ void *address_exts,
+ const axis2_env_t *env);
+
+};
+
+struct woden_wsdl10_soap_address_exts
+{
+ woden_component_exts_t component_exts;
+ woden_wsdl10_soap_address_exts_ops_t *ops;
+};
+
+AXIS2_EXTERN woden_wsdl10_soap_address_exts_t * AXIS2_CALL
+woden_wsdl10_soap_address_exts_create(
+ const axis2_env_t *env);
+
+
+/***************************Woden C Internal Methods***************************/
+AXIS2_EXTERN woden_wsdl10_soap_address_exts_t * AXIS2_CALL
+woden_wsdl10_soap_address_exts_to_component_exts(
+ void *soap_address_exts,
+ const axis2_env_t *env);
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+woden_wsdl10_soap_address_exts_resolve_methods(
+ woden_wsdl10_soap_address_exts_t *soap_address_exts,
+ const axis2_env_t *env,
+ woden_wsdl10_soap_address_exts_t *soap_address_exts_impl,
+ axis2_hash_t *methods);
+/************************End of Woden C Internal Methods***********************/
+
+#define WODEN_WSDL10_SOAP_ADDRESS_EXTS_FREE(soap_address_exts, env) \
+ (((woden_wsdl10_soap_address_exts_t *) soap_address_exts)->ops->free(soap_address_exts, env))
+
+#define WODEN_WSDL10_SOAP_ADDRESS_EXTS_SUPER_OBJS(soap_address_exts, env) \
+ (((woden_wsdl10_soap_address_exts_t *) soap_address_exts)->ops->super_objs(soap_address_exts, env))
+
+#define WODEN_WSDL10_SOAP_ADDRESS_EXTS_TYPE(soap_address_exts, env) \
+ (((woden_wsdl10_soap_address_exts_t *) soap_address_exts)->ops->type(soap_address_exts, env))
+
+#define WODEN_WSDL10_SOAP_ADDRESS_EXTS_GET_BASE_IMPL(soap_address_exts, env) \
+ (((woden_wsdl10_soap_address_exts_t *) soap_address_exts)->ops->get_base_impl(soap_address_exts, env))
+
+#define WODEN_WSDL10_SOAP_ADDRESS_EXTS_SET_SOAP_ADDRESS(soap_address_exts, env, address) \
+ (((woden_wsdl10_soap_address_exts_t *) soap_address_exts)->ops->\
+ set_soap_address (soap_address_exts, env, address))
+
+#define WODEN_WSDL10_SOAP_ADDRESS_EXTS_GET_SOAP_ADDRESS(soap_address_exts, env) \
+ (((woden_wsdl10_soap_address_exts_t *) soap_address_exts)->ops->\
+ get_soap_address (soap_address_exts, env))
+
+#define WODEN_WSDL10_SOAP_ADDRESS_EXTS_GET_SOAP_MODULES(soap_address_exts, env) \
+ (((woden_wsdl10_soap_address_exts_t *) soap_address_exts)->ops->\
+ get_soap_modules (soap_address_exts, env))
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+#endif /* WODEN_WSDL10_SOAP_ADDRESS_EXTS_H */
+
Added: webservices/axis2/trunk/c/woden/src/wsdl10/extensions/soap/soap_address_exts.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/wsdl10/extensions/soap/soap_address_exts.c?rev=426010&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/wsdl10/extensions/soap/soap_address_exts.c (added)
+++ webservices/axis2/trunk/c/woden/src/wsdl10/extensions/soap/soap_address_exts.c Thu Jul 27 02:01:41 2006
@@ -0,0 +1,403 @@
+/*
+ * 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 <woden_wsdl10_soap_address_exts.h>
+#include <woden_component_exts.h>
+#include <woden_wsdl_element.h>
+#include <woden_string_attr.h>
+#include <woden_qname_or_token_any_attr.h>
+#include <woden_qname_list_or_token_any_attr.h>
+#include <woden_uri_attr.h>
+#include "woden_wsdl10_soap_constants.h"
+
+typedef struct woden_wsdl10_soap_address_exts_impl woden_wsdl10_soap_address_exts_impl_t;
+
+/**
+ * @brief Soap Binding Operation Extensions Struct Impl
+ * Axis2 Soap Binding Operation Extensions
+ */
+struct woden_wsdl10_soap_address_exts_impl
+{
+ woden_wsdl10_soap_address_exts_t address_exts;
+ woden_component_exts_t *component_exts;
+ axis2_hash_t *methods;
+ axis2_hash_t *super;
+ woden_obj_types_t obj_type;
+
+ axis2_qname_t *qname;
+ axis2_uri_t *address;
+};
+
+#define INTF_TO_IMPL(address_exts) ((woden_wsdl10_soap_address_exts_impl_t *) address_exts)
+
+axis2_status_t AXIS2_CALL
+woden_wsdl10_soap_address_exts_free(
+ void *address_exts,
+ const axis2_env_t *env);
+
+axis2_hash_t *AXIS2_CALL
+woden_wsdl10_soap_address_exts_super_objs(
+ void *address_exts,
+ const axis2_env_t *env);
+
+woden_obj_types_t AXIS2_CALL
+woden_wsdl10_soap_address_exts_type(
+ void *address_exts,
+ const axis2_env_t *env);
+
+woden_component_exts_t *AXIS2_CALL
+woden_wsdl10_soap_address_exts_get_base_impl(
+ void *address_exts,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_wsdl10_soap_address_exts_set_soap_address(
+ void *address_exts,
+ const axis2_env_t *env,
+ axis2_uri_t *address);
+
+axis2_uri_t *AXIS2_CALL
+woden_wsdl10_soap_address_exts_get_soap_address(
+ void *address_exts,
+ const axis2_env_t *env);
+
+axis2_array_list_t *AXIS2_CALL
+woden_wsdl10_soap_address_exts_get_soap_modules(
+ void *address_exts,
+ const axis2_env_t *env);
+
+static woden_wsdl10_soap_address_exts_t *
+create(
+ const axis2_env_t *env);
+
+static axis2_status_t
+woden_wsdl10_soap_address_exts_free_ops(
+ void *address_exts,
+ const axis2_env_t *env);
+
+/************************Woden C Internal Methods******************************/
+AXIS2_EXTERN woden_wsdl10_soap_address_exts_t * AXIS2_CALL
+woden_wsdl10_soap_address_exts_to_component_exts(
+ void *address_exts,
+ const axis2_env_t *env)
+{
+ woden_wsdl10_soap_address_exts_impl_t *address_exts_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ if(!address_exts)
+ {
+ address_exts_impl = (woden_wsdl10_soap_address_exts_impl_t *)
+ create(env);
+ }
+ else
+ address_exts_impl = (woden_wsdl10_soap_address_exts_impl_t *)
+ address_exts;
+ woden_wsdl10_soap_address_exts_free_ops(address_exts, env);
+
+ address_exts_impl->address_exts.component_exts.ops =
+ AXIS2_MALLOC(env->allocator,
+ sizeof(woden_component_exts_ops_t));
+ woden_component_exts_resolve_methods(&(address_exts_impl->address_exts.
+ component_exts), env, address_exts_impl->methods);
+ return address_exts;
+}
+
+/************************End of Woden C Internal Methods***********************/
+static woden_wsdl10_soap_address_exts_t *
+create(const axis2_env_t *env)
+{
+ woden_wsdl10_soap_address_exts_impl_t *address_exts_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ address_exts_impl = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_wsdl10_soap_address_exts_impl_t));
+
+ address_exts_impl->obj_type= WODEN_WSDL10_SOAP_ADDRESS_EXTS;
+ address_exts_impl->super = NULL;
+ address_exts_impl->methods = NULL;
+
+ address_exts_impl->component_exts = NULL;
+ address_exts_impl->qname = NULL;
+ address_exts_impl->address = NULL;
+
+ address_exts_impl->address_exts.component_exts.ops = NULL;
+
+ address_exts_impl->address_exts.ops = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_wsdl10_soap_address_exts_ops_t));
+
+ address_exts_impl->address_exts.ops->free = woden_wsdl10_soap_address_exts_free;
+ address_exts_impl->address_exts.ops->super_objs =
+ woden_wsdl10_soap_address_exts_super_objs;
+ address_exts_impl->address_exts.ops->type =
+ woden_wsdl10_soap_address_exts_type;
+ address_exts_impl->address_exts.ops->get_base_impl =
+ woden_wsdl10_soap_address_exts_get_base_impl;
+
+ address_exts_impl->address_exts.ops->get_soap_modules =
+ woden_wsdl10_soap_address_exts_get_soap_modules;
+ address_exts_impl->address_exts.ops->set_soap_address =
+ woden_wsdl10_soap_address_exts_set_soap_address;
+ address_exts_impl->address_exts.ops->get_soap_address =
+ woden_wsdl10_soap_address_exts_get_soap_address;
+
+ address_exts_impl->methods = axis2_hash_make(env);
+ if(!address_exts_impl->methods)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(address_exts_impl->methods, "free", AXIS2_HASH_KEY_STRING,
+ woden_wsdl10_soap_address_exts_free);
+ axis2_hash_set(address_exts_impl->methods, "super_objs",
+ AXIS2_HASH_KEY_STRING, woden_wsdl10_soap_address_exts_super_objs);
+ axis2_hash_set(address_exts_impl->methods, "type",
+ AXIS2_HASH_KEY_STRING, woden_wsdl10_soap_address_exts_type);
+
+ axis2_hash_set(address_exts_impl->methods, "get_soap_modules",
+ AXIS2_HASH_KEY_STRING,
+ woden_wsdl10_soap_address_exts_get_soap_modules);
+ axis2_hash_set(address_exts_impl->methods, "set_soap_address",
+ AXIS2_HASH_KEY_STRING,
+ woden_wsdl10_soap_address_exts_set_soap_address);
+ axis2_hash_set(address_exts_impl->methods, "get_soap_address",
+ AXIS2_HASH_KEY_STRING,
+ woden_wsdl10_soap_address_exts_get_soap_address);
+
+ return &(address_exts_impl->address_exts);
+}
+
+AXIS2_EXTERN woden_wsdl10_soap_address_exts_t * AXIS2_CALL
+woden_wsdl10_soap_address_exts_create(const axis2_env_t *env)
+{
+ woden_wsdl10_soap_address_exts_impl_t *address_exts_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ address_exts_impl = (woden_wsdl10_soap_address_exts_impl_t *) create(env);
+
+ address_exts_impl->component_exts = woden_component_exts_create(env);
+
+ address_exts_impl->super = axis2_hash_make(env);
+ if(!address_exts_impl->super)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(address_exts_impl->super, "WODEN_WSDL10_SOAP_ADDRESS_EXTS", AXIS2_HASH_KEY_STRING,
+ &(address_exts_impl->address_exts));
+ axis2_hash_set(address_exts_impl->super, "WODEN_COMPONENT_EXTS", AXIS2_HASH_KEY_STRING,
+ address_exts_impl->component_exts);
+
+ return &(address_exts_impl->address_exts);
+}
+
+static axis2_status_t
+woden_wsdl10_soap_address_exts_free_ops(
+ void *address_exts,
+ const axis2_env_t *env)
+{
+ woden_wsdl10_soap_address_exts_impl_t *address_exts_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ address_exts_impl = INTF_TO_IMPL(address_exts);
+
+ if(address_exts_impl->address_exts.component_exts.ops)
+ {
+ AXIS2_FREE(env->allocator, address_exts_impl->address_exts.
+ component_exts.ops);
+ address_exts_impl->address_exts.component_exts.ops = NULL;
+ }
+
+ return AXIS2_SUCCESS;
+}
+
+
+axis2_status_t AXIS2_CALL
+woden_wsdl10_soap_address_exts_free(void *address_exts,
+ const axis2_env_t *env)
+{
+ woden_wsdl10_soap_address_exts_impl_t *address_exts_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ address_exts_impl = INTF_TO_IMPL(address_exts);
+
+ if(address_exts_impl->super)
+ {
+ axis2_hash_free(address_exts_impl->super, env);
+ address_exts_impl->super = NULL;
+ }
+
+ if(address_exts_impl->methods)
+ {
+ axis2_hash_free(address_exts_impl->methods, env);
+ address_exts_impl->methods = NULL;
+ }
+
+ if(address_exts_impl->component_exts)
+ {
+ WODEN_COMPONENT_EXTS_FREE(address_exts_impl->component_exts, env);
+ address_exts_impl->component_exts = NULL;
+ }
+
+ if(address_exts_impl->address)
+ {
+ AXIS2_URI_FREE(address_exts_impl->address, env);
+ address_exts_impl->address = NULL;
+ }
+
+ if(address_exts_impl->qname)
+ {
+ AXIS2_QNAME_FREE(address_exts_impl->qname, env);
+ address_exts_impl->qname = NULL;
+ }
+ woden_wsdl10_soap_address_exts_free_ops(address_exts, env);
+
+ if((&(address_exts_impl->address_exts))->ops)
+ {
+ AXIS2_FREE(env->allocator, (&(address_exts_impl->address_exts))->ops);
+ (&(address_exts_impl->address_exts))->ops = NULL;
+ }
+
+ if(address_exts_impl)
+ {
+ AXIS2_FREE(env->allocator, address_exts_impl);
+ address_exts_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_hash_t *AXIS2_CALL
+woden_wsdl10_soap_address_exts_super_objs(
+ void *address_exts,
+ const axis2_env_t *env)
+{
+ woden_wsdl10_soap_address_exts_impl_t *address_exts_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ address_exts_impl = INTF_TO_IMPL(address_exts);
+
+ return address_exts_impl->super;
+}
+
+woden_obj_types_t AXIS2_CALL
+woden_wsdl10_soap_address_exts_type(
+ void *address_exts,
+ const axis2_env_t *env)
+{
+ woden_wsdl10_soap_address_exts_impl_t *address_exts_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ address_exts_impl = INTF_TO_IMPL(address_exts);
+
+ return address_exts_impl->obj_type;
+}
+
+woden_component_exts_t *AXIS2_CALL
+woden_wsdl10_soap_address_exts_get_base_impl(
+ void *address_exts,
+ const axis2_env_t *env)
+{
+ woden_wsdl10_soap_address_exts_impl_t *address_exts_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ address_exts_impl = INTF_TO_IMPL(address_exts);
+
+ return address_exts_impl->component_exts;
+}
+
+axis2_status_t AXIS2_CALL
+woden_wsdl10_soap_address_exts_resolve_methods(
+ woden_wsdl10_soap_address_exts_t *address_exts,
+ const axis2_env_t *env,
+ woden_wsdl10_soap_address_exts_t *address_exts_impl,
+ axis2_hash_t *methods)
+{
+ woden_wsdl10_soap_address_exts_impl_t *address_exts_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, methods, AXIS2_FAILURE);
+ address_exts_impl_l = INTF_TO_IMPL(address_exts_impl);
+
+ address_exts->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ address_exts->ops->super_objs = axis2_hash_get(methods, "super_objs",
+ AXIS2_HASH_KEY_STRING);
+ address_exts->ops->type = axis2_hash_get(methods, "type",
+ AXIS2_HASH_KEY_STRING);
+
+ address_exts->ops->get_soap_modules = axis2_hash_get(methods,
+ "get_soap_modules", AXIS2_HASH_KEY_STRING);
+ if(!address_exts->ops->get_soap_modules && address_exts_impl_l)
+ address_exts->ops->get_soap_modules =
+ address_exts_impl_l->address_exts.ops->get_soap_modules;
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+woden_wsdl10_soap_address_exts_set_soap_address(
+ void *address_exts,
+ const axis2_env_t *env,
+ axis2_uri_t *address)
+{
+ woden_wsdl10_soap_address_exts_impl_t *address_exts_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, address, AXIS2_FAILURE);
+ address_exts_impl = INTF_TO_IMPL(address_exts);
+
+ address_exts_impl->address = AXIS2_URI_CLONE(address, env);
+
+ return AXIS2_SUCCESS;
+}
+
+
+axis2_uri_t *AXIS2_CALL
+woden_wsdl10_soap_address_exts_get_soap_address(
+ void *address_exts,
+ const axis2_env_t *env)
+{
+ woden_wsdl10_soap_address_exts_impl_t *address_exts_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ address_exts_impl = INTF_TO_IMPL(address_exts);
+
+ return address_exts_impl->address;
+}
+
+axis2_array_list_t *AXIS2_CALL
+woden_wsdl10_soap_address_exts_get_soap_modules(
+ void *address_exts,
+ const axis2_env_t *env)
+{
+ woden_wsdl10_soap_address_exts_impl_t *address_exts_impl = NULL;
+ axis2_array_list_t *soap_mods = NULL;
+ void *parent_element = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ address_exts_impl = INTF_TO_IMPL(address_exts);
+
+ parent_element = WODEN_COMPONENT_EXTS_GET_PARENT_ELEMENT(
+ address_exts_impl->component_exts, env);
+ parent_element = woden_wsdl_element_to_element_extensible(parent_element,
+ env);
+ address_exts_impl->qname = axis2_qname_create_from_string(env,
+ WODEN_WSDL10_Q_ELEM_SOAP_MODULE);
+ soap_mods = WODEN_ELEMENT_EXTENSIBLE_GET_EXT_ELEMENTS_OF_TYPE(
+ parent_element, env, address_exts_impl->qname);
+
+ return soap_mods;
+}
+
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org