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/06 08:02:31 UTC
svn commit: r419452 [23/46] - in /webservices/axis2/trunk/c/woden: ./
include/ samples/ samples/wsdl10/ src/ src/builder/ src/builder/wsdl10/
src/schema/ src/types/ src/util/ src/wsdl/ src/wsdl/enumeration/
src/wsdl10/ src/wsdl10/enumeration/ src/wsdl1...
Added: webservices/axis2/trunk/c/woden/src/wsdl/woden_types.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/wsdl/woden_types.c?rev=419452&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/wsdl/woden_types.c (added)
+++ webservices/axis2/trunk/c/woden/src/wsdl/woden_types.c Wed Jul 5 23:02:19 2006
@@ -0,0 +1,1158 @@
+/*
+ * 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_types.h>
+#include <woden_documentation_element.h>
+#include <woden_component_exts.h>
+#include <woden_ext_element.h>
+#include <woden_xml_attr.h>
+#include <woden_schema.h>
+
+typedef struct woden_types_impl woden_types_impl_t;
+
+/**
+ * @brief Types Struct Impl
+ * Axis2 Types
+ */
+struct woden_types_impl
+{
+ woden_types_t types;
+ woden_obj_types_t obj_type;
+ woden_documentable_t *documentable;
+ axis2_hash_t *super;
+ axis2_hash_t *methods;
+ axis2_char_t *f_type_system;
+ axis2_array_list_t *f_schemas;
+ axis2_array_list_t *schema_defs;
+};
+
+#define INTF_TO_IMPL(types) ((woden_types_impl_t *) types)
+
+axis2_status_t AXIS2_CALL
+woden_types_free(
+ void *types,
+ const axis2_env_t *env);
+
+axis2_hash_t *AXIS2_CALL
+woden_types_super_objs(
+ void *types,
+ const axis2_env_t *env);
+
+woden_obj_types_t AXIS2_CALL
+woden_types_type(
+ void *types,
+ const axis2_env_t *env);
+
+woden_documentable_t *AXIS2_CALL
+woden_types_get_base_impl(
+ void *types,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_types_set_type_system(
+ void *types,
+ const axis2_env_t *env,
+ axis2_char_t *type_system);
+
+axis2_char_t *AXIS2_CALL
+woden_types_get_type_system(
+ void *types,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_types_add_schema(
+ void *types,
+ const axis2_env_t *env,
+ void *schema);
+
+axis2_status_t AXIS2_CALL
+woden_types_remove_schema(
+ void *types,
+ const axis2_env_t *env,
+ xml_schema_t *schema);
+
+axis2_array_list_t *AXIS2_CALL
+woden_types_get_schemas(
+ void *types,
+ const axis2_env_t *env);
+
+axis2_array_list_t *AXIS2_CALL
+woden_types_get_schemas_with_namespace(
+ void *types,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc);
+
+axis2_array_list_t *AXIS2_CALL
+woden_types_get_inlined_schemas(
+ void *types,
+ const axis2_env_t *env);
+
+axis2_array_list_t *AXIS2_CALL
+woden_types_get_imported_schemas(
+ void *types,
+ const axis2_env_t *env);
+
+void *AXIS2_CALL
+woden_types_get_element_declaration(
+ void *types,
+ const axis2_env_t *env,
+ axis2_qname_t *qname);
+
+void *AXIS2_CALL
+woden_types_get_type_definition(
+ void *types,
+ const axis2_env_t *env,
+ axis2_qname_t *qname);
+
+axis2_array_list_t *AXIS2_CALL
+woden_types_get_referenceable_schema_defs(
+ void *types,
+ const axis2_env_t *env);
+
+static axis2_array_list_t *
+woden_types_get_referenceable_schema_defs_with_namespace(
+ void *types,
+ const axis2_env_t *env,
+ axis2_char_t *namespc);
+
+axis2_bool_t AXIS2_CALL
+woden_types_is_namespace_in_scope_with_namespace_uri(
+ void *types,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc_uri);
+
+axis2_bool_t AXIS2_CALL
+woden_types_is_namespace_in_scope_with_qname(
+ void *types,
+ const axis2_env_t *env,
+ axis2_qname_t *qname);
+
+axis2_bool_t AXIS2_CALL
+woden_types_is_namespace_in_scope_with_namespace(
+ void *types,
+ const axis2_env_t *env,
+ axis2_char_t *namespc);
+
+static woden_types_t *
+create(const axis2_env_t *env);
+
+static axis2_status_t
+woden_types_free_ops(
+ void *types,
+ const axis2_env_t *env);
+
+/************************Woden C Internal Methods******************************/
+AXIS2_EXTERN woden_types_t * AXIS2_CALL
+woden_types_to_types_element(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ if(!types)
+ {
+ types_impl = (woden_types_impl_t *) create(env);
+ }
+ else
+ types_impl = (woden_types_impl_t *) types;
+
+ woden_types_free_ops(types, env);
+
+ types_impl->types.base.types_element.ops =
+ AXIS2_MALLOC(env->allocator,
+ sizeof(woden_types_element_ops_t));
+ woden_types_element_resolve_methods(&(types_impl->types.base.
+ types_element), env, types_impl->methods);
+ return types;
+}
+
+AXIS2_EXTERN woden_types_t * AXIS2_CALL
+woden_types_to_documentable_element(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ if(!types)
+ {
+ types_impl = (woden_types_impl_t *) create(env);
+ }
+ else
+ types_impl = (woden_types_impl_t *) types;
+
+ woden_types_free_ops(types, env);
+
+ types_impl->types.base.types_element.documentable_element.ops =
+ AXIS2_MALLOC(env->allocator,
+ sizeof(woden_documentable_element_ops_t));
+ woden_documentable_element_resolve_methods(&(types_impl->types.base.
+ types_element.documentable_element), env,
+ types_impl->methods);
+ return types;
+}
+
+AXIS2_EXTERN woden_types_t * AXIS2_CALL
+woden_types_to_documentable(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ if(!types)
+ {
+ types_impl = (woden_types_impl_t *) create(env);
+ }
+ else
+ types_impl = (woden_types_impl_t *) types;
+
+ woden_types_free_ops(types, env);
+
+ types_impl->types.base.documentable.ops =
+ AXIS2_MALLOC(env->allocator,
+ sizeof(woden_documentable_ops_t));
+ woden_documentable_resolve_methods(&(types_impl->types.base.
+ documentable), env, types_impl->documentable,
+ types_impl->methods);
+ return types;
+}
+
+AXIS2_EXTERN woden_types_t * AXIS2_CALL
+woden_types_to_wsdl_obj(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+ void *wsdl_obj = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ if(!types)
+ {
+ types_impl = (woden_types_impl_t *) create(env);
+ }
+ else
+ types_impl = (woden_types_impl_t *) types;
+
+ woden_types_free_ops(types, env);
+
+ types_impl->types.base.documentable.base.wsdl_obj.ops =
+ AXIS2_MALLOC(env->allocator,
+ sizeof(woden_wsdl_obj_ops_t));
+ wsdl_obj = WODEN_DOCUMENTABLE_GET_BASE_IMPL(types_impl->documentable,
+ env);
+ woden_wsdl_obj_resolve_methods(&(types_impl->types.base.
+ documentable.base.wsdl_obj), env, wsdl_obj, types_impl->methods);
+ return types;
+}
+
+AXIS2_EXTERN woden_types_t * AXIS2_CALL
+woden_types_to_wsdl_component(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ if(!types)
+ {
+ types_impl = (woden_types_impl_t *) create(env);
+ }
+ else
+ types_impl = (woden_types_impl_t *) types;
+
+ woden_types_free_ops(types, env);
+
+ types_impl->types.base.documentable.base.wsdl_obj.base.wsdl_component.ops =
+ AXIS2_MALLOC(env->allocator,
+ sizeof(woden_wsdl_component_ops_t));
+ woden_wsdl_component_resolve_methods(&(types_impl->types.base.
+ documentable.base.wsdl_obj.base.wsdl_component), env,
+ types_impl->methods);
+ return types;
+}
+
+AXIS2_EXTERN woden_types_t * AXIS2_CALL
+woden_types_to_attr_extensible(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ if(!types)
+ {
+ types_impl = (woden_types_impl_t *) create(env);
+ }
+ else
+ types_impl = (woden_types_impl_t *) types;
+
+ woden_types_free_ops(types, env);
+
+ types_impl->types.base.documentable.base.wsdl_obj.base.
+ wsdl_element.base.attr_extensible.ops =
+ AXIS2_MALLOC(env->allocator,
+ sizeof(woden_attr_extensible_ops_t));
+ woden_attr_extensible_resolve_methods(&(types_impl->types.base.
+ documentable.base.wsdl_obj.base.wsdl_element.base.attr_extensible),
+ env, NULL, types_impl->methods);
+ return types;
+
+}
+
+AXIS2_EXTERN woden_types_t * AXIS2_CALL
+woden_types_to_element_extensible(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ if(!types)
+ {
+ types_impl = (woden_types_impl_t *) create(env);
+ }
+ else
+ types_impl = (woden_types_impl_t *) types;
+
+ woden_types_free_ops(types, env);
+
+ types_impl->types.base.documentable.base.wsdl_obj.base.wsdl_element.
+ base.element_extensible.ops = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_element_extensible_ops_t));
+ woden_element_extensible_resolve_methods(&(types_impl->types.base.
+ documentable.base.wsdl_obj.base.wsdl_element.base.element_extensible),
+ env, NULL, types_impl->methods);
+ return types;
+
+}
+
+/************************End of Woden C Internal Methods***********************/
+static woden_types_t *
+create(const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ types_impl = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_types_impl_t));
+
+ types_impl->obj_type= WODEN_TYPES;
+ types_impl->super = NULL;
+ types_impl->methods = NULL;
+ types_impl->f_type_system = NULL;
+ types_impl->f_schemas = NULL;
+ types_impl->schema_defs = NULL;
+
+ types_impl->types.base.types_element.ops = NULL;
+ types_impl->types.base.types_element.documentable_element.ops =
+ NULL;
+ types_impl->types.base.documentable.ops = NULL;
+ types_impl->types.base.documentable.base.wsdl_obj.base.wsdl_component.ops =
+ NULL;
+ types_impl->types.base.documentable.base.wsdl_obj.ops = NULL;
+ types_impl->types.base.documentable.base.wsdl_obj.base.wsdl_element.
+ base.attr_extensible.ops = NULL;
+ types_impl->types.base.documentable.base.wsdl_obj.base.wsdl_element.
+ base.element_extensible.ops = NULL;
+
+ types_impl->types.ops = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_types_ops_t));
+
+ types_impl->f_schemas = axis2_array_list_create(env, 0);
+
+ types_impl->types.ops->free = woden_types_free;
+ types_impl->types.ops->super_objs = woden_types_super_objs;
+ types_impl->types.ops->type = woden_types_type;
+ types_impl->types.ops->get_base_impl = woden_types_get_base_impl;
+ types_impl->types.ops->get_element_declaration =
+ woden_types_get_element_declaration;
+ types_impl->types.ops->get_type_definition =
+ woden_types_get_type_definition;
+ types_impl->types.ops->get_referenceable_schema_defs =
+ woden_types_get_referenceable_schema_defs;
+ types_impl->types.ops->is_namespace_in_scope_with_namespace_uri =
+ woden_types_is_namespace_in_scope_with_namespace_uri;
+ types_impl->types.ops->is_namespace_in_scope_with_qname =
+ woden_types_is_namespace_in_scope_with_qname;
+ types_impl->types.ops->is_namespace_in_scope_with_namespace =
+ woden_types_is_namespace_in_scope_with_namespace;
+
+ types_impl->methods = axis2_hash_make(env);
+ if(!types_impl->methods)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(types_impl->methods, "free", AXIS2_HASH_KEY_STRING,
+ woden_types_free);
+ axis2_hash_set(types_impl->methods, "super_objs", AXIS2_HASH_KEY_STRING,
+ woden_types_super_objs);
+ axis2_hash_set(types_impl->methods, "type",
+ AXIS2_HASH_KEY_STRING, woden_types_type);
+
+ axis2_hash_set(types_impl->methods, "set_type_system",
+ AXIS2_HASH_KEY_STRING,
+ woden_types_set_type_system);
+ axis2_hash_set(types_impl->methods, "get_type_system",
+ AXIS2_HASH_KEY_STRING,
+ woden_types_get_type_system);
+ axis2_hash_set(types_impl->methods, "add_schema",
+ AXIS2_HASH_KEY_STRING,
+ woden_types_add_schema);
+ axis2_hash_set(types_impl->methods, "remove_schema",
+ AXIS2_HASH_KEY_STRING,
+ woden_types_remove_schema);
+ axis2_hash_set(types_impl->methods, "get_schemas",
+ AXIS2_HASH_KEY_STRING,
+ woden_types_get_schemas);
+ axis2_hash_set(types_impl->methods, "get_schemas_with_namespace",
+ AXIS2_HASH_KEY_STRING,
+ woden_types_get_schemas_with_namespace);
+ axis2_hash_set(types_impl->methods, "get_inlined_schemas",
+ AXIS2_HASH_KEY_STRING,
+ woden_types_get_inlined_schemas);
+ axis2_hash_set(types_impl->methods, "get_imported_schemas",
+ AXIS2_HASH_KEY_STRING,
+ woden_types_get_imported_schemas);
+ axis2_hash_set(types_impl->methods, "get_element_declaration",
+ AXIS2_HASH_KEY_STRING,
+ woden_types_get_element_declaration);
+ axis2_hash_set(types_impl->methods, "get_type_definition",
+ AXIS2_HASH_KEY_STRING,
+ woden_types_get_type_definition);
+ axis2_hash_set(types_impl->methods, "get_referenceable_schema_defs",
+ AXIS2_HASH_KEY_STRING,
+ woden_types_get_referenceable_schema_defs);
+ axis2_hash_set(types_impl->methods, "get_referenceable_schema_defs_with_namespace",
+ AXIS2_HASH_KEY_STRING,
+ woden_types_get_referenceable_schema_defs_with_namespace);
+ axis2_hash_set(types_impl->methods, "is_namespace_in_scope_with_namespace_uri",
+ AXIS2_HASH_KEY_STRING,
+ woden_types_is_namespace_in_scope_with_namespace_uri);
+ axis2_hash_set(types_impl->methods, "is_namespace_in_scope_with_qname",
+ AXIS2_HASH_KEY_STRING,
+ woden_types_is_namespace_in_scope_with_qname);
+ axis2_hash_set(types_impl->methods, "is_namespace_in_scope_with_namespace",
+ AXIS2_HASH_KEY_STRING,
+ woden_types_is_namespace_in_scope_with_namespace);
+
+
+ return &(types_impl->types);
+}
+
+AXIS2_EXTERN woden_types_t * AXIS2_CALL
+woden_types_create(const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ types_impl = (woden_types_impl_t *) create(env);
+
+ types_impl->documentable = woden_documentable_create(env);
+
+ types_impl->super = axis2_hash_make(env);
+ if(!types_impl->super)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(types_impl->super, "WODEN_TYPES", AXIS2_HASH_KEY_STRING,
+ &(types_impl->types));
+ axis2_hash_set(types_impl->super, "WODEN_DOCUMENTABLE", AXIS2_HASH_KEY_STRING,
+ types_impl->documentable);
+
+ return &(types_impl->types);
+}
+
+static axis2_status_t
+woden_types_free_ops(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ types_impl = INTF_TO_IMPL(types);
+
+ if(types_impl->types.base.types_element.ops)
+ {
+ AXIS2_FREE(env->allocator, types_impl->types.base.
+ types_element.ops);
+ types_impl->types.base.types_element.ops = NULL;
+ }
+
+ if(types_impl->types.base.types_element.documentable_element.ops)
+ {
+ AXIS2_FREE(env->allocator, types_impl->types.base.
+ types_element.documentable_element.ops);
+ types_impl->types.base.types_element.documentable_element.ops =
+ NULL;
+ }
+
+ if(types_impl->types.base.documentable.ops)
+ {
+ AXIS2_FREE(env->allocator, types_impl->types.base.
+ documentable.ops);
+ types_impl->types.base.documentable.ops =
+ NULL;
+ }
+
+ if(types_impl->types.base.documentable.base.wsdl_obj.ops)
+ {
+ AXIS2_FREE(env->allocator, types_impl->types.base.
+ documentable.base.wsdl_obj.ops);
+ types_impl->types.base.documentable.base.wsdl_obj.ops =
+ NULL;
+ }
+
+ if(types_impl->types.base.documentable.base.wsdl_obj.base.wsdl_component.ops)
+ {
+ AXIS2_FREE(env->allocator, types_impl->types.base.
+ documentable.base.wsdl_obj.base.wsdl_component.ops);
+ types_impl->types.base.documentable.base.wsdl_obj.base.wsdl_component.
+ ops = NULL;
+ }
+
+ if(types_impl->types.base.documentable.base.wsdl_obj.base.
+ wsdl_element.base.attr_extensible.ops)
+ {
+ AXIS2_FREE(env->allocator, types_impl->types.base.documentable.
+ base.wsdl_obj.base.wsdl_element.base.attr_extensible.ops);
+ types_impl->types.base.documentable.base.wsdl_obj.base.wsdl_element.
+ base.attr_extensible.ops = NULL;
+ }
+
+ if(types_impl->types.base.documentable.base.wsdl_obj.base.
+ wsdl_element.base.element_extensible.ops)
+ {
+ AXIS2_FREE(env->allocator, types_impl->types.base.documentable.
+ base.wsdl_obj.base.wsdl_element.base.element_extensible.ops);
+ types_impl->types.base.documentable.base.wsdl_obj.base.wsdl_element.
+ base.element_extensible.ops = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+
+axis2_status_t AXIS2_CALL
+woden_types_free(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ types_impl = INTF_TO_IMPL(types);
+
+ if(types_impl->f_schemas)
+ {
+ AXIS2_ARRAY_LIST_FREE(types_impl->f_schemas, env);
+ types_impl->f_schemas = NULL;
+ }
+
+ if(types_impl->schema_defs)
+ {
+ AXIS2_ARRAY_LIST_FREE(types_impl->schema_defs, env);
+ types_impl->schema_defs = NULL;
+ }
+
+ if(types_impl->f_type_system)
+ {
+ AXIS2_FREE(env->allocator, types_impl->f_type_system);
+ types_impl->f_type_system = NULL;
+ }
+
+ if(types_impl->super)
+ {
+ axis2_hash_free(types_impl->super, env);
+ types_impl->super = NULL;
+ }
+
+ if(types_impl->methods)
+ {
+ axis2_hash_free(types_impl->methods, env);
+ types_impl->methods = NULL;
+ }
+
+ if(types_impl->documentable)
+ {
+ WODEN_DOCUMENTABLE_FREE(types_impl->documentable, env);
+ types_impl->documentable = NULL;
+ }
+
+ woden_types_free_ops(types, env);
+
+ if((&(types_impl->types))->ops)
+ {
+ AXIS2_FREE(env->allocator, (&(types_impl->types))->ops);
+ (&(types_impl->types))->ops = NULL;
+ }
+
+ if(types_impl)
+ {
+ AXIS2_FREE(env->allocator, types_impl);
+ types_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_hash_t *AXIS2_CALL
+woden_types_super_objs(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ types_impl = INTF_TO_IMPL(types);
+
+ return types_impl->super;
+}
+
+woden_obj_types_t AXIS2_CALL
+woden_types_type(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ types_impl = INTF_TO_IMPL(types);
+
+ return types_impl->obj_type;
+}
+
+woden_documentable_t *AXIS2_CALL
+woden_types_get_base_impl(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ types_impl = INTF_TO_IMPL(types);
+
+ return types_impl->documentable;
+}
+
+axis2_status_t AXIS2_CALL
+woden_types_resolve_methods(
+ woden_types_t *types,
+ const axis2_env_t *env,
+ woden_types_t *types_impl,
+ axis2_hash_t *methods)
+{
+ woden_types_impl_t *types_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, methods, AXIS2_FAILURE);
+ types_impl_l = INTF_TO_IMPL(types_impl);
+
+ types->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ types->ops->super_objs = axis2_hash_get(methods, "super_objs",
+ AXIS2_HASH_KEY_STRING);
+ types->ops->type = axis2_hash_get(methods, "type",
+ AXIS2_HASH_KEY_STRING);
+
+ types->ops->get_element_declaration = axis2_hash_get(methods,
+ "get_element_declaration", AXIS2_HASH_KEY_STRING);
+ if(!types->ops->get_element_declaration && types_impl_l)
+ types->ops->get_element_declaration =
+ types_impl_l->types.ops->get_element_declaration;
+
+ types->ops->get_type_definition = axis2_hash_get(methods,
+ "get_type_definition", AXIS2_HASH_KEY_STRING);
+ if(!types->ops->get_type_definition && types_impl_l)
+ types->ops->get_type_definition =
+ types_impl_l->types.ops->get_type_definition;
+
+ types->ops->get_referenceable_schema_defs = axis2_hash_get(methods,
+ "get_referenceable_schema_defs", AXIS2_HASH_KEY_STRING);
+ if(!types->ops->get_referenceable_schema_defs && types_impl_l)
+ types->ops->get_referenceable_schema_defs =
+ types_impl_l->types.ops->get_referenceable_schema_defs;
+
+ types->ops->is_namespace_in_scope_with_namespace_uri =
+ axis2_hash_get(methods, "is_namespace_in_scope_with_namespace_uri",
+ AXIS2_HASH_KEY_STRING);
+ if(!types->ops->is_namespace_in_scope_with_namespace_uri && types_impl_l)
+ types->ops->is_namespace_in_scope_with_namespace_uri =
+ types_impl_l->types.ops->is_namespace_in_scope_with_namespace_uri;
+
+ types->ops->is_namespace_in_scope_with_qname = axis2_hash_get(methods,
+ "is_namespace_in_scope_with_qname", AXIS2_HASH_KEY_STRING);
+ if(!types->ops->is_namespace_in_scope_with_qname && types_impl_l)
+ types->ops->is_namespace_in_scope_with_qname =
+ types_impl_l->types.ops->is_namespace_in_scope_with_qname;
+
+ types->ops->is_namespace_in_scope_with_namespace = axis2_hash_get(methods,
+ "is_namespace_in_scope_with_namespace", AXIS2_HASH_KEY_STRING);
+ if(!types->ops->is_namespace_in_scope_with_namespace && types_impl_l)
+ types->ops->is_namespace_in_scope_with_namespace =
+ types_impl_l->types.ops->is_namespace_in_scope_with_namespace;
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+woden_types_set_type_system(
+ void *types,
+ const axis2_env_t *env,
+ axis2_char_t *type_system)
+{
+ woden_types_impl_t *types_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, type_system, AXIS2_FAILURE);
+ super = WODEN_TYPES_SUPER_OBJS(types, env);
+ types_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_TYPES", AXIS2_HASH_KEY_STRING));
+
+ if(types_impl->f_type_system)
+ {
+ AXIS2_FREE(env->allocator, types_impl->f_type_system);
+ }
+ types_impl->f_type_system = AXIS2_STRDUP(type_system, env);
+ if(!types_impl->f_type_system)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE)
+ return AXIS2_FAILURE;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_char_t *AXIS2_CALL
+woden_types_get_type_system(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_TYPES_SUPER_OBJS(types, env);
+ types_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_TYPES", AXIS2_HASH_KEY_STRING));
+ return types_impl->f_type_system;
+}
+
+axis2_status_t AXIS2_CALL
+woden_types_add_schema(
+ void *types,
+ const axis2_env_t *env,
+ void *schema)
+{
+ woden_types_impl_t *types_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, schema, AXIS2_FAILURE);
+ super = WODEN_TYPES_SUPER_OBJS(types, env);
+ types_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_TYPES", AXIS2_HASH_KEY_STRING));
+
+ return AXIS2_ARRAY_LIST_ADD(types_impl->f_schemas, env, schema);
+}
+
+axis2_status_t AXIS2_CALL
+woden_types_remove_schema(
+ void *types,
+ const axis2_env_t *env,
+ xml_schema_t *schema)
+{
+ woden_types_impl_t *types_impl = NULL;
+ int index = 0;
+ axis2_status_t code = AXIS2_FAILURE;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, schema, AXIS2_FAILURE);
+ super = WODEN_TYPES_SUPER_OBJS(types, env);
+ types_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_TYPES", AXIS2_HASH_KEY_STRING));
+
+ index = AXIS2_ARRAY_LIST_INDEX_OF(types_impl->f_schemas, env, schema);
+ AXIS2_ARRAY_LIST_REMOVE(types_impl->f_schemas, env, index);
+ code = AXIS2_ERROR_GET_STATUS_CODE(env->error);
+ return code;
+}
+
+axis2_array_list_t *AXIS2_CALL
+woden_types_get_schemas(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_TYPES_SUPER_OBJS(types, env);
+ types_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_TYPES", AXIS2_HASH_KEY_STRING));
+ return types_impl->f_schemas;
+}
+
+axis2_array_list_t *AXIS2_CALL
+woden_types_get_schemas_with_namespace(
+ void *types,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc)
+{
+ woden_types_impl_t *types_impl = NULL;
+ int i = 0, size = 0;
+ axis2_char_t *str_namespc = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_TYPES_SUPER_OBJS(types, env);
+ types_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_TYPES", AXIS2_HASH_KEY_STRING));
+
+ if(namespc)
+ str_namespc = AXIS2_URI_TO_STRING(namespc, env, AXIS2_URI_UNP_OMITUSERINFO);
+ size = AXIS2_ARRAY_LIST_SIZE(types_impl->f_schemas, env);
+ for(i = 0; i < size; i++)
+ {
+ axis2_char_t *str_namespc_l = NULL;
+ woden_schema_t *schema = (woden_schema_t *)
+ AXIS2_ARRAY_LIST_GET(types_impl->f_schemas, env, i);
+ str_namespc_l = WODEN_SCHEMA_GET_NAMESPACE_AS_STRING(schema, env);
+ /* get schemas whose namespace is missing */
+ if(!str_namespc && !str_namespc_l)
+ AXIS2_ARRAY_LIST_ADD(types_impl->schema_defs, env, schema);
+ else if(str_namespc && str_namespc_l && 0 == AXIS2_STRCMP(str_namespc,
+ str_namespc_l))
+ {
+ AXIS2_ARRAY_LIST_ADD(types_impl->schema_defs ,env, schema);
+ }
+ }
+ return types_impl->schema_defs;
+}
+
+axis2_array_list_t *AXIS2_CALL
+woden_types_get_inlined_schemas(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+ int i = 0, size = 0;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_TYPES_SUPER_OBJS(types, env);
+ types_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_TYPES", AXIS2_HASH_KEY_STRING));
+
+ size = AXIS2_ARRAY_LIST_SIZE(types_impl->f_schemas, env);
+ for(i = 0; i < size; i++)
+ {
+ woden_schema_t *s = (woden_schema_t *)
+ AXIS2_ARRAY_LIST_GET(types_impl->f_schemas, env, i);
+ if(WODEN_INLINED_SCHEMA == WODEN_SCHEMA_TYPE(s, env))
+ {
+ AXIS2_ARRAY_LIST_ADD(types_impl->schema_defs, env, s);
+ }
+ }
+ return types_impl->schema_defs;
+}
+
+axis2_array_list_t *AXIS2_CALL
+woden_types_get_imported_schemas(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+ int i = 0, size = 0;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_TYPES_SUPER_OBJS(types, env);
+ types_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_TYPES", AXIS2_HASH_KEY_STRING));
+
+ size = AXIS2_ARRAY_LIST_SIZE(types_impl->f_schemas, env);
+ for(i = 0; i < size; i++)
+ {
+ woden_schema_t *s = (woden_schema_t *)
+ AXIS2_ARRAY_LIST_GET(types_impl->f_schemas, env, i);
+ if(WODEN_IMPORTED_SCHEMA == WODEN_SCHEMA_TYPE(s, env))
+ {
+ AXIS2_ARRAY_LIST_ADD(types_impl->schema_defs, env, s);
+ }
+ }
+ return types_impl->schema_defs;
+}
+
+void *AXIS2_CALL
+woden_types_get_element_declaration(
+ void *types,
+ const axis2_env_t *env,
+ axis2_qname_t *qname)
+{
+ woden_types_impl_t *types_impl = NULL;
+ xml_schema_element_t *xml_schema_el = NULL;
+ axis2_array_list_t *schemas = NULL;
+ axis2_hash_t *super = NULL;
+ axis2_char_t *uri = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_TYPES_SUPER_OBJS(types, env);
+ types_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_TYPES", AXIS2_HASH_KEY_STRING));
+ /* Can't resolve the element if the QName is NULL.*/
+ if(NULL == qname)
+ return NULL;
+
+ uri = AXIS2_QNAME_GET_URI(qname, env);
+ schemas = woden_types_get_referenceable_schema_defs_with_namespace(
+ types, env, uri);
+ if(schemas)
+ {
+ int i = 0, size = 0;
+
+ /* search the schemas with this qname's namespace */
+ size = AXIS2_ARRAY_LIST_SIZE(schemas, env);
+ for(i = 0; i < size; i++)
+ {
+ xml_schema_t *xml_schema = (xml_schema_t *)
+ AXIS2_ARRAY_LIST_GET(schemas, env, i);
+ xml_schema_el = XML_SCHEMA_GET_ELEMENT_BY_QNAME(xml_schema,
+ env, qname);
+ if(xml_schema_el)
+ {
+ break;
+ }
+ }
+ }
+ return xml_schema_el;
+}
+
+void *AXIS2_CALL
+woden_types_get_type_definition(
+ void *types,
+ const axis2_env_t *env,
+ axis2_qname_t *qname)
+{
+ woden_types_impl_t *types_impl = NULL;
+ xml_schema_type_t *xml_schema_type = NULL;
+ axis2_array_list_t *schema_refs = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_TYPES_SUPER_OBJS(types, env);
+ types_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_TYPES", AXIS2_HASH_KEY_STRING));
+
+ if(qname)
+ {
+ axis2_char_t *uri = AXIS2_QNAME_GET_URI(qname, env);
+ schema_refs =
+ woden_types_get_referenceable_schema_defs_with_namespace(
+ types, env, uri);
+ if(schema_refs)
+ {
+ int i = 0, size = 0;
+
+ /* search the schemas with this qname's namespace */
+ size = AXIS2_ARRAY_LIST_SIZE(schema_refs, env);
+ for(i = 0; i < size; i++)
+ {
+ xml_schema_t *xml_schema = (xml_schema_t *)
+ AXIS2_ARRAY_LIST_GET(schema_refs, env, i);
+ xml_schema_type = XML_SCHEMA_GET_TYPE_BY_QNAME(xml_schema,
+ env, qname);
+ if(xml_schema_type)
+ {
+ break;
+ }
+ }
+ }
+ }
+ return xml_schema_type;
+}
+
+axis2_array_list_t *AXIS2_CALL
+woden_types_get_referenceable_schema_defs(
+ void *types,
+ const axis2_env_t *env)
+{
+ woden_types_impl_t *types_impl = NULL;
+ int i = 0, size = 0;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_TYPES_SUPER_OBJS(types, env);
+ types_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_TYPES", AXIS2_HASH_KEY_STRING));
+
+ if(types_impl->schema_defs)
+ {
+ int i = 0, size = 0;
+ size = AXIS2_ARRAY_LIST_SIZE(types_impl->schema_defs, env);
+ for(i = 0; i < size; i++)
+ {
+ woden_schema_t *schema = AXIS2_ARRAY_LIST_GET(
+ types_impl->schema_defs, env, i);
+ WODEN_SCHEMA_FREE(schema, env);
+ }
+ AXIS2_ARRAY_LIST_FREE(types_impl->schema_defs, env);
+ }
+ types_impl->schema_defs = axis2_array_list_create(env, 0);
+ if(!types_impl->schema_defs)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ size = AXIS2_ARRAY_LIST_SIZE(types_impl->f_schemas, env);
+ for(i = 0; i < size; i++)
+ {
+ void *s = AXIS2_ARRAY_LIST_GET(types_impl->f_schemas, env, i);
+ xml_schema_t *schema_def = WODEN_SCHEMA_GET_SCHEMA_DEF(s,
+ env);
+ if(AXIS2_TRUE == WODEN_SCHEMA_IS_REFERENCEABLE(s, env) &&
+ NULL != schema_def)
+ {
+ AXIS2_ARRAY_LIST_ADD(types_impl->schema_defs, env, schema_def);
+ }
+ }
+ return types_impl->schema_defs;
+}
+
+static axis2_array_list_t *
+woden_types_get_referenceable_schema_defs_with_namespace(
+ void *types,
+ const axis2_env_t *env,
+ axis2_char_t *namespc)
+{
+ woden_types_impl_t *types_impl = NULL;
+ int i = 0, size = 0;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ AXIS2_PARAM_CHECK(env->error, namespc, NULL);
+ super = WODEN_TYPES_SUPER_OBJS(types, env);
+ types_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_TYPES", AXIS2_HASH_KEY_STRING));
+
+ size = AXIS2_ARRAY_LIST_SIZE(types_impl->f_schemas, env);
+ for(i = 0; i < size; i++)
+ {
+ woden_schema_t *schema =
+ (woden_schema_t *) AXIS2_ARRAY_LIST_GET(types_impl->f_schemas,
+ env, i);
+ axis2_char_t *namespc_l =
+ WODEN_SCHEMA_GET_NAMESPACE_AS_STRING(schema, env);
+ xml_schema_t *schema_def =
+ WODEN_SCHEMA_GET_SCHEMA_DEF(schema, env);
+ if(AXIS2_TRUE == WODEN_SCHEMA_IS_REFERENCEABLE(schema, env) &&
+ 0 == AXIS2_STRCMP(namespc, namespc_l) && NULL != schema_def)
+ {
+ AXIS2_ARRAY_LIST_ADD(types_impl->schema_defs, env, schema_def);
+ }
+ }
+ return types_impl->schema_defs;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_types_is_namespace_in_scope_with_namespace_uri(
+ void *types,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc_uri)
+{
+ woden_types_impl_t *types_impl = NULL;
+ axis2_char_t *str_uri = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_PARAM_CHECK(env->error, namespc_uri, AXIS2_FAILURE);
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ super = WODEN_TYPES_SUPER_OBJS(types, env);
+ types_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_TYPES", AXIS2_HASH_KEY_STRING));
+
+ str_uri = AXIS2_URI_TO_STRING(namespc_uri, env, AXIS2_URI_UNP_OMITUSERINFO);
+ return woden_types_is_namespace_in_scope_with_namespace(types, env, str_uri);
+}
+
+axis2_bool_t AXIS2_CALL
+woden_types_is_namespace_in_scope_with_qname(
+ void *types,
+ const axis2_env_t *env,
+ axis2_qname_t *qname)
+{
+ woden_types_impl_t *types_impl = NULL;
+ axis2_char_t *str_uri = NULL;
+ axis2_uri_t *uri = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, qname, AXIS2_FAILURE);
+ super = WODEN_TYPES_SUPER_OBJS(types, env);
+ types_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_TYPES", AXIS2_HASH_KEY_STRING));
+
+ str_uri = AXIS2_QNAME_GET_URI(qname, env);
+ uri = axis2_uri_parse_string(env, str_uri);
+ return woden_types_is_namespace_in_scope_with_namespace_uri(types, env, uri);
+}
+
+axis2_bool_t AXIS2_CALL
+woden_types_is_namespace_in_scope_with_namespace(
+ void *types,
+ const axis2_env_t *env,
+ axis2_char_t *namespc)
+{
+ woden_types_impl_t *types_impl = NULL;
+ axis2_bool_t result = AXIS2_FALSE;
+ int i = 0, size = 0;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, namespc, AXIS2_FAILURE);
+ super = WODEN_TYPES_SUPER_OBJS(types, env);
+ types_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_TYPES", AXIS2_HASH_KEY_STRING));
+
+ size = AXIS2_ARRAY_LIST_SIZE(types_impl->f_schemas, env);
+ for(i = 0; i < size; i++)
+ {
+ axis2_char_t *namespc_l = NULL;
+
+ woden_schema_t *s = (woden_schema_t *) AXIS2_ARRAY_LIST_GET(
+ types_impl->f_schemas, env, i);
+ if(!s)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_WSDL_SCHEMA_IS_NULL,
+ AXIS2_FAILURE);
+ return AXIS2_FALSE;
+ }
+ namespc_l = WODEN_SCHEMA_GET_NAMESPACE_AS_STRING(s, env);
+ if(AXIS2_TRUE ==WODEN_SCHEMA_IS_REFERENCEABLE(s, env) &&
+ 0 == AXIS2_STRCMP(namespc, namespc_l))
+ {
+ result = AXIS2_TRUE;
+ break;
+ }
+ }
+ return result;
+}
+
Added: webservices/axis2/trunk/c/woden/src/wsdl/wsdl_component.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/wsdl/wsdl_component.c?rev=419452&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/wsdl/wsdl_component.c (added)
+++ webservices/axis2/trunk/c/woden/src/wsdl/wsdl_component.c Wed Jul 5 23:02:19 2006
@@ -0,0 +1,39 @@
+/*
+ * 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_wsdl_component.h>
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_component_resolve_methods(
+ woden_wsdl_component_t *wsdl_component,
+ const axis2_env_t *env,
+ axis2_hash_t *methods)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, methods, AXIS2_FAILURE);
+
+ wsdl_component->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ wsdl_component->ops->to_wsdl_component_free = axis2_hash_get(methods,
+ "to_wsdl_component_free", AXIS2_HASH_KEY_STRING);
+ wsdl_component->ops->type = axis2_hash_get(methods, "type",
+ AXIS2_HASH_KEY_STRING);
+ wsdl_component->ops->get_component_exts_for_namespace = axis2_hash_get(methods,
+ "get_component_exts_for_namespace", AXIS2_HASH_KEY_STRING);
+
+ return AXIS2_SUCCESS;
+}
+
Added: webservices/axis2/trunk/c/woden/src/wsdl/wsdl_element.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/wsdl/wsdl_element.c?rev=419452&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/wsdl/wsdl_element.c (added)
+++ webservices/axis2/trunk/c/woden/src/wsdl/wsdl_element.c Wed Jul 5 23:02:19 2006
@@ -0,0 +1,698 @@
+/*
+ * 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_wsdl_element.h>
+#include <woden_element_extensible.h>
+#include <woden_attr_extensible.h>
+#include <woden_ext_element.h>
+#include <woden_xml_attr.h>
+#include <axis2_uri.h>
+#include <axis2_hash.h>
+
+typedef struct woden_wsdl_element_impl woden_wsdl_element_impl_t;
+
+/**
+ * @brief Wsdl Element Struct Impl
+ * Axis2 Wsdl Element
+ */
+struct woden_wsdl_element_impl
+{
+ woden_wsdl_element_t wsdl_element;
+ woden_obj_types_t obj_type;
+ axis2_hash_t *super;
+ axis2_hash_t *methods;
+ woden_attr_extensible_t *f_attr_ext;
+ woden_element_extensible_t *f_elem_ext;
+};
+
+#define INTF_TO_IMPL(wsdl_element) \
+ ((woden_wsdl_element_impl_t *) wsdl_element)
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_element_free(
+ void *wsdl_element,
+ const axis2_env_t *envv);
+
+axis2_hash_t *AXIS2_CALL
+woden_wsdl_element_super_objs(
+ void *wsdl_element,
+ const axis2_env_t *envv);
+
+woden_obj_types_t AXIS2_CALL
+woden_wsdl_element_type(
+ void *wsdl_element,
+ const axis2_env_t *envv);
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_element_set_ext_attr(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ axis2_qname_t *attr_type,
+ woden_xml_attr_t *attr);
+
+void *AXIS2_CALL
+woden_wsdl_element_get_ext_attr(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ axis2_qname_t *attr_type);
+
+axis2_array_list_t *AXIS2_CALL
+woden_wsdl_element_get_ext_attrs(
+ void *wsdl_element,
+ const axis2_env_t *env);
+
+axis2_array_list_t *AXIS2_CALL
+woden_wsdl_element_get_ext_attrs_for_namespace(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc);
+
+axis2_bool_t AXIS2_CALL
+woden_wsdl_element_has_ext_attrs_for_namespace(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc);
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_element_add_ext_element(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ woden_ext_element_t *ext_el);
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_element_remove_ext_element(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ woden_ext_element_t *ext_el);
+
+axis2_array_list_t *AXIS2_CALL
+woden_wsdl_element_get_ext_elements(
+ void *wsdl_element,
+ const axis2_env_t *env);
+
+axis2_array_list_t *AXIS2_CALL
+woden_wsdl_element_get_ext_elements_of_type(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ axis2_qname_t *elem_type);
+
+axis2_bool_t AXIS2_CALL
+woden_wsdl_element_has_ext_elements_for_namespace(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc);
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_element_add_ext_element(
+ void *wsdl_element,
+ const axis2_env_t *env,
+woden_ext_element_t *ext_el);
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_element_remove_ext_element(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ woden_ext_element_t *ext_el);
+
+axis2_array_list_t *AXIS2_CALL
+woden_wsdl_element_get_ext_elements(
+ void *wsdl_element,
+ const axis2_env_t *env);
+
+axis2_array_list_t *AXIS2_CALL
+woden_wsdl_element_get_ext_elements_of_type(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ axis2_qname_t *ext_type);
+
+axis2_bool_t AXIS2_CALL
+woden_wsdl_element_has_ext_elements_for_namespace(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc);
+
+void *AXIS2_CALL
+woden_wsdl_element_get_element_extensible(
+ void *wsdl_element,
+ const axis2_env_t *env);
+
+void *AXIS2_CALL
+woden_wsdl_element_get_attr_extensible(
+ void *wsdl_element,
+ const axis2_env_t *env);
+
+static woden_wsdl_element_t *
+create(
+ const axis2_env_t *env);
+
+static axis2_status_t
+woden_wsdl_element_free_ops(
+ void *wsdl_element,
+ const axis2_env_t *env);
+
+/************************Woden C Internal Methods******************************/
+AXIS2_EXTERN woden_wsdl_element_t * AXIS2_CALL
+woden_wsdl_element_to_attr_extensible(
+ void *wsdl_element,
+ const axis2_env_t *env)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ if(!wsdl_element)
+ {
+ wsdl_element_impl = (woden_wsdl_element_impl_t *) create(env);
+ }
+ else
+ wsdl_element_impl = (woden_wsdl_element_impl_t *) wsdl_element;
+
+ woden_wsdl_element_free_ops(wsdl_element, env);
+
+ wsdl_element_impl->wsdl_element.base.attr_extensible.ops =
+ AXIS2_MALLOC(env->allocator,
+ sizeof(woden_attr_extensible_ops_t));
+ woden_attr_extensible_resolve_methods(&(wsdl_element_impl->
+ wsdl_element.base.attr_extensible), env, wsdl_element_impl->
+ f_attr_ext, wsdl_element_impl->methods);
+ return wsdl_element;
+
+}
+
+AXIS2_EXTERN woden_wsdl_element_t * AXIS2_CALL
+woden_wsdl_element_to_element_extensible(
+ void *wsdl_element,
+ const axis2_env_t *env)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ if(!wsdl_element)
+ {
+ wsdl_element_impl = (woden_wsdl_element_impl_t *) create(env);
+ }
+ else
+ wsdl_element_impl = (woden_wsdl_element_impl_t *) wsdl_element;
+
+ woden_wsdl_element_free_ops(wsdl_element, env);
+
+ wsdl_element_impl->wsdl_element.base.element_extensible.ops =
+ AXIS2_MALLOC(env->allocator,
+ sizeof(woden_element_extensible_ops_t));
+ woden_element_extensible_resolve_methods(&(wsdl_element_impl->
+ wsdl_element.base.element_extensible), env, wsdl_element_impl->f_elem_ext,
+ wsdl_element_impl->methods);
+ return wsdl_element;
+
+}
+
+/************************End of Woden C Internal Methods***********************/
+static woden_wsdl_element_t *
+create(
+ const axis2_env_t *env)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ wsdl_element_impl = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_wsdl_element_impl_t));
+
+ wsdl_element_impl->super = NULL;
+ wsdl_element_impl->methods = NULL;
+ wsdl_element_impl->obj_type = WODEN_WSDL_ELEMENT;
+ wsdl_element_impl->f_attr_ext = NULL;
+ wsdl_element_impl->f_elem_ext = NULL;
+
+ wsdl_element_impl->wsdl_element.base.attr_extensible.ops = NULL;
+ wsdl_element_impl->wsdl_element.base.element_extensible.ops = NULL;
+ wsdl_element_impl->wsdl_element.ops = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_wsdl_element_ops_t));
+
+ wsdl_element_impl->wsdl_element.ops->free = woden_wsdl_element_free;
+ wsdl_element_impl->wsdl_element.ops->super_objs =
+ woden_wsdl_element_super_objs;
+ wsdl_element_impl->wsdl_element.ops->type = woden_wsdl_element_type;
+ wsdl_element_impl->wsdl_element.ops->get_element_extensible =
+ woden_wsdl_element_get_element_extensible;
+ wsdl_element_impl->wsdl_element.ops->get_attr_extensible =
+ woden_wsdl_element_get_attr_extensible;
+
+ wsdl_element_impl->super = axis2_hash_make(env);
+ if(!wsdl_element_impl->super)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(wsdl_element_impl->super, "WODEN_WSDL_ELEMENT",
+ AXIS2_HASH_KEY_STRING, &(wsdl_element_impl->wsdl_element));
+
+ wsdl_element_impl->methods = axis2_hash_make(env);
+ if(!wsdl_element_impl->methods)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(wsdl_element_impl->methods, "free",
+ AXIS2_HASH_KEY_STRING, woden_wsdl_element_free);
+ axis2_hash_set(wsdl_element_impl->methods, "super_objs",
+ AXIS2_HASH_KEY_STRING, woden_wsdl_element_super_objs);
+ axis2_hash_set(wsdl_element_impl->methods, "type",
+ AXIS2_HASH_KEY_STRING, woden_wsdl_element_type);
+ axis2_hash_set(wsdl_element_impl->methods, "set_ext_attr",
+ AXIS2_HASH_KEY_STRING, woden_wsdl_element_set_ext_attr);
+ axis2_hash_set(wsdl_element_impl->methods, "get_ext_attr",
+ AXIS2_HASH_KEY_STRING, woden_wsdl_element_get_ext_attr);
+ axis2_hash_set(wsdl_element_impl->methods, "get_ext_attrs",
+ AXIS2_HASH_KEY_STRING, woden_wsdl_element_get_ext_attrs);
+ axis2_hash_set(wsdl_element_impl->methods, "get_ext_attrs_for_namespace",
+ AXIS2_HASH_KEY_STRING,
+ woden_wsdl_element_get_ext_attrs_for_namespace);
+ axis2_hash_set(wsdl_element_impl->methods, "has_ext_attrs_for_namespace",
+ AXIS2_HASH_KEY_STRING,
+ woden_wsdl_element_has_ext_attrs_for_namespace);
+ axis2_hash_set(wsdl_element_impl->methods, "add_ext_element",
+ AXIS2_HASH_KEY_STRING, woden_wsdl_element_add_ext_element);
+ axis2_hash_set(wsdl_element_impl->methods, "remove_ext_element",
+ AXIS2_HASH_KEY_STRING, woden_wsdl_element_remove_ext_element);
+ axis2_hash_set(wsdl_element_impl->methods, "get_ext_elements",
+ AXIS2_HASH_KEY_STRING, woden_wsdl_element_get_ext_elements);
+ axis2_hash_set(wsdl_element_impl->methods, "get_ext_elements_of_type",
+ AXIS2_HASH_KEY_STRING,
+ woden_wsdl_element_get_ext_elements_of_type);
+ axis2_hash_set(wsdl_element_impl->methods, "has_ext_elements_for_namespace",
+ AXIS2_HASH_KEY_STRING,
+ woden_wsdl_element_has_ext_elements_for_namespace);
+ axis2_hash_set(wsdl_element_impl->methods, "get_element_extensible",
+ AXIS2_HASH_KEY_STRING,
+ woden_wsdl_element_get_element_extensible);
+ axis2_hash_set(wsdl_element_impl->methods, "get_attr_extensible",
+ AXIS2_HASH_KEY_STRING,
+ woden_wsdl_element_get_attr_extensible);
+
+ return &(wsdl_element_impl->wsdl_element);
+}
+
+AXIS2_EXTERN woden_wsdl_element_t * AXIS2_CALL
+woden_wsdl_element_create(
+ const axis2_env_t *env)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ wsdl_element_impl = (woden_wsdl_element_impl_t *) create(env);
+
+ wsdl_element_impl->f_attr_ext = woden_attr_extensible_create(env);
+ if(!wsdl_element_impl->f_attr_ext)
+ {
+ return NULL;
+ }
+ wsdl_element_impl->f_elem_ext = woden_element_extensible_create(env);
+ if(!wsdl_element_impl->f_elem_ext)
+ {
+ return NULL;
+ }
+
+ wsdl_element_impl->super = axis2_hash_make(env);
+ if(!wsdl_element_impl->super)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(wsdl_element_impl->super, "WODEN_ELEMENT_EXTENSIBLE",
+ AXIS2_HASH_KEY_STRING, &(wsdl_element_impl->wsdl_element));
+ axis2_hash_set(wsdl_element_impl->super, "WODEN_ATTR_EXTENSIBLE",
+ AXIS2_HASH_KEY_STRING, &(wsdl_element_impl->wsdl_element));
+ axis2_hash_set(wsdl_element_impl->super, "WODEN_WSDL_ELEMENT",
+ AXIS2_HASH_KEY_STRING, &(wsdl_element_impl->wsdl_element));
+
+ return &(wsdl_element_impl->wsdl_element);
+}
+
+static axis2_status_t
+woden_wsdl_element_free_ops(
+ void *wsdl_element,
+ const axis2_env_t *env)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ wsdl_element_impl = INTF_TO_IMPL(wsdl_element);
+
+ if(wsdl_element_impl->wsdl_element.base.attr_extensible.ops)
+ {
+ AXIS2_FREE(env->allocator, wsdl_element_impl->wsdl_element.base.
+ attr_extensible.ops);
+ wsdl_element_impl->wsdl_element.base.attr_extensible.ops = NULL;
+ }
+
+ if(wsdl_element_impl->wsdl_element.base.element_extensible.ops)
+ {
+ AXIS2_FREE(env->allocator, wsdl_element_impl->wsdl_element.base.
+ element_extensible.ops);
+ wsdl_element_impl->wsdl_element.base.element_extensible.ops = NULL;
+ }
+
+ return AXIS2_SUCCESS;
+}
+
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_element_free(
+ void *wsdl_element,
+ const axis2_env_t *env)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ wsdl_element_impl = INTF_TO_IMPL(wsdl_element);
+
+ if(wsdl_element_impl->f_attr_ext)
+ {
+ WODEN_ATTR_EXTENSIBLE_FREE(wsdl_element_impl->f_attr_ext, env);
+ wsdl_element_impl->f_attr_ext = NULL;
+ }
+
+ if(wsdl_element_impl->f_elem_ext)
+ {
+ WODEN_ELEMENT_EXTENSIBLE_FREE(wsdl_element_impl->f_elem_ext, env);
+ wsdl_element_impl->f_elem_ext = NULL;
+ }
+
+ if(wsdl_element_impl->super)
+ {
+ axis2_hash_free(wsdl_element_impl->super, env);
+ wsdl_element_impl->super = NULL;
+ }
+
+ if(wsdl_element_impl->methods)
+ {
+ axis2_hash_free(wsdl_element_impl->methods, env);
+ wsdl_element_impl->methods = NULL;
+ }
+
+ woden_wsdl_element_free_ops(wsdl_element, env);
+
+ if(wsdl_element_impl->wsdl_element.ops)
+ {
+ AXIS2_FREE(env->allocator, wsdl_element_impl->wsdl_element.ops);
+ wsdl_element_impl->wsdl_element.ops = NULL;
+ }
+
+ if(wsdl_element_impl)
+ {
+ AXIS2_FREE(env->allocator, wsdl_element_impl);
+ wsdl_element_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_hash_t *AXIS2_CALL
+woden_wsdl_element_super_objs(
+ void *wsdl_element,
+ const axis2_env_t *env)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ wsdl_element_impl = INTF_TO_IMPL(wsdl_element);
+
+ return wsdl_element_impl->super;
+}
+
+woden_obj_types_t AXIS2_CALL
+woden_wsdl_element_type(
+ void *wsdl_element,
+ const axis2_env_t *env)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ wsdl_element_impl = INTF_TO_IMPL(wsdl_element);
+
+ return wsdl_element_impl->obj_type;
+}
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_element_resolve_methods(
+ woden_wsdl_element_t *wsdl_element,
+ const axis2_env_t *env,
+ woden_wsdl_element_t *wsdl_element_impl,
+ axis2_hash_t *methods)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, methods, AXIS2_FAILURE);
+ wsdl_element_impl_l = INTF_TO_IMPL(wsdl_element);
+
+ wsdl_element->ops = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_wsdl_element_ops_t));
+ wsdl_element->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ wsdl_element->ops->super_objs = axis2_hash_get(methods,
+ "super_objs", AXIS2_HASH_KEY_STRING);
+ wsdl_element->ops->type = axis2_hash_get(methods, "type",
+ AXIS2_HASH_KEY_STRING);
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_element_set_ext_attr(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ axis2_qname_t *attr_type,
+ woden_xml_attr_t *attr)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, attr_type, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, attr, AXIS2_FAILURE);
+ super = WODEN_WSDL_ELEMENT_SUPER_OBJS(wsdl_element, env);
+ wsdl_element_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_ELEMENT", AXIS2_HASH_KEY_STRING));
+
+ return WODEN_ATTR_EXTENSIBLE_SET_EXT_ATTR(wsdl_element_impl->f_attr_ext,
+ env, attr_type, attr);
+}
+
+void *AXIS2_CALL
+woden_wsdl_element_get_ext_attr(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ axis2_qname_t *attr_type)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ AXIS2_PARAM_CHECK(env->error, attr_type, NULL);
+ super = WODEN_WSDL_ELEMENT_SUPER_OBJS(wsdl_element, env);
+ wsdl_element_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_ELEMENT", AXIS2_HASH_KEY_STRING));
+
+ return WODEN_ATTR_EXTENSIBLE_GET_EXT_ATTR(wsdl_element_impl->f_attr_ext,
+ env, attr_type);
+}
+
+axis2_array_list_t *AXIS2_CALL
+woden_wsdl_element_get_ext_attrs(
+ void *wsdl_element,
+ const axis2_env_t *env)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_WSDL_ELEMENT_SUPER_OBJS(wsdl_element, env);
+ wsdl_element_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_ELEMENT", AXIS2_HASH_KEY_STRING));
+
+ return WODEN_ATTR_EXTENSIBLE_GET_EXT_ATTRS(wsdl_element_impl->f_attr_ext,
+ env);
+}
+
+axis2_array_list_t *AXIS2_CALL
+woden_wsdl_element_get_ext_attrs_for_namespace(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ AXIS2_PARAM_CHECK(env->error, namespc, NULL);
+ super = WODEN_WSDL_ELEMENT_SUPER_OBJS(wsdl_element, env);
+ wsdl_element_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_ELEMENT", AXIS2_HASH_KEY_STRING));
+
+ return WODEN_ATTR_EXTENSIBLE_GET_EXT_ATTRS_FOR_NAMESPACE(
+ wsdl_element_impl->f_attr_ext, env, namespc);
+}
+
+axis2_bool_t AXIS2_CALL
+woden_wsdl_element_has_ext_attrs_for_namespace(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, namespc, AXIS2_FAILURE);
+ super = WODEN_WSDL_ELEMENT_SUPER_OBJS(wsdl_element, env);
+ wsdl_element_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_ELEMENT", AXIS2_HASH_KEY_STRING));
+
+ return WODEN_ATTR_EXTENSIBLE_HAS_EXT_ATTRS_FOR_NAMESPACE(
+ wsdl_element_impl->f_attr_ext, env, namespc);
+}
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_element_add_ext_element(
+ void *wsdl_element,
+ const axis2_env_t *env,
+woden_ext_element_t *ext_el)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, ext_el, AXIS2_FAILURE);
+ super = WODEN_WSDL_ELEMENT_SUPER_OBJS(wsdl_element, env);
+ wsdl_element_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_ELEMENT", AXIS2_HASH_KEY_STRING));
+
+ return WODEN_ELEMENT_EXTENSIBLE_ADD_EXT_ELEMENT(wsdl_element_impl->
+ f_elem_ext, env, ext_el);
+}
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_element_remove_ext_element(
+ void *wsdl_element,
+ const axis2_env_t *env,
+woden_ext_element_t *ext_el)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, ext_el, AXIS2_FAILURE);
+ super = WODEN_WSDL_ELEMENT_SUPER_OBJS(wsdl_element, env);
+ wsdl_element_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_ELEMENT", AXIS2_HASH_KEY_STRING));
+
+ return WODEN_ELEMENT_EXTENSIBLE_REMOVE_EXT_ELEMENT(wsdl_element_impl->
+ f_elem_ext, env, ext_el);
+}
+
+axis2_array_list_t *AXIS2_CALL
+woden_wsdl_element_get_ext_elements(
+ void *wsdl_element,
+const axis2_env_t *env)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_WSDL_ELEMENT_SUPER_OBJS(wsdl_element, env);
+ wsdl_element_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_ELEMENT", AXIS2_HASH_KEY_STRING));
+
+ return WODEN_ELEMENT_EXTENSIBLE_GET_EXT_ELEMENTS(wsdl_element_impl->
+ f_elem_ext, env);
+}
+
+axis2_array_list_t *AXIS2_CALL
+woden_wsdl_element_get_ext_elements_of_type(
+ void *wsdl_element,
+ const axis2_env_t *env,
+axis2_qname_t *ext_type)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ AXIS2_PARAM_CHECK(env->error, ext_type, NULL);
+
+ super = WODEN_WSDL_ELEMENT_SUPER_OBJS(wsdl_element, env);
+ wsdl_element_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_ELEMENT", AXIS2_HASH_KEY_STRING));
+
+ return WODEN_ELEMENT_EXTENSIBLE_GET_EXT_ELEMENTS_OF_TYPE(
+ wsdl_element_impl->f_elem_ext, env, ext_type);
+}
+
+axis2_bool_t AXIS2_CALL
+woden_wsdl_element_has_ext_elements_for_namespace(
+ void *wsdl_element,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, namespc, AXIS2_FAILURE);
+ super = WODEN_WSDL_ELEMENT_SUPER_OBJS(wsdl_element, env);
+ wsdl_element_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_ELEMENT", AXIS2_HASH_KEY_STRING));
+
+ return WODEN_ELEMENT_EXTENSIBLE_HAS_EXT_ELEMENTS_FOR_NAMESPACE(
+ wsdl_element_impl->f_elem_ext, env, namespc);
+}
+
+void *AXIS2_CALL
+woden_wsdl_element_get_element_extensible(
+ void *wsdl_element,
+ const axis2_env_t *env)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_WSDL_ELEMENT_SUPER_OBJS(wsdl_element, env);
+ wsdl_element_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_ELEMENT", AXIS2_HASH_KEY_STRING));
+
+ return wsdl_element_impl->f_elem_ext;
+}
+
+void *AXIS2_CALL
+woden_wsdl_element_get_attr_extensible(
+ void *wsdl_element,
+ const axis2_env_t *env)
+{
+ woden_wsdl_element_impl_t *wsdl_element_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_WSDL_ELEMENT_SUPER_OBJS(wsdl_element, env);
+ wsdl_element_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_ELEMENT", AXIS2_HASH_KEY_STRING));
+
+ return wsdl_element_impl->f_attr_ext;
+}
+
+
+
+
Added: webservices/axis2/trunk/c/woden/src/wsdl/wsdl_obj.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/wsdl/wsdl_obj.c?rev=419452&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/wsdl/wsdl_obj.c (added)
+++ webservices/axis2/trunk/c/woden/src/wsdl/wsdl_obj.c Wed Jul 5 23:02:19 2006
@@ -0,0 +1,271 @@
+/*
+ * 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_wsdl_obj.h>
+#include <woden_component_exts.h>
+
+typedef struct woden_wsdl_obj_impl woden_wsdl_obj_impl_t;
+
+/**
+ * @brief Wsdl Object Struct Impl
+ * Axis2 Wsdl Object
+ */
+struct woden_wsdl_obj_impl
+{
+ woden_wsdl_obj_t wsdl_obj;
+ woden_wsdl_element_t *wsdl_element;
+ axis2_hash_t *super;
+ woden_obj_types_t obj_type;
+ axis2_hash_t *f_comp_exts;
+};
+
+#define INTF_TO_IMPL(wsdl_obj) ((woden_wsdl_obj_impl_t *) wsdl_obj)
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_obj_free(
+ void *wsdl_obj,
+ const axis2_env_t *env);
+
+axis2_hash_t *AXIS2_CALL
+woden_wsdl_obj_super_objs(
+ void *wsdl_obj,
+ const axis2_env_t *env);
+
+woden_wsdl_element_t *AXIS2_CALL
+woden_wsdl_obj_get_base_impl(
+ void *wsdl_obj,
+ const axis2_env_t *env);
+
+woden_component_exts_t *AXIS2_CALL
+woden_wsdl_obj_get_component_exts_for_namespace(
+ void *wsdl_obj,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc);
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_obj_set_component_exts(
+ void *wsdl_obj,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc,
+ woden_component_exts_t *exts);
+
+static woden_wsdl_obj_t *
+create(
+ const axis2_env_t *env)
+{
+ woden_wsdl_obj_impl_t *wsdl_obj_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ wsdl_obj_impl = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_wsdl_obj_impl_t));
+
+ wsdl_obj_impl->wsdl_element = NULL;
+ wsdl_obj_impl->f_comp_exts = NULL;
+
+ wsdl_obj_impl->wsdl_obj.ops = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_wsdl_obj_ops_t));
+ wsdl_obj_impl->f_comp_exts = axis2_hash_make(env);
+ if(!wsdl_obj_impl->f_comp_exts)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ wsdl_obj_impl->wsdl_obj.ops->free = woden_wsdl_obj_free;
+ wsdl_obj_impl->wsdl_obj.ops->super_objs = woden_wsdl_obj_super_objs;
+ wsdl_obj_impl->wsdl_obj.ops->get_base_impl = woden_wsdl_obj_get_base_impl;
+ wsdl_obj_impl->wsdl_obj.ops->get_component_exts_for_namespace =
+ woden_wsdl_obj_get_component_exts_for_namespace;
+ wsdl_obj_impl->wsdl_obj.ops->set_component_exts =
+ woden_wsdl_obj_set_component_exts;
+
+ return &(wsdl_obj_impl->wsdl_obj);
+}
+
+AXIS2_EXTERN woden_wsdl_obj_t * AXIS2_CALL
+woden_wsdl_obj_create(
+ const axis2_env_t *env)
+{
+ woden_wsdl_obj_impl_t *wsdl_obj_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ wsdl_obj_impl = (woden_wsdl_obj_impl_t *) create(env);
+
+ wsdl_obj_impl->wsdl_element = woden_wsdl_element_create(env);
+
+ wsdl_obj_impl->super = axis2_hash_make(env);
+ if(!wsdl_obj_impl->super)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(wsdl_obj_impl->super, "WODEN_WSDL_OBJ", AXIS2_HASH_KEY_STRING,
+ &(wsdl_obj_impl->wsdl_obj));
+ axis2_hash_set(wsdl_obj_impl->super, "WODEN_WSDL_ELEMENT", AXIS2_HASH_KEY_STRING,
+ wsdl_obj_impl->wsdl_element);
+ return &(wsdl_obj_impl->wsdl_obj);
+}
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_obj_free(
+ void *wsdl_obj,
+ const axis2_env_t *env)
+{
+ woden_wsdl_obj_impl_t *wsdl_obj_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ wsdl_obj_impl = INTF_TO_IMPL(wsdl_obj);
+
+ if(wsdl_obj_impl->wsdl_element)
+ {
+ WODEN_WSDL_ELEMENT_FREE(wsdl_obj_impl->wsdl_element, env);
+ wsdl_obj_impl->wsdl_element = NULL;
+ }
+
+ if(wsdl_obj_impl->super)
+ {
+ axis2_hash_free(wsdl_obj_impl->super, env);
+ wsdl_obj_impl->super = NULL;
+ }
+
+ if((&(wsdl_obj_impl->wsdl_obj))->ops)
+ {
+ AXIS2_FREE(env->allocator, (&(wsdl_obj_impl->wsdl_obj))->ops);
+ (&(wsdl_obj_impl->wsdl_obj))->ops = NULL;
+ }
+
+ if(wsdl_obj_impl)
+ {
+ AXIS2_FREE(env->allocator, wsdl_obj_impl);
+ wsdl_obj_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_hash_t *AXIS2_CALL
+woden_wsdl_obj_super_objs(
+ void *wsdl_obj,
+ const axis2_env_t *env)
+{
+ woden_wsdl_obj_impl_t *wsdl_obj_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ wsdl_obj_impl = INTF_TO_IMPL(wsdl_obj);
+
+ return wsdl_obj_impl->super;
+}
+
+woden_wsdl_element_t *AXIS2_CALL
+woden_wsdl_obj_get_base_impl(
+ void *wsdl_obj,
+ const axis2_env_t *env)
+{
+ woden_wsdl_obj_impl_t *wsdl_obj_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ wsdl_obj_impl = INTF_TO_IMPL(wsdl_obj);
+
+ return wsdl_obj_impl->wsdl_element;
+}
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_obj_resolve_methods(
+ woden_wsdl_obj_t *wsdl_obj,
+ const axis2_env_t *env,
+ woden_wsdl_obj_t *wsdl_obj_impl,
+ axis2_hash_t *methods)
+{
+ woden_wsdl_obj_impl_t *wsdl_obj_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, methods, AXIS2_FAILURE);
+ wsdl_obj_impl_l = INTF_TO_IMPL(wsdl_obj_impl);
+
+ wsdl_obj->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ wsdl_obj->ops->super_objs = axis2_hash_get(methods, "super_objs",
+ AXIS2_HASH_KEY_STRING);
+ wsdl_obj->ops->type = axis2_hash_get(methods, "type",
+ AXIS2_HASH_KEY_STRING);
+
+ wsdl_obj->ops->get_component_exts_for_namespace = axis2_hash_get(methods,
+ "get_component_exts_for_namespace", AXIS2_HASH_KEY_STRING);
+ if(!wsdl_obj->ops->get_component_exts_for_namespace && wsdl_obj_impl_l)
+ wsdl_obj->ops->get_component_exts_for_namespace =
+ wsdl_obj_impl_l->wsdl_obj.ops->get_component_exts_for_namespace;
+
+ wsdl_obj->ops->set_component_exts = axis2_hash_get(methods,
+ "set_component_exts", AXIS2_HASH_KEY_STRING);
+ if(!wsdl_obj->ops->set_component_exts && wsdl_obj_impl_l)
+ wsdl_obj->ops->set_component_exts =
+ wsdl_obj_impl_l->wsdl_obj.ops->set_component_exts;
+
+ return AXIS2_SUCCESS;
+}
+
+woden_component_exts_t *AXIS2_CALL
+woden_wsdl_obj_get_component_exts_for_namespace(
+ void *wsdl_obj,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc)
+{
+ woden_wsdl_obj_impl_t *wsdl_obj_impl = NULL;
+ axis2_char_t *str_namespc = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_WSDL_OBJ_SUPER_OBJS(wsdl_obj, env);
+ wsdl_obj_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_OBJ", AXIS2_HASH_KEY_STRING));
+
+ str_namespc = AXIS2_URI_TO_STRING(namespc, env, AXIS2_URI_UNP_OMITUSERINFO);
+ return (woden_component_exts_t *)axis2_hash_get(wsdl_obj_impl->
+ f_comp_exts, str_namespc, AXIS2_HASH_KEY_STRING);
+}
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_obj_set_component_exts(
+ void *wsdl_obj,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc,
+ woden_component_exts_t *exts)
+{
+ woden_wsdl_obj_impl_t *wsdl_obj_impl = NULL;
+ axis2_char_t *str_namespc = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, namespc, AXIS2_FAILURE);
+ super = WODEN_WSDL_OBJ_SUPER_OBJS(wsdl_obj, env);
+ wsdl_obj_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_OBJ", AXIS2_HASH_KEY_STRING));
+
+ str_namespc = AXIS2_URI_TO_STRING(namespc, env, AXIS2_URI_UNP_OMITUSERINFO);
+ if(NULL != str_namespc)
+ {
+ if(exts)
+ {
+ axis2_hash_set(wsdl_obj_impl->f_comp_exts, str_namespc,
+ AXIS2_HASH_KEY_STRING, exts);
+ }
+ else
+ {
+ axis2_hash_set(wsdl_obj_impl->f_comp_exts, str_namespc,
+ AXIS2_HASH_KEY_STRING, NULL);
+ }
+ }
+ return AXIS2_SUCCESS;
+}
+
Added: webservices/axis2/trunk/c/woden/src/wsdl/wsdl_ref.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/wsdl/wsdl_ref.c?rev=419452&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/wsdl/wsdl_ref.c (added)
+++ webservices/axis2/trunk/c/woden/src/wsdl/wsdl_ref.c Wed Jul 5 23:02:19 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_wsdl_ref.h>
+#include <woden_component_exts.h>
+#include <woden_desc_element.h>
+
+typedef struct woden_wsdl_ref_impl woden_wsdl_ref_impl_t;
+
+/**
+ * @brief Wsdl Ref Struct Impl
+ * Axis2 Wsdl Ref
+ */
+struct woden_wsdl_ref_impl
+{
+ woden_wsdl_ref_t wsdl_ref;
+ woden_wsdl_element_t *wsdl_element;
+ axis2_hash_t *super;
+ woden_obj_types_t obj_type;
+ axis2_array_list_t *f_documentation_elements;
+ axis2_uri_t *f_location;
+ woden_desc_element_t *f_desc_element;
+};
+
+#define INTF_TO_IMPL(wsdl_ref) ((woden_wsdl_ref_impl_t *) wsdl_ref)
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_ref_free(
+ void *wsdl_ref,
+ const axis2_env_t *env);
+
+axis2_hash_t *AXIS2_CALL
+woden_wsdl_ref_super_objs(
+ void *wsdl_ref,
+ const axis2_env_t *env);
+
+woden_wsdl_element_t *AXIS2_CALL
+woden_wsdl_ref_get_base_impl(
+ void *wsdl_ref,
+ const axis2_env_t *env);
+
+axis2_uri_t *AXIS2_CALL
+woden_wsdl_ref_get_location(
+ void *wsdl_ref,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_ref_set_location(
+ void *wsdl_ref,
+ const axis2_env_t *env,
+ axis2_uri_t *loc_uri);
+
+void *AXIS2_CALL
+woden_wsdl_ref_get_desc_element(
+ void *wsdl_ref,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_ref_set_desc_element(
+ void *wsdl_ref,
+ const axis2_env_t *env,
+ void *desc);
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_ref_add_documentation_element(
+ void *wsdl_ref,
+ const axis2_env_t *env,
+ void *doc_el);
+
+axis2_array_list_t *AXIS2_CALL
+woden_wsdl_ref_get_documentation_elements(
+ void *wsdl_ref,
+ const axis2_env_t *env);
+
+static woden_wsdl_ref_t *
+create(
+ const axis2_env_t *env)
+{
+ woden_wsdl_ref_impl_t *wsdl_ref_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ wsdl_ref_impl = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_wsdl_ref_impl_t));
+
+ wsdl_ref_impl->wsdl_element = NULL;
+ wsdl_ref_impl->f_documentation_elements = NULL;
+ wsdl_ref_impl->f_location = NULL;
+ wsdl_ref_impl->f_desc_element = NULL;
+
+ wsdl_ref_impl->wsdl_ref.ops = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_wsdl_ref_ops_t));
+
+ wsdl_ref_impl->wsdl_ref.ops->free = woden_wsdl_ref_free;
+ wsdl_ref_impl->wsdl_ref.ops->super_objs = woden_wsdl_ref_super_objs;
+ wsdl_ref_impl->wsdl_ref.ops->get_base_impl = woden_wsdl_ref_get_base_impl;
+ wsdl_ref_impl->wsdl_ref.ops->get_location =
+ woden_wsdl_ref_get_location;
+ wsdl_ref_impl->wsdl_ref.ops->set_location =
+ woden_wsdl_ref_set_location;
+ wsdl_ref_impl->wsdl_ref.ops->get_desc_element =
+ woden_wsdl_ref_get_desc_element;
+ wsdl_ref_impl->wsdl_ref.ops->set_desc_element =
+ woden_wsdl_ref_set_desc_element;
+ wsdl_ref_impl->wsdl_ref.ops->add_documentation_element =
+ woden_wsdl_ref_add_documentation_element;
+ wsdl_ref_impl->wsdl_ref.ops->get_documentation_elements =
+ woden_wsdl_ref_get_documentation_elements;
+
+ return &(wsdl_ref_impl->wsdl_ref);
+}
+
+AXIS2_EXTERN woden_wsdl_ref_t * AXIS2_CALL
+woden_wsdl_ref_create(
+ const axis2_env_t *env)
+{
+ woden_wsdl_ref_impl_t *wsdl_ref_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ wsdl_ref_impl = (woden_wsdl_ref_impl_t *) create(env);
+
+ wsdl_ref_impl->wsdl_element = woden_wsdl_element_create(env);
+
+ wsdl_ref_impl->super = axis2_hash_make(env);
+ if(!wsdl_ref_impl->super)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(wsdl_ref_impl->super, "WODEN_WSDL_REF", AXIS2_HASH_KEY_STRING,
+ &(wsdl_ref_impl->wsdl_ref));
+ axis2_hash_set(wsdl_ref_impl->super, "WODEN_WSDL_ELEMENT", AXIS2_HASH_KEY_STRING,
+ wsdl_ref_impl->wsdl_element);
+ return &(wsdl_ref_impl->wsdl_ref);
+}
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_ref_free(
+ void *wsdl_ref,
+ const axis2_env_t *env)
+{
+ woden_wsdl_ref_impl_t *wsdl_ref_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ wsdl_ref_impl = INTF_TO_IMPL(wsdl_ref);
+
+ if(wsdl_ref_impl->wsdl_element)
+ {
+ WODEN_WSDL_ELEMENT_FREE(wsdl_ref_impl->wsdl_element, env);
+ wsdl_ref_impl->wsdl_element = NULL;
+ }
+
+ if(wsdl_ref_impl->super)
+ {
+ axis2_hash_free(wsdl_ref_impl->super, env);
+ wsdl_ref_impl->super = NULL;
+ }
+
+ if((&(wsdl_ref_impl->wsdl_ref))->ops)
+ {
+ AXIS2_FREE(env->allocator, (&(wsdl_ref_impl->wsdl_ref))->ops);
+ (&(wsdl_ref_impl->wsdl_ref))->ops = NULL;
+ }
+
+ if(wsdl_ref_impl)
+ {
+ AXIS2_FREE(env->allocator, wsdl_ref_impl);
+ wsdl_ref_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_hash_t *AXIS2_CALL
+woden_wsdl_ref_super_objs(
+ void *wsdl_ref,
+ const axis2_env_t *env)
+{
+ woden_wsdl_ref_impl_t *wsdl_ref_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ wsdl_ref_impl = INTF_TO_IMPL(wsdl_ref);
+
+ return wsdl_ref_impl->super;
+}
+
+axis2_hash_t *AXIS2_CALL
+woden_wsdl_ref_super(
+ void *wsdl_ref,
+ const axis2_env_t *env)
+{
+ woden_wsdl_ref_impl_t *wsdl_ref_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ wsdl_ref_impl = INTF_TO_IMPL(wsdl_ref);
+
+ return wsdl_ref_impl->super;
+}
+
+woden_wsdl_element_t *AXIS2_CALL
+woden_wsdl_ref_get_base_impl(
+ void *wsdl_ref,
+ const axis2_env_t *env)
+{
+ woden_wsdl_ref_impl_t *wsdl_ref_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ wsdl_ref_impl = INTF_TO_IMPL(wsdl_ref);
+
+ return wsdl_ref_impl->wsdl_element;
+}
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_ref_resolve_methods(
+ woden_wsdl_ref_t *wsdl_ref,
+ const axis2_env_t *env,
+ woden_wsdl_ref_t *wsdl_ref_impl,
+ axis2_hash_t *methods)
+{
+ woden_wsdl_ref_impl_t *wsdl_ref_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, methods, AXIS2_FAILURE);
+ wsdl_ref_impl_l = INTF_TO_IMPL(wsdl_ref_impl);
+
+ wsdl_ref->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ wsdl_ref->ops->super_objs = axis2_hash_get(methods, "super_objs",
+ AXIS2_HASH_KEY_STRING);
+ wsdl_ref->ops->type = axis2_hash_get(methods, "type",
+ AXIS2_HASH_KEY_STRING);
+
+ wsdl_ref->ops->get_location = axis2_hash_get(methods,
+ "get_location", AXIS2_HASH_KEY_STRING);
+ if(!wsdl_ref->ops->get_location && wsdl_ref_impl_l)
+ wsdl_ref->ops->get_location =
+ wsdl_ref_impl_l->wsdl_ref.ops->get_location;
+
+ wsdl_ref->ops->set_location = axis2_hash_get(methods,
+ "set_location", AXIS2_HASH_KEY_STRING);
+ if(!wsdl_ref->ops->set_location && wsdl_ref_impl_l)
+ wsdl_ref->ops->set_location =
+ wsdl_ref_impl_l->wsdl_ref.ops->set_location;
+
+ wsdl_ref->ops->get_desc_element = axis2_hash_get(methods,
+ "get_desc_element", AXIS2_HASH_KEY_STRING);
+ if(!wsdl_ref->ops->get_desc_element && wsdl_ref_impl_l)
+ wsdl_ref->ops->get_desc_element =
+ wsdl_ref_impl_l->wsdl_ref.ops->get_desc_element;
+
+ wsdl_ref->ops->set_desc_element = axis2_hash_get(methods,
+ "set_desc_element", AXIS2_HASH_KEY_STRING);
+ if(!wsdl_ref->ops->set_desc_element && wsdl_ref_impl_l)
+ wsdl_ref->ops->set_desc_element =
+ wsdl_ref_impl_l->wsdl_ref.ops->set_desc_element;
+
+ wsdl_ref->ops->add_documentation_element = axis2_hash_get(methods,
+ "add_documentation_element", AXIS2_HASH_KEY_STRING);
+ if(!wsdl_ref->ops->add_documentation_element && wsdl_ref_impl_l)
+ wsdl_ref->ops->add_documentation_element =
+ wsdl_ref_impl_l->wsdl_ref.ops->add_documentation_element;
+
+ wsdl_ref->ops->get_documentation_elements = axis2_hash_get(methods,
+ "get_documentation_elements", AXIS2_HASH_KEY_STRING);
+ if(!wsdl_ref->ops->get_documentation_elements && wsdl_ref_impl_l)
+ wsdl_ref->ops->get_documentation_elements =
+ wsdl_ref_impl_l->wsdl_ref.ops->get_documentation_elements;
+
+
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_uri_t *AXIS2_CALL
+woden_wsdl_ref_get_location(
+ void *wsdl_ref,
+ const axis2_env_t *env)
+{
+ woden_wsdl_ref_impl_t *wsdl_ref_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_WSDL_REF_SUPER_OBJS(wsdl_ref, env);
+ wsdl_ref_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_REF", AXIS2_HASH_KEY_STRING));
+
+ return wsdl_ref_impl->f_location;
+}
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_ref_set_location(
+ void *wsdl_ref,
+ const axis2_env_t *env,
+ axis2_uri_t *loc_uri)
+{
+ woden_wsdl_ref_impl_t *wsdl_ref_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ super = WODEN_WSDL_REF_SUPER_OBJS(wsdl_ref, env);
+ wsdl_ref_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_REF", AXIS2_HASH_KEY_STRING));
+
+ if(wsdl_ref_impl->f_location)
+ {
+ /* TODO */
+ }
+ wsdl_ref_impl->f_location = loc_uri;
+ return AXIS2_SUCCESS;
+}
+
+void *AXIS2_CALL
+woden_wsdl_ref_get_desc_element(
+ void *wsdl_ref,
+ const axis2_env_t *env)
+{
+ woden_wsdl_ref_impl_t *wsdl_ref_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_WSDL_REF_SUPER_OBJS(wsdl_ref, env);
+ wsdl_ref_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_REF", AXIS2_HASH_KEY_STRING));
+
+ return wsdl_ref_impl->f_desc_element;
+}
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_ref_set_desc_element(
+ void *wsdl_ref,
+ const axis2_env_t *env,
+ void *desc)
+{
+ woden_wsdl_ref_impl_t *wsdl_ref_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ super = WODEN_WSDL_REF_SUPER_OBJS(wsdl_ref, env);
+ wsdl_ref_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_REF", AXIS2_HASH_KEY_STRING));
+
+ if(wsdl_ref_impl->f_desc_element)
+ {
+ /* TODO */
+ }
+ wsdl_ref_impl->f_desc_element = desc;
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+woden_wsdl_ref_add_documentation_element(
+ void *wsdl_ref,
+ const axis2_env_t *env,
+ void *doc_el)
+{
+ woden_wsdl_ref_impl_t *wsdl_ref_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ super = WODEN_WSDL_REF_SUPER_OBJS(wsdl_ref, env);
+ wsdl_ref_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_REF", AXIS2_HASH_KEY_STRING));
+
+ if(!wsdl_ref_impl->f_documentation_elements)
+ {
+ wsdl_ref_impl->f_documentation_elements = axis2_array_list_create(env, 0);
+ if(!wsdl_ref_impl->f_documentation_elements)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+ }
+ return AXIS2_ARRAY_LIST_ADD(wsdl_ref_impl->f_documentation_elements, env,
+ doc_el);
+}
+
+axis2_array_list_t *AXIS2_CALL
+woden_wsdl_ref_get_documentation_elements(
+ void *wsdl_ref,
+ const axis2_env_t *env)
+{
+ woden_wsdl_ref_impl_t *wsdl_ref_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_WSDL_REF_SUPER_OBJS(wsdl_ref, env);
+ wsdl_ref_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_WSDL_REF", AXIS2_HASH_KEY_STRING));
+
+ return wsdl_ref_impl->f_documentation_elements;
+}
+
Added: webservices/axis2/trunk/c/woden/src/wsdl10/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/wsdl10/Makefile.am?rev=419452&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/wsdl10/Makefile.am (added)
+++ webservices/axis2/trunk/c/woden/src/wsdl10/Makefile.am Wed Jul 5 23:02:19 2006
@@ -0,0 +1,33 @@
+SUBDIRS = xml extensions
+lib_LTLIBRARIES = libwoden_wsdl10.la
+
+libwoden_wsdl10_la_SOURCES = \
+ msg_ref.c \
+ part.c \
+ interface_fault_ref.c \
+ interface_msg_ref.c \
+ binding_msg_ref.c \
+ binding_op.c \
+ endpoint.c \
+ svc.c \
+ desc.c \
+ component_model_builder.c
+
+libwoden_wsdl10_la_LIBADD = \
+ $(top_builddir)/src/xml/libwoden_xml.la \
+ $(top_builddir)/src/util/libwoden_util.la \
+ $(top_builddir)/src/types/libwoden_types.la \
+ $(top_builddir)/src/schema/libwoden_schema.la \
+ $(top_builddir)/src/builder/wsdl10/libwoden_wsdl10_builder.la \
+ $(top_builddir)/src/wsdl10/xml/libwoden_wsdl10_xml.la \
+ $(top_builddir)/src/wsdl10/extensions/libwoden_wsdl10_extensions.la \
+ $(top_builddir)/src/wsdl10/extensions/soap/libwoden_wsdl10_extensions_soap.la \
+ $(top_builddir)/src/wsdl/libwoden_wsdl.la
+
+INCLUDES = -I$(top_builddir)/include \
+ @AXIOMINC@ \
+ @UTILINC@ \
+ @XMLSCHEMAINC@
+
+EXTRA_DIST = woden_constants.h
+
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org