axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r415946 [9/11] - in /webservices/axis2/trunk/c/woden/src: builder/wsdl10/ wsdl10/ wsdl10/enumeration/ wsdl10/extensions/ wsdl10/extensions/soap/ wsdl10/xml/
Date Wed, 21 Jun 2006 09:08:23 GMT
Added: webservices/axis2/trunk/c/woden/src/wsdl10/property.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/wsdl10/property.c?rev=415946&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/wsdl10/property.c (added)
+++ webservices/axis2/trunk/c/woden/src/wsdl10/property.c Wed Jun 21 02:08:20 2006
@@ -0,0 +1,1072 @@
+/*
+ * 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_property.h>
+#include <woden_types.h>
+#include <woden_ext_element.h>
+#include <woden_component_exts.h>
+#include <woden_xml_attr.h>
+#include <woden_documentation_element.h>
+#include <woden_type_def.h>
+#include <woden_generic_obj.h>
+#include <xml_schema_type.h>
+#include <axis2_generic_obj.h>
+
+typedef struct woden_property_impl woden_property_impl_t;
+
+/** 
+ * @brief Feature Struct Impl
+ *   Axis2 Feature  
+ */ 
+struct woden_property_impl
+{
+    woden_property_t property;
+    woden_obj_types_t obj_type;
+    woden_documentable_t *documentable;
+    axis2_hash_t *super;
+    axis2_hash_t *methods;
+    /* WSDL Component model data */
+    axis2_uri_t *f_ref;
+    axis2_generic_obj_t *f_value;
+    woden_type_def_t *f_value_constraint;
+    void *f_parent;
+    /* XML Element data */
+    axis2_qname_t *f_constraint_qname;
+    axis2_bool_t f_has_value_token;
+    void *f_types;
+};
+
+#define INTF_TO_IMPL(property) ((woden_property_impl_t *) property)
+
+axis2_status_t AXIS2_CALL 
+woden_property_free(
+        void *property,
+        const axis2_env_t *env);
+
+axis2_hash_t *AXIS2_CALL 
+woden_property_super_objs(
+        void *property,
+        const axis2_env_t *env);
+
+woden_obj_types_t AXIS2_CALL 
+woden_property_type(
+        void *property,
+        const axis2_env_t *env);
+
+woden_documentable_t *AXIS2_CALL
+woden_property_get_base_impl(
+        void *property,
+        const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_property_set_ref(
+        void *property,
+        const axis2_env_t *env,
+        axis2_uri_t *ref);
+
+axis2_uri_t *AXIS2_CALL
+woden_property_get_ref(
+        void *property,
+        const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_property_set_parent_element(
+        void *property,
+        const axis2_env_t *env,
+        woden_wsdl_element_t *parent);
+
+void *AXIS2_CALL
+woden_property_get_parent_element(
+        void *property,
+        const axis2_env_t *env);
+
+void *AXIS2_CALL
+woden_property_get_parent(
+        void *property,
+        const axis2_env_t *env);
+
+void *AXIS2_CALL
+woden_property_to_element(
+        void *property,
+        const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_property_set_value(
+        void *property,
+        const axis2_env_t *env,
+        axis2_generic_obj_t *value);
+
+void *AXIS2_CALL
+woden_property_get_value(
+        void *property,
+        const axis2_env_t *env);
+
+void *AXIS2_CALL
+woden_property_get_value_constraint(
+        void *property,
+        const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_property_set_constraint_qname(
+        void *property,
+        const axis2_env_t *env,
+        axis2_qname_t *type_def);
+
+axis2_qname_t *AXIS2_CALL
+woden_property_get_constraint_qname(
+        void *property,
+        const axis2_env_t *env);
+
+void *AXIS2_CALL
+woden_property_get_constraint(
+        void *property,
+        const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_property_set_has_value_token(
+        void *property,
+        const axis2_env_t *env,
+        axis2_bool_t b);
+
+axis2_bool_t AXIS2_CALL
+woden_property_has_value_token(
+        void *property,
+        const axis2_env_t *env);
+
+/* ****************************************************************************
+ * Non-API implementation methods
+ * ***************************************************************************/
+axis2_status_t AXIS2_CALL
+woden_property_set_value_constraint(
+        void *property,
+        const axis2_env_t *env,
+        void *type_def);
+
+axis2_status_t AXIS2_CALL
+woden_property_set_types(
+        void *property,
+        const axis2_env_t *env,
+        void *types);
+
+static woden_property_t *
+create(const axis2_env_t *env);
+
+static axis2_status_t
+woden_property_free_ops(
+        void *property,
+        const axis2_env_t *env);
+
+/************************Woden C Internal Methods******************************/
+AXIS2_EXTERN woden_property_t * AXIS2_CALL
+woden_property_to_property_element(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    if(!property)
+    {
+        property_impl = (woden_property_impl_t *) create(env);
+    }
+    else
+        property_impl = (woden_property_impl_t *) property;
+
+    woden_property_free_ops(property, env);
+
+    property_impl->property.base.property_element.ops = 
+        AXIS2_MALLOC(env->allocator, 
+                sizeof(woden_property_element_ops_t));
+    woden_property_element_resolve_methods(&(property_impl->property.base.
+            property_element), env, property_impl->methods);
+    return property;
+}
+
+AXIS2_EXTERN woden_property_t * AXIS2_CALL
+woden_property_to_nested_element(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    if(!property)
+    {
+        property_impl = (woden_property_impl_t *) create(env);
+    }
+    else
+        property_impl = (woden_property_impl_t *) property;
+    woden_property_free_ops(property, env);
+
+    property_impl->property.base.property_element.base.nested_element.ops = 
+        AXIS2_MALLOC(env->allocator, 
+                sizeof(woden_nested_element_ops_t));
+    woden_nested_element_resolve_methods(&(property_impl->property.base.
+            property_element.base.nested_element), env, property_impl->methods);
+    return property;
+}
+
+AXIS2_EXTERN woden_property_t * AXIS2_CALL
+woden_property_to_documentable_element(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    if(!property)
+    {
+        property_impl = (woden_property_impl_t *) create(env);
+    }
+    else
+        property_impl = (woden_property_impl_t *) property;
+    woden_property_free_ops(property, env);
+
+    property_impl->property.base.property_element.base.documentable_element.ops = 
+        AXIS2_MALLOC(env->allocator, 
+                sizeof(woden_documentable_element_ops_t));
+    woden_documentable_element_resolve_methods(&(property_impl->property.base.
+            property_element.base.documentable_element), env, 
+            property_impl->methods);
+    return property;
+}
+
+AXIS2_EXTERN woden_property_t * AXIS2_CALL
+woden_property_to_documentable(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    if(!property)
+    {
+        property_impl = (woden_property_impl_t *) create(env);
+    }
+    else
+        property_impl = (woden_property_impl_t *) property;
+    woden_property_free_ops(property, env);
+
+    property_impl->property.base.documentable.ops = 
+        AXIS2_MALLOC(env->allocator, 
+                sizeof(woden_documentable_ops_t));
+    woden_documentable_resolve_methods(&(property_impl->property.base.
+            documentable), env, property_impl->documentable, property_impl->methods);
+    return property;
+}
+
+AXIS2_EXTERN woden_property_t * AXIS2_CALL
+woden_property_to_wsdl_obj(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+    woden_wsdl_obj_t *wsdl_obj = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    if(!property)
+    {
+        property_impl = (woden_property_impl_t *) create(env);
+    }
+    else
+        property_impl = (woden_property_impl_t *) property;
+    woden_property_free_ops(property, env);
+
+    property_impl->property.base.documentable.base.wsdl_obj.ops = 
+        AXIS2_MALLOC(env->allocator, 
+                sizeof(woden_wsdl_obj_ops_t));
+    wsdl_obj = WODEN_DOCUMENTABLE_GET_BASE_IMPL(
+            property_impl->documentable, env);
+    woden_wsdl_obj_resolve_methods(&(property_impl->property.base.
+            documentable.base.wsdl_obj), env, wsdl_obj, property_impl->methods);
+    return property;
+}
+
+AXIS2_EXTERN woden_property_t * AXIS2_CALL
+woden_property_to_nested_component(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    if(!property)
+    {
+        property_impl = (woden_property_impl_t *) create(env);
+    }
+    else
+        property_impl = (woden_property_impl_t *) property;
+    woden_property_free_ops(property, env);
+  
+    property_impl->property.base.nested_component.ops = 
+        AXIS2_MALLOC(env->allocator, 
+                sizeof(woden_nested_component_ops_t));
+    woden_nested_component_resolve_methods(&(property_impl->property.base.
+            nested_component), env, property_impl->methods);
+    return property;
+}
+
+AXIS2_EXTERN woden_property_t * AXIS2_CALL
+woden_property_to_wsdl_component(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    if(!property)
+    {
+        property_impl = (woden_property_impl_t *) create(env);
+    }
+    else
+        property_impl = (woden_property_impl_t *) property;
+    woden_property_free_ops(property, env);
+    property_impl->property.base.nested_component.wsdl_component.ops = 
+        AXIS2_MALLOC(env->allocator, 
+        sizeof(woden_wsdl_component_ops_t));
+    woden_wsdl_component_resolve_methods(&(property_impl->property.base.
+            nested_component.wsdl_component), env, property_impl->methods);
+    return property;
+}
+
+AXIS2_EXTERN woden_property_t * AXIS2_CALL
+woden_property_to_attr_extensible(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    if(!property)
+    {
+        property_impl = (woden_property_impl_t *) create(env);
+    }
+    else
+        property_impl = (woden_property_impl_t *) property;
+    woden_property_free_ops(property, env);
+
+    property_impl->property.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(&(property_impl->property.base.
+            documentable.base.wsdl_obj.base.wsdl_element.base.attr_extensible), 
+            env, NULL, property_impl->methods);
+    return property;
+
+}
+
+AXIS2_EXTERN woden_property_t * AXIS2_CALL
+woden_property_to_element_extensible(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    if(!property)
+    {
+        property_impl = (woden_property_impl_t *) create(env);
+    }
+    else
+        property_impl = (woden_property_impl_t *) property;
+    woden_property_free_ops(property, env);
+    property_impl->property.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(&(property_impl->property.base.
+            documentable.base.wsdl_obj.base.wsdl_element.base.element_extensible), 
+            env, NULL, property_impl->methods);
+    return property;
+
+}
+
+/************************End of Woden C Internal Methods***********************/
+static woden_property_t *
+create(const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    property_impl = AXIS2_MALLOC(env->allocator, 
+                    sizeof(woden_property_impl_t));
+
+    property_impl->obj_type= WODEN_PROPERTY;
+    property_impl->super = NULL;
+    property_impl->methods = NULL;
+    property_impl->f_ref = NULL;
+    property_impl->f_value = NULL;
+    property_impl->f_value_constraint = NULL;
+    property_impl->f_parent = NULL;
+    property_impl->f_constraint_qname = NULL;
+    property_impl->f_has_value_token = AXIS2_FALSE;
+    property_impl->f_types = NULL;
+    
+    property_impl->property.base.property_element.ops = NULL;
+    property_impl->property.base.property_element.base.nested_element.ops = NULL;
+    property_impl->property.base.property_element.base.documentable_element.ops = 
+            NULL;
+    property_impl->property.base.documentable.ops = NULL;
+    property_impl->property.base.nested_component.ops = NULL; 
+    property_impl->property.base.nested_component.wsdl_component.ops = NULL;
+    property_impl->property.base.documentable.base.wsdl_obj.ops = NULL;
+    property_impl->property.base.documentable.base.wsdl_obj.base.wsdl_element.
+            base.attr_extensible.ops = NULL;
+    property_impl->property.base.documentable.base.wsdl_obj.base.wsdl_element.
+            base.element_extensible.ops = NULL;
+    
+    property_impl->property.ops = AXIS2_MALLOC(env->allocator, 
+            sizeof(woden_property_ops_t));
+
+    property_impl->property.ops->free = woden_property_free;
+    property_impl->property.ops->super_objs = woden_property_super_objs;
+    property_impl->property.ops->type = woden_property_type;
+    property_impl->property.ops->get_base_impl = woden_property_get_base_impl;
+
+    property_impl->property.ops->get_ref = woden_property_get_ref;
+    property_impl->property.ops->get_value_constraint = 
+        woden_property_get_value_constraint;
+    property_impl->property.ops->get_value = woden_property_get_value;
+    property_impl->property.ops->get_parent = woden_property_get_parent;
+    property_impl->property.ops->to_element = woden_property_to_element;
+ 
+    property_impl->methods = axis2_hash_make(env);
+    if(!property_impl->methods) 
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    axis2_hash_set(property_impl->methods, "free", AXIS2_HASH_KEY_STRING, 
+            woden_property_free);
+    axis2_hash_set(property_impl->methods, "super_objs", AXIS2_HASH_KEY_STRING, 
+            woden_property_super_objs);
+    axis2_hash_set(property_impl->methods, "type", 
+            AXIS2_HASH_KEY_STRING, woden_property_type);
+
+    axis2_hash_set(property_impl->methods, "set_ref", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_set_ref);
+    axis2_hash_set(property_impl->methods, "get_ref", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_get_ref);
+    axis2_hash_set(property_impl->methods, "set_parent_element", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_set_parent_element);
+    axis2_hash_set(property_impl->methods, "get_parent_element", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_get_parent_element);
+    axis2_hash_set(property_impl->methods, "get_parent", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_get_parent);
+    axis2_hash_set(property_impl->methods, "to_element", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_to_element);
+    axis2_hash_set(property_impl->methods, "set_value", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_set_value);
+    axis2_hash_set(property_impl->methods, "get_value", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_get_value);
+    axis2_hash_set(property_impl->methods, "set_value_constraint", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_set_value_constraint);
+    axis2_hash_set(property_impl->methods, "get_value_constraint", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_get_value_constraint);
+    axis2_hash_set(property_impl->methods, "set_constraint_qname", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_set_constraint_qname);
+    axis2_hash_set(property_impl->methods, "get_constraint_qname", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_get_constraint_qname);
+    axis2_hash_set(property_impl->methods, "get_constraint", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_get_constraint);
+    axis2_hash_set(property_impl->methods, "set_types", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_set_types);
+    axis2_hash_set(property_impl->methods, "set_has_value_token", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_set_has_value_token);
+    axis2_hash_set(property_impl->methods, "has_value_token", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_property_has_value_token);
+
+    return &(property_impl->property);
+}
+
+AXIS2_EXTERN woden_property_t * AXIS2_CALL
+woden_property_create(const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    property_impl = (woden_property_impl_t *) create(env);
+
+    property_impl->documentable = woden_documentable_create(env);
+
+    property_impl->super = axis2_hash_make(env);
+    if(!property_impl->super) 
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    axis2_hash_set(property_impl->super, "WODEN_PROPERTY", 
+            AXIS2_HASH_KEY_STRING, &(property_impl->property));
+    axis2_hash_set(property_impl->super, "WODEN_DOCUMENTABLE", 
+            AXIS2_HASH_KEY_STRING, property_impl->documentable);
+    
+    return &(property_impl->property);
+}
+
+static axis2_status_t
+woden_property_free_ops(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    property_impl = INTF_TO_IMPL(property);
+
+    if(property_impl->property.base.property_element.ops)
+    {
+        AXIS2_FREE(env->allocator, property_impl->property.base.
+                property_element.ops);
+        property_impl->property.base.property_element.ops = NULL;
+    }
+
+    if(property_impl->property.base.property_element.base.nested_element.ops)
+    {
+        AXIS2_FREE(env->allocator, property_impl->property.base.
+                property_element.base.nested_element.ops);
+        property_impl->property.base.property_element.base.nested_element.ops = 
+            NULL;
+    }
+    
+    if(property_impl->property.base.property_element.base.documentable_element.ops)
+    {
+        AXIS2_FREE(env->allocator, property_impl->property.base.
+                property_element.base.documentable_element.ops);
+        property_impl->property.base.property_element.base.documentable_element.ops = 
+            NULL;
+    }
+    
+    if(property_impl->property.base.documentable.ops)
+    {
+        AXIS2_FREE(env->allocator, property_impl->property.base.
+                documentable.ops);
+        property_impl->property.base.documentable.ops = 
+            NULL;
+    }
+    
+    if(property_impl->property.base.documentable.base.wsdl_obj.ops)
+    {
+        AXIS2_FREE(env->allocator, property_impl->property.base.
+                documentable.base.wsdl_obj.ops);
+        property_impl->property.base.documentable.base.wsdl_obj.ops = 
+            NULL;
+    }
+
+    if(property_impl->property.base.nested_component.ops)
+    {
+        AXIS2_FREE(env->allocator, property_impl->property.base.
+                nested_component.ops);
+        property_impl->property.base.nested_component.ops = NULL;
+    }
+
+    if(property_impl->property.base.nested_component.wsdl_component.ops)
+    {
+        AXIS2_FREE(env->allocator, property_impl->property.base.
+                nested_component.wsdl_component.ops);
+        property_impl->property.base.nested_component.wsdl_component.ops = NULL;
+    }
+
+
+    if(property_impl->property.base.documentable.base.wsdl_obj.base.
+            wsdl_element.base.attr_extensible.ops)
+    {
+        AXIS2_FREE(env->allocator, property_impl->property.base.documentable.
+                base.wsdl_obj.base.wsdl_element.base.attr_extensible.ops);
+        property_impl->property.base.documentable.base.wsdl_obj.base.wsdl_element.
+                base.attr_extensible.ops = NULL;
+    }
+
+    if(property_impl->property.base.documentable.base.wsdl_obj.base.
+            wsdl_element.base.element_extensible.ops)
+    {
+        AXIS2_FREE(env->allocator, property_impl->property.base.documentable.
+                base.wsdl_obj.base.wsdl_element.base.element_extensible.ops);
+        property_impl->property.base.documentable.base.wsdl_obj.base.wsdl_element.
+                base.element_extensible.ops = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+
+axis2_status_t AXIS2_CALL
+woden_property_free(void *property,
+                        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    property_impl = INTF_TO_IMPL(property);
+
+    if(property_impl->f_ref)
+    {
+        AXIS2_URI_FREE(property_impl->f_ref, env);
+        property_impl->f_ref = NULL;
+    }
+   
+    /* TODO free f_parent */
+    
+    if(property_impl->super)
+    {
+        axis2_hash_free(property_impl->super, env);
+        property_impl->super = NULL;
+    }
+    
+    if(property_impl->methods)
+    {
+        axis2_hash_free(property_impl->methods, env);
+        property_impl->methods = NULL;
+    }
+
+    if(property_impl->documentable)
+    {
+        WODEN_DOCUMENTABLE_FREE(property_impl->documentable, env);
+        property_impl->documentable = NULL;
+    }
+
+    woden_property_free_ops(property, env);
+
+    if((&(property_impl->property))->ops)
+    {
+        AXIS2_FREE(env->allocator, (&(property_impl->property))->ops);
+        (&(property_impl->property))->ops = NULL;
+    }
+    
+    if(property_impl)
+    {
+        AXIS2_FREE(env->allocator, property_impl);
+        property_impl = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_hash_t *AXIS2_CALL
+woden_property_super_objs(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    property_impl = INTF_TO_IMPL(property);
+
+    return property_impl->super;
+}
+
+woden_obj_types_t AXIS2_CALL
+woden_property_type(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    property_impl = INTF_TO_IMPL(property);
+
+    return property_impl->obj_type;
+}
+
+woden_documentable_t *AXIS2_CALL
+woden_property_get_base_impl(void *property,
+                                const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    property_impl = INTF_TO_IMPL(property);
+
+    return property_impl->documentable;
+}
+
+axis2_status_t AXIS2_CALL
+woden_property_resolve_methods(
+        woden_property_t *property,
+        const axis2_env_t *env,
+        woden_property_t *property_impl,
+        axis2_hash_t *methods)
+{
+    woden_property_impl_t *property_impl_l = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, methods, AXIS2_FAILURE);
+    property_impl_l = INTF_TO_IMPL(property_impl);
+    
+    property->ops->free = axis2_hash_get(methods, "free", 
+            AXIS2_HASH_KEY_STRING);
+    property->ops->super_objs = axis2_hash_get(methods, "super_objs", 
+            AXIS2_HASH_KEY_STRING);
+    property->ops->type = axis2_hash_get(methods, "type", 
+            AXIS2_HASH_KEY_STRING);
+
+    property->ops->get_ref = axis2_hash_get(methods, 
+            "get_ref", AXIS2_HASH_KEY_STRING);
+    if(!property->ops->get_ref && property_impl_l)
+            property->ops->get_ref = 
+            property_impl_l->property.ops->get_ref;
+    
+    property->ops->get_value_constraint = axis2_hash_get(methods, 
+            "get_value_constraint", AXIS2_HASH_KEY_STRING);
+    if(!property->ops->get_value_constraint && property_impl_l)
+            property->ops->get_value_constraint = 
+            property_impl_l->property.ops->get_value_constraint;
+    
+    property->ops->get_value = axis2_hash_get(methods, 
+            "get_value", AXIS2_HASH_KEY_STRING);
+    if(!property->ops->get_value && property_impl_l)
+            property->ops->get_value = 
+            property_impl_l->property.ops->get_value;
+    
+    property->ops->get_parent = axis2_hash_get(methods, 
+            "get_parent", AXIS2_HASH_KEY_STRING);
+    if(!property->ops->get_parent && property_impl_l)
+            property->ops->get_parent = 
+            property_impl_l->property.ops->get_parent;
+    
+    property->ops->to_element = axis2_hash_get(methods, 
+            "to_element", AXIS2_HASH_KEY_STRING);
+    if(!property->ops->to_element && property_impl_l)
+            property->ops->to_element = 
+            property_impl_l->property.ops->to_element;
+    
+    return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+woden_property_set_ref(
+        void *property,
+        const axis2_env_t *env,
+        axis2_uri_t *ref)
+{
+    woden_property_impl_t *property_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+
+    if(property_impl->f_ref)
+    {
+        AXIS2_URI_FREE(property_impl->f_ref, env);
+    }
+    property_impl->f_ref = ref;
+    return AXIS2_SUCCESS;
+}
+
+axis2_uri_t *AXIS2_CALL
+woden_property_get_ref(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+    
+    return property_impl->f_ref;
+}
+
+axis2_status_t AXIS2_CALL
+woden_property_set_parent_element(
+        void *property,
+        const axis2_env_t *env,
+        woden_wsdl_element_t *parent)
+{
+    woden_property_impl_t *property_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+
+    /*if(property_impl->f_parent)
+    {
+        WODEN_WSDL_ELEMENT_FREE(parent, env);
+    }*/
+    property_impl->f_parent = parent;
+    return AXIS2_SUCCESS;
+}
+
+void *AXIS2_CALL
+woden_property_get_parent_element(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+
+    return property_impl->f_parent;
+}
+
+void *AXIS2_CALL
+woden_property_get_parent(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+
+    return property_impl->f_parent;
+}
+
+void *AXIS2_CALL
+woden_property_to_element(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+    
+    return &(property_impl->property);
+}
+
+axis2_status_t AXIS2_CALL
+woden_property_set_value(
+        void *property,
+        const axis2_env_t *env,
+        axis2_generic_obj_t *value)
+{
+    woden_property_impl_t *property_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+
+    if(property_impl->f_value)
+    {
+        AXIS2_GENERIC_OBJ_FREE(property_impl->f_value, env);
+        property_impl->f_value = NULL;
+    }
+    property_impl->f_value = value;
+    return AXIS2_SUCCESS;
+}
+
+void *AXIS2_CALL
+woden_property_get_value(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+
+    return property_impl->f_value;
+}
+
+axis2_status_t AXIS2_CALL
+woden_property_set_value_constraint(
+        void *property,
+        const axis2_env_t *env,
+        void *type_def)
+{
+    woden_property_impl_t *property_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+
+    /*if(property_impl->f_value_constraint)
+    {
+        WODEN_TYPE_DEFINITION_FREE(property_impl->f_value_constraint, 
+                env);
+        property_impl->f_value_constraint = NULL;
+    }*/
+    property_impl->f_value_constraint = type_def;
+    return AXIS2_SUCCESS;
+}
+
+void *AXIS2_CALL
+woden_property_get_value_constraint(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+
+    return property_impl->f_value_constraint;
+}
+
+axis2_status_t AXIS2_CALL
+woden_property_set_constraint_qname(
+        void *property,
+        const axis2_env_t *env,
+        axis2_qname_t *constraint)
+{
+    woden_property_impl_t *property_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+
+    if(property_impl->f_constraint_qname)
+    {
+        AXIS2_QNAME_FREE(property_impl->f_constraint_qname, env);
+        property_impl->f_constraint_qname = NULL;
+    }
+    property_impl->f_constraint_qname = AXIS2_QNAME_CLONE(constraint, env);
+    return AXIS2_SUCCESS;
+}
+
+axis2_qname_t *AXIS2_CALL
+woden_property_get_constraint_qname(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+
+    return property_impl->f_constraint_qname;
+}
+
+void *AXIS2_CALL
+woden_property_get_constraint(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+    xml_schema_type_t *xst = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+   
+    if(property_impl->f_constraint_qname && property_impl->f_types)
+    {
+        xst = (xml_schema_type_t *) 
+            WODEN_TYPES_GET_TYPE_DEFINITION(property_impl->f_types, env, 
+                property_impl->f_constraint_qname);
+    }
+    return xst;
+}
+
+axis2_status_t AXIS2_CALL
+woden_property_set_types(
+        void *property,
+        const axis2_env_t *env,
+        void *types)
+{
+    woden_property_impl_t *property_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+    
+    /*if(property_impl->f_types)
+    {
+        WODEN_TYPES_ELEMENT_FREE(property_impl->f_types, env);
+        property_impl->f_types = NULL;
+    }*/
+    property_impl->f_types = types;
+    return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+woden_property_set_has_value_token(
+        void *property,
+        const axis2_env_t *env,
+        axis2_bool_t b)
+{
+    woden_property_impl_t *property_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+
+    property_impl->f_has_value_token = b;
+    return AXIS2_SUCCESS;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_property_has_value_token(
+        void *property,
+        const axis2_env_t *env)
+{
+    woden_property_impl_t *property_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    super = WODEN_PROPERTY_SUPER_OBJS(property, env);
+    property_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_PROPERTY", AXIS2_HASH_KEY_STRING));
+
+    return property_impl->f_has_value_token;
+}
+
+

Added: webservices/axis2/trunk/c/woden/src/wsdl10/svc.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/wsdl10/svc.c?rev=415946&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/wsdl10/svc.c (added)
+++ webservices/axis2/trunk/c/woden/src/wsdl10/svc.c Wed Jun 21 02:08:20 2006
@@ -0,0 +1,939 @@
+/*
+ * 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_svc.h>
+#include <woden_nested_configurable.h>
+#include <woden_ext_element.h>
+#include <woden_component_exts.h>
+#include <woden_xml_attr.h>
+#include <woden_documentation_element.h>
+#include <woden_interface.h>
+
+typedef struct woden_svc_impl woden_svc_impl_t;
+
+/** 
+ * @brief Service Struct Impl
+ *   Axis2 Service  
+ */ 
+struct woden_svc_impl
+{
+    woden_svc_t svc;
+    woden_obj_types_t obj_type;
+    woden_configurable_t *configurable;
+    axis2_hash_t *super;
+    axis2_hash_t *methods;
+    axis2_qname_t *f_qname;
+    axis2_qname_t *f_interface_qname;
+    void *f_interface;
+    axis2_array_list_t *f_endpoints;
+};
+
+#define INTF_TO_IMPL(svc) ((woden_svc_impl_t *) svc)
+
+axis2_status_t AXIS2_CALL 
+woden_svc_free(
+        void *svc,
+        const axis2_env_t *env);
+
+axis2_hash_t *AXIS2_CALL 
+woden_svc_super_objs(
+        void *svc,
+        const axis2_env_t *env);
+
+woden_obj_types_t AXIS2_CALL 
+woden_svc_type(
+        void *svc,
+        const axis2_env_t *env);
+
+woden_configurable_t *AXIS2_CALL
+woden_svc_get_base_impl(
+        void *svc,
+        const axis2_env_t *env);
+/* ************************************************************
+ *  Service interface methods (the WSDL Component model)
+ * ************************************************************/
+
+axis2_qname_t *AXIS2_CALL
+woden_svc_get_qname(
+        void *svc,
+        const axis2_env_t *env);
+
+void *AXIS2_CALL
+woden_svc_get_interface(
+        void *svc,
+        const axis2_env_t *env);
+
+axis2_array_list_t *AXIS2_CALL
+woden_svc_get_endpoints(
+        void *svc,
+        const axis2_env_t *env);
+/* ************************************************************
+ *  Service Element interface methods (the XML Element model)
+ * ************************************************************/
+
+axis2_status_t AXIS2_CALL
+woden_svc_set_qname(
+        void *svc,
+        const axis2_env_t *env,
+        axis2_qname_t *qname);
+
+axis2_status_t AXIS2_CALL
+woden_svc_set_interface_qname(
+        void *svc,
+        const axis2_env_t *env,
+        axis2_qname_t *interface_qname);
+
+axis2_qname_t *AXIS2_CALL
+woden_svc_get_interface_qname(
+        void *svc,
+        const axis2_env_t *env);
+
+void *AXIS2_CALL
+woden_svc_get_interface_element(
+        void *svc,
+        const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_svc_add_endpoint_element(
+        void *svc,
+        const axis2_env_t *env,
+        void *endpoint);
+
+axis2_array_list_t *AXIS2_CALL
+woden_svc_get_endpoint_elements(
+        void *svc,
+        const axis2_env_t *env);
+
+/******************************************************************************
+ *  Non-API implementation methods
+ *****************************************************************************/  
+
+axis2_status_t AXIS2_CALL
+woden_svc_set_interface_element(
+        void *svc,
+        const axis2_env_t *env,
+        void *interface);
+
+
+static woden_svc_t *
+create(const axis2_env_t *env);
+
+static axis2_status_t
+woden_svc_free_ops(
+        void *svc,
+        const axis2_env_t *env);
+
+/************************Woden C Internal Methods******************************/
+AXIS2_EXTERN woden_svc_t * AXIS2_CALL
+woden_svc_to_svc_element(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    if(!svc)
+    {
+        svc_impl = (woden_svc_impl_t *) create(env);
+    }
+    else
+        svc_impl = (woden_svc_impl_t *) svc;
+
+    woden_svc_free_ops(svc, env);
+
+    svc_impl->svc.base.svc_element.ops = 
+        AXIS2_MALLOC(env->allocator, 
+                sizeof(woden_svc_element_ops_t));
+    woden_svc_element_resolve_methods(&(svc_impl->svc.base.
+            svc_element), env, svc_impl->methods);
+    return svc;
+}
+
+AXIS2_EXTERN woden_svc_t * AXIS2_CALL
+woden_svc_to_documentable_element(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    if(!svc)
+    {
+        svc_impl = (woden_svc_impl_t *) create(env);
+    }
+    else
+        svc_impl = (woden_svc_impl_t *) svc;
+
+    woden_svc_free_ops(svc, env);
+
+    svc_impl->svc.base.svc_element.base.documentable_element.ops = 
+        AXIS2_MALLOC(env->allocator, 
+                sizeof(woden_documentable_element_ops_t));
+    woden_documentable_element_resolve_methods(&(svc_impl->svc.base.
+            svc_element.base.documentable_element), env, 
+            svc_impl->methods);
+    return svc;
+}
+
+AXIS2_EXTERN woden_svc_t * AXIS2_CALL
+woden_svc_to_configurable(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    if(!svc)
+    {
+        svc_impl = (woden_svc_impl_t *) create(env);
+    }
+    else
+        svc_impl = (woden_svc_impl_t *) svc;
+
+    woden_svc_free_ops(svc, env);
+
+    svc_impl->svc.base.configurable.ops = 
+        AXIS2_MALLOC(env->allocator, 
+                sizeof(woden_configurable_ops_t));
+    woden_configurable_resolve_methods(&(svc_impl->svc.base.
+            configurable), env, svc_impl->configurable, 
+            svc_impl->methods);
+    return svc;
+}
+
+AXIS2_EXTERN woden_svc_t * AXIS2_CALL
+woden_svc_to_configurable_component(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    if(!svc)
+    {
+        svc_impl = (woden_svc_impl_t *) create(env);
+    }
+    else
+        svc_impl = (woden_svc_impl_t *) svc;
+
+    woden_svc_free_ops(svc, env);
+  
+    svc_impl->svc.base.configurable_component.ops = 
+        AXIS2_MALLOC(env->allocator, 
+                sizeof(woden_configurable_component_ops_t));
+    woden_configurable_component_resolve_methods(&(svc_impl->svc.base.
+            configurable_component), env, svc_impl->methods);
+    return svc;
+}
+
+AXIS2_EXTERN woden_svc_t * AXIS2_CALL
+woden_svc_to_wsdl_component(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    if(!svc)
+    {
+        svc_impl = (woden_svc_impl_t *) create(env);
+    }
+    else
+        svc_impl = (woden_svc_impl_t *) svc;
+
+    woden_svc_free_ops(svc, env);
+
+    svc_impl->svc.base.configurable_component.wsdl_component.ops = 
+        AXIS2_MALLOC(env->allocator, 
+        sizeof(woden_wsdl_component_ops_t));
+    woden_wsdl_component_resolve_methods(&(svc_impl->svc.base.
+            configurable_component.wsdl_component), env, svc_impl->methods);
+    return svc;
+}
+
+AXIS2_EXTERN woden_svc_t * AXIS2_CALL
+woden_svc_to_configurable_element(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    if(!svc)
+    {
+        svc_impl = (woden_svc_impl_t *) create(env);
+    }
+    else
+        svc_impl = (woden_svc_impl_t *) svc;
+
+    woden_svc_free_ops(svc, env);
+
+    svc_impl->svc.base.svc_element.base.configurable_element.ops = 
+        AXIS2_MALLOC(env->allocator, 
+                sizeof(woden_configurable_element_ops_t));
+    woden_configurable_element_resolve_methods(&(svc_impl->svc.base.
+            svc_element.base.configurable_element), env, svc_impl->methods);
+    return svc;
+}
+
+AXIS2_EXTERN woden_svc_t * AXIS2_CALL
+woden_svc_to_documentable(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    if(!svc)
+    {
+        svc_impl = (woden_svc_impl_t *) create(env);
+    }
+    else
+        svc_impl = (woden_svc_impl_t *) svc;
+
+    woden_svc_free_ops(svc, env);
+
+    svc_impl->svc.base.
+        configurable.base.documentable.ops = AXIS2_MALLOC(env->allocator, 
+                sizeof(woden_documentable_ops_t));
+    woden_documentable_resolve_methods(&(svc_impl->svc.base.
+            configurable.base.documentable), env, NULL,
+            svc_impl->methods);
+    return svc;
+}
+
+AXIS2_EXTERN woden_svc_t * AXIS2_CALL
+woden_svc_to_attr_extensible(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    if(!svc)
+    {
+        svc_impl = (woden_svc_impl_t *) create(env);
+    }
+    else
+        svc_impl = (woden_svc_impl_t *) svc;
+
+    woden_svc_free_ops(svc, env);
+
+    svc_impl->svc.base.svc_element.base.documentable_element.
+        wsdl_element.base.attr_extensible.ops = 
+        AXIS2_MALLOC(env->allocator, 
+                sizeof(woden_attr_extensible_ops_t));
+    woden_attr_extensible_resolve_methods(&(svc_impl->svc.base.
+            svc_element.base.documentable_element.wsdl_element.base.
+            attr_extensible), env, NULL, svc_impl->methods);
+    return svc;
+}
+
+
+AXIS2_EXTERN woden_svc_t * AXIS2_CALL
+woden_svc_to_element_extensible(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    if(!svc)
+    {
+        svc_impl = (woden_svc_impl_t *) create(env);
+    }
+    else
+        svc_impl = (woden_svc_impl_t *) svc;
+
+    woden_svc_free_ops(svc, env);
+
+    svc_impl->svc.base.svc_element.base.documentable_element.
+        wsdl_element.base.element_extensible.ops = 
+        AXIS2_MALLOC(env->allocator, 
+                sizeof(woden_element_extensible_ops_t));
+    woden_element_extensible_resolve_methods(&(svc_impl->svc.base.
+            svc_element.base.documentable_element.wsdl_element.base.
+            element_extensible), env, NULL, svc_impl->methods);
+    return svc;
+}
+
+
+/************************End of Woden C Internal Methods***********************/
+static woden_svc_t *
+create(const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    svc_impl = AXIS2_MALLOC(env->allocator, 
+                    sizeof(woden_svc_impl_t));
+
+    svc_impl->obj_type= WODEN_SVC;
+    svc_impl->super = NULL;
+    svc_impl->methods = NULL;
+    svc_impl->f_qname = NULL;
+    svc_impl->f_interface_qname = NULL;
+    svc_impl->f_interface = NULL;
+    svc_impl->f_endpoints = NULL;
+    
+    svc_impl->svc.base.svc_element.ops = NULL;
+    svc_impl->svc.base.svc_element.base.documentable_element.ops = 
+            NULL;
+    svc_impl->svc.base.configurable.ops = NULL;
+    svc_impl->svc.base.configurable_component.ops = NULL;
+    svc_impl->svc.base.configurable_component.wsdl_component.ops = NULL;
+    svc_impl->svc.base.svc_element.base.
+        configurable_element.ops = NULL;
+    svc_impl->svc.base.configurable.base.
+        documentable.ops = NULL;
+    svc_impl->svc.base.svc_element.base.
+        documentable_element.wsdl_element.base.attr_extensible.ops = NULL;
+    svc_impl->svc.base.svc_element.base.
+        documentable_element.wsdl_element.base.element_extensible.ops = NULL;
+ 
+    svc_impl->svc.ops = AXIS2_MALLOC(env->allocator, 
+            sizeof(woden_svc_ops_t));
+
+    svc_impl->svc.ops->free = woden_svc_free;
+    svc_impl->svc.ops->super_objs = woden_svc_super_objs;
+    svc_impl->svc.ops->type = woden_svc_type;
+    svc_impl->svc.ops->get_base_impl = woden_svc_get_base_impl;
+
+    svc_impl->svc.ops->get_qname = woden_svc_get_qname;
+    svc_impl->svc.ops->get_interface = woden_svc_get_interface;
+    svc_impl->svc.ops->get_endpoints = 
+        woden_svc_get_endpoints;
+    svc_impl->svc.ops->set_interface_element = 
+        woden_svc_set_interface_element;
+ 
+    svc_impl->methods = axis2_hash_make(env);
+    if(!svc_impl->methods) 
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    axis2_hash_set(svc_impl->methods, "free", AXIS2_HASH_KEY_STRING, 
+            woden_svc_free);
+    axis2_hash_set(svc_impl->methods, "super_objs", 
+            AXIS2_HASH_KEY_STRING, woden_svc_super_objs);
+    axis2_hash_set(svc_impl->methods, "type", 
+            AXIS2_HASH_KEY_STRING, woden_svc_type);
+
+    axis2_hash_set(svc_impl->methods, "get_qname", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_svc_get_qname);
+    axis2_hash_set(svc_impl->methods, "get_interface", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_svc_get_interface);
+    axis2_hash_set(svc_impl->methods, "get_endpoints", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_svc_get_endpoints);
+    axis2_hash_set(svc_impl->methods, "set_qname", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_svc_set_qname);
+    axis2_hash_set(svc_impl->methods, "set_interface_qname", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_svc_set_interface_qname);
+    axis2_hash_set(svc_impl->methods, "get_interface_qname", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_svc_get_interface_qname);
+    axis2_hash_set(svc_impl->methods, "get_interface_element", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_svc_get_interface_element);
+    axis2_hash_set(svc_impl->methods, "add_endpoint_element", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_svc_add_endpoint_element);
+    axis2_hash_set(svc_impl->methods, "get_endpoint_elements", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_svc_get_endpoint_elements);
+    axis2_hash_set(svc_impl->methods, "set_interface_element", 
+            AXIS2_HASH_KEY_STRING, 
+            woden_svc_set_interface_element);
+
+    return &(svc_impl->svc);
+}
+
+AXIS2_EXTERN woden_svc_t * AXIS2_CALL
+woden_svc_create(const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    svc_impl = (woden_svc_impl_t *) create(env);
+
+    svc_impl->configurable = woden_configurable_create(env);
+
+    svc_impl->super = axis2_hash_make(env);
+    if(!svc_impl->super) 
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    axis2_hash_set(svc_impl->super, "WODEN_SVC", AXIS2_HASH_KEY_STRING, 
+            &(svc_impl->svc));
+    axis2_hash_set(svc_impl->super, "WODEN_NESTED_CONFIGURABLE", AXIS2_HASH_KEY_STRING, 
+            svc_impl->configurable);
+ 
+    return &(svc_impl->svc);
+}
+
+static axis2_status_t
+woden_svc_free_ops(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    svc_impl = INTF_TO_IMPL(svc);
+
+    if(svc_impl->svc.base.svc_element.ops)
+    {
+        AXIS2_FREE(env->allocator, svc_impl->svc.base.
+                svc_element.ops);
+        svc_impl->svc.base.svc_element.ops = NULL;
+    }
+
+    if(svc_impl->svc.base.svc_element.base.documentable_element.ops)
+    {
+        AXIS2_FREE(env->allocator, svc_impl->svc.base.
+                svc_element.base.documentable_element.ops);
+        svc_impl->svc.base.svc_element.base.documentable_element.ops = 
+            NULL;
+    }
+    
+    if(svc_impl->svc.base.configurable.ops)
+    {
+        AXIS2_FREE(env->allocator, svc_impl->svc.base.
+                configurable.ops);
+        svc_impl->svc.base.configurable.ops = 
+            NULL;
+    }
+    
+    if(svc_impl->svc.base.configurable_component.ops)
+    {
+        AXIS2_FREE(env->allocator, svc_impl->svc.base.
+                configurable_component.ops);
+        svc_impl->svc.base.configurable_component.ops = NULL;
+    }
+
+    if(svc_impl->svc.base.configurable_component.wsdl_component.ops)
+    {
+        AXIS2_FREE(env->allocator, svc_impl->svc.base.
+                configurable_component.wsdl_component.ops);
+        svc_impl->svc.base.configurable_component.wsdl_component.ops = NULL;
+    }
+ 
+    if(svc_impl->svc.base.svc_element.base.
+            configurable_element.ops)
+    {
+        AXIS2_FREE(env->allocator, svc_impl->svc.base.
+                svc_element.base.configurable_element.ops);
+        svc_impl->svc.base.svc_element.base.
+            configurable_element.ops = NULL;
+    }
+    
+    if(svc_impl->svc.base.
+            configurable.base.documentable.ops)
+    {
+        AXIS2_FREE(env->allocator, svc_impl->svc.base.
+                configurable.base.documentable.ops);
+        svc_impl->svc.base.
+            configurable.base.documentable.ops = NULL;
+    }
+      
+    if(svc_impl->svc.base.svc_element.base.
+            documentable_element.wsdl_element.base.attr_extensible.ops)
+    {
+        AXIS2_FREE(env->allocator, svc_impl->svc.base.
+                svc_element.base.documentable_element.wsdl_element.base.
+                attr_extensible.ops);
+        svc_impl->svc.base.svc_element.base.
+            documentable_element.wsdl_element.base.attr_extensible.ops = NULL;
+    }
+      
+    if(svc_impl->svc.base.svc_element.base.
+            documentable_element.wsdl_element.base.element_extensible.ops)
+    {
+        AXIS2_FREE(env->allocator, svc_impl->svc.base.
+                svc_element.base.documentable_element.wsdl_element.base.
+                element_extensible.ops);
+        svc_impl->svc.base.svc_element.base.
+            documentable_element.wsdl_element.base.element_extensible.ops = NULL;
+    }
+  
+
+    return AXIS2_SUCCESS;
+}
+
+
+axis2_status_t AXIS2_CALL
+woden_svc_free(void *svc,
+                        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    svc_impl = INTF_TO_IMPL(svc);
+
+    if(svc_impl->f_qname)
+    {
+        AXIS2_QNAME_FREE(svc_impl->f_qname, env);
+        svc_impl->f_qname = NULL;
+    }
+
+    if(svc_impl->f_interface_qname)
+    {
+        AXIS2_QNAME_FREE(svc_impl->f_interface_qname, env);
+        svc_impl->f_interface_qname = NULL;
+    }
+
+    if(svc_impl->f_interface)
+    {
+        WODEN_INTERFACE_FREE(svc_impl->f_interface, env);
+        svc_impl->f_interface = NULL;
+    }
+
+    if(svc_impl->f_endpoints)
+    {
+        AXIS2_ARRAY_LIST_FREE(svc_impl->f_endpoints, env);
+        svc_impl->f_endpoints = NULL;
+    }
+   
+    /* TODO free f_parent */
+    
+    if(svc_impl->super)
+    {
+        axis2_hash_free(svc_impl->super, env);
+        svc_impl->super = NULL;
+    }
+    
+    if(svc_impl->methods)
+    {
+        axis2_hash_free(svc_impl->methods, env);
+        svc_impl->methods = NULL;
+    }
+
+    if(svc_impl->configurable)
+    {
+        WODEN_NESTED_CONFIGURABLE_FREE(svc_impl->configurable, env);
+        svc_impl->configurable = NULL;
+    }
+
+    woden_svc_free_ops(svc, env);
+
+    if((&(svc_impl->svc))->ops)
+    {
+        AXIS2_FREE(env->allocator, (&(svc_impl->svc))->ops);
+        (&(svc_impl->svc))->ops = NULL;
+    }
+    
+    if(svc_impl)
+    {
+        AXIS2_FREE(env->allocator, svc_impl);
+        svc_impl = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_hash_t *AXIS2_CALL
+woden_svc_super_objs(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    svc_impl = INTF_TO_IMPL(svc);
+
+    return svc_impl->super;
+}
+
+woden_obj_types_t AXIS2_CALL
+woden_svc_type(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    svc_impl = INTF_TO_IMPL(svc);
+
+    return svc_impl->obj_type;
+}
+
+woden_configurable_t *AXIS2_CALL
+woden_svc_get_base_impl(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    svc_impl = INTF_TO_IMPL(svc);
+
+    return svc_impl->configurable;
+}
+
+axis2_status_t AXIS2_CALL
+woden_svc_resolve_methods(
+        woden_svc_t *svc,
+        const axis2_env_t *env,
+        woden_svc_t *svc_impl,
+        axis2_hash_t *methods)
+{
+    woden_svc_impl_t *svc_impl_l = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, methods, AXIS2_FAILURE);
+    svc_impl_l = INTF_TO_IMPL(svc_impl);
+    
+    svc->ops->free = axis2_hash_get(methods, "free", 
+            AXIS2_HASH_KEY_STRING);
+    svc->ops->super_objs = axis2_hash_get(methods, "super_objs", 
+            AXIS2_HASH_KEY_STRING);
+    svc->ops->type = axis2_hash_get(methods, "type", 
+            AXIS2_HASH_KEY_STRING);
+    
+    svc->ops->get_qname = axis2_hash_get(methods, 
+            "get_qname", AXIS2_HASH_KEY_STRING);
+    if(!svc->ops->get_qname && svc_impl_l)
+            svc->ops->get_qname = 
+            svc_impl_l->svc.ops->get_qname;
+    
+    svc->ops->get_interface = axis2_hash_get(methods, 
+            "get_interface", AXIS2_HASH_KEY_STRING);
+    if(!svc->ops->get_interface && svc_impl_l)
+            svc->ops->get_interface = 
+            svc_impl_l->svc.ops->get_interface;
+    
+    svc->ops->get_endpoints = axis2_hash_get(methods, 
+            "get_endpoints", AXIS2_HASH_KEY_STRING);
+    if(!svc->ops->get_endpoints && svc_impl_l)
+            svc->ops->get_endpoints = 
+            svc_impl_l->svc.ops->get_endpoints;
+    
+    svc->ops->set_interface_element = axis2_hash_get(methods, 
+            "set_interface_element", AXIS2_HASH_KEY_STRING);
+    if(!svc->ops->set_interface_element && svc_impl_l)
+            svc->ops->set_interface_element = 
+            svc_impl_l->svc.ops->set_interface_element;
+
+    return AXIS2_SUCCESS;
+}
+/* ************************************************************
+ *  Service interface methods (the WSDL Component model)
+ * ************************************************************/
+
+axis2_qname_t *AXIS2_CALL
+woden_svc_get_qname(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_SVC_SUPER_OBJS(svc, env);
+    svc_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_SVC", AXIS2_HASH_KEY_STRING));
+    
+    return svc_impl->f_qname;
+}
+
+void *AXIS2_CALL
+woden_svc_get_interface(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_SVC_SUPER_OBJS(svc, env);
+    svc_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_SVC", AXIS2_HASH_KEY_STRING));
+    
+    return svc_impl->f_interface;
+}
+
+axis2_array_list_t *AXIS2_CALL
+woden_svc_get_endpoints(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_SVC_SUPER_OBJS(svc, env);
+    svc_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_SVC", AXIS2_HASH_KEY_STRING));
+    
+    return svc_impl->f_endpoints;
+}
+/* ************************************************************
+ *  Service Element interface methods (the XML Element model)
+ * ************************************************************/
+
+axis2_status_t AXIS2_CALL
+woden_svc_set_qname(
+        void *svc,
+        const axis2_env_t *env,
+        axis2_qname_t *qname)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    super = WODEN_SVC_SUPER_OBJS(svc, env);
+    svc_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_SVC", AXIS2_HASH_KEY_STRING));
+
+    if(svc_impl->f_qname)
+    {
+        AXIS2_QNAME_FREE(svc_impl->f_qname, env);
+    }
+    svc_impl->f_qname = AXIS2_QNAME_CLONE(qname, env);
+    return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+woden_svc_set_interface_qname(
+        void *svc,
+        const axis2_env_t *env,
+        axis2_qname_t *interface_qname)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    super = WODEN_SVC_SUPER_OBJS(svc, env);
+    svc_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_SVC", AXIS2_HASH_KEY_STRING));
+
+    if(svc_impl->f_interface_qname)
+    {
+        AXIS2_QNAME_FREE(svc_impl->f_interface_qname, env);
+    }
+
+    svc_impl->f_interface_qname = AXIS2_QNAME_CLONE(interface_qname, env);
+    return AXIS2_SUCCESS;
+}
+
+axis2_qname_t *AXIS2_CALL
+woden_svc_get_interface_qname(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_SVC_SUPER_OBJS(svc, env);
+    svc_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_SVC", AXIS2_HASH_KEY_STRING));
+
+    return svc_impl->f_interface_qname;
+}
+
+void *AXIS2_CALL
+woden_svc_get_interface_element(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_SVC_SUPER_OBJS(svc, env);
+    svc_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_SVC", AXIS2_HASH_KEY_STRING));
+
+    return svc_impl->f_interface;
+}
+
+axis2_status_t AXIS2_CALL
+woden_svc_add_endpoint_element(
+        void *svc,
+        const axis2_env_t *env,
+        void *endpoint)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    super = WODEN_SVC_SUPER_OBJS(svc, env);
+    svc_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_SVC", AXIS2_HASH_KEY_STRING));
+
+    if(!svc_impl->f_endpoints)
+    {
+        svc_impl->f_endpoints = axis2_array_list_create(env, 0);
+        if(!svc_impl->f_endpoints)
+        {
+            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+            return AXIS2_FAILURE;
+        }
+    }
+
+    return AXIS2_ARRAY_LIST_ADD(svc_impl->f_endpoints, env, endpoint);
+}
+
+axis2_array_list_t *AXIS2_CALL
+woden_svc_get_endpoint_elements(
+        void *svc,
+        const axis2_env_t *env)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_SVC_SUPER_OBJS(svc, env);
+    svc_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_SVC", AXIS2_HASH_KEY_STRING));
+    
+    return svc_impl->f_endpoints;
+}
+/******************************************************************************
+ *  Non-API implementation methods
+ *****************************************************************************/  
+
+axis2_status_t AXIS2_CALL
+woden_svc_set_interface_element(
+        void *svc,
+        const axis2_env_t *env,
+        void *interface)
+{
+    woden_svc_impl_t *svc_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    super = WODEN_SVC_SUPER_OBJS(svc, env);
+    svc_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_SVC", AXIS2_HASH_KEY_STRING));
+
+    if(svc_impl->f_interface)
+    {
+        /* TODO */
+    }
+
+    svc_impl->f_interface = interface;
+    return AXIS2_SUCCESS;
+}
+
+

Added: webservices/axis2/trunk/c/woden/src/wsdl10/type_def.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/wsdl10/type_def.c?rev=415946&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/wsdl10/type_def.c (added)
+++ webservices/axis2/trunk/c/woden/src/wsdl10/type_def.c Wed Jun 21 02:08:20 2006
@@ -0,0 +1,481 @@
+/*
+ * 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_type_def.h>
+#include <woden_ext_element.h>
+#include <woden_xml_attr.h>
+#include <woden_generic_obj.h>
+
+typedef struct woden_type_def_impl woden_type_def_impl_t;
+
+/** 
+ * @brief Type Definition Struct Impl
+ *   Axis2 Type Definition  
+ */ 
+struct woden_type_def_impl
+{
+    woden_type_def_t type_def;
+    woden_obj_types_t obj_type;
+    axis2_hash_t *super;
+    axis2_hash_t *methods;
+    axis2_qname_t *f_qname;
+    axis2_uri_t *f_system;
+    axis2_char_t *f_content_model;
+    axis2_generic_obj_t *f_content;
+};
+
+#define INTF_TO_IMPL(type_def) ((woden_type_def_impl_t *) type_def)
+
+axis2_status_t AXIS2_CALL 
+woden_type_def_free(
+        void *type_def,
+        const axis2_env_t *env);
+
+axis2_hash_t *AXIS2_CALL 
+woden_type_def_super_objs(
+        void *type_def,
+        const axis2_env_t *env);
+
+woden_obj_types_t AXIS2_CALL
+woden_type_def_type(
+        void *type_def,
+        const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL 
+woden_type_def_set_qname(
+        void *type_def,
+        const axis2_env_t *env,
+        axis2_qname_t *qname);
+
+axis2_qname_t *AXIS2_CALL 
+woden_type_def_get_qname(
+        void *type_def,
+        const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL 
+woden_type_def_set_system(
+        void *type_def,
+        const axis2_env_t *env,
+        axis2_uri_t *type_system_uri);
+
+axis2_uri_t *AXIS2_CALL 
+woden_type_def_get_system(
+        void *type_def,
+        const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL 
+woden_type_def_set_content_model(
+        void *type_def,
+        const axis2_env_t *env,
+        axis2_char_t *content_model);
+
+axis2_char_t *AXIS2_CALL 
+woden_type_def_get_content_model(
+        void *type_def,
+        const axis2_env_t *env);
+
+
+axis2_status_t AXIS2_CALL
+woden_type_def_set_content(
+        void *type_def,
+        const axis2_env_t *env,
+        void *type_def_content);
+
+void *AXIS2_CALL
+woden_type_def_get_content(
+        void *type_def,
+        const axis2_env_t *env);
+
+static woden_type_def_t *
+create(const axis2_env_t *env);
+
+static woden_type_def_t *
+create(const axis2_env_t *env)
+{
+    woden_type_def_impl_t *type_def_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    type_def_impl = AXIS2_MALLOC(env->allocator, 
+                    sizeof(woden_type_def_impl_t));
+
+    type_def_impl->super = NULL;
+    type_def_impl->methods = NULL;
+    type_def_impl->obj_type = WODEN_TYPE_DEF;
+    type_def_impl->f_qname = NULL;
+    type_def_impl->f_system = NULL;
+    type_def_impl->f_content_model = NULL;
+    type_def_impl->f_content = NULL;
+    
+    type_def_impl->type_def.ops = AXIS2_MALLOC(env->allocator, 
+                    sizeof(woden_type_def_ops_t));
+
+    type_def_impl->type_def.ops->free = woden_type_def_free;
+    type_def_impl->type_def.ops->super_objs = 
+        woden_type_def_super_objs;
+    type_def_impl->type_def.ops->type = woden_type_def_type;
+
+    type_def_impl->methods = axis2_hash_make(env);
+    if(!type_def_impl->methods) 
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    axis2_hash_set(type_def_impl->methods, "free", AXIS2_HASH_KEY_STRING, 
+            woden_type_def_free);
+    axis2_hash_set(type_def_impl->methods, "super_objs", AXIS2_HASH_KEY_STRING, 
+            woden_type_def_super_objs);
+    axis2_hash_set(type_def_impl->methods, "type", AXIS2_HASH_KEY_STRING, 
+            woden_type_def_type);
+
+    axis2_hash_set(type_def_impl->methods, "set_qname", 
+            AXIS2_HASH_KEY_STRING, woden_type_def_set_qname);
+    axis2_hash_set(type_def_impl->methods, "get_qname", 
+            AXIS2_HASH_KEY_STRING, woden_type_def_get_qname);
+    axis2_hash_set(type_def_impl->methods, "set_system", 
+            AXIS2_HASH_KEY_STRING, woden_type_def_set_system);
+    axis2_hash_set(type_def_impl->methods, "get_system", 
+            AXIS2_HASH_KEY_STRING, woden_type_def_get_system);
+    axis2_hash_set(type_def_impl->methods, "set_content_model", 
+            AXIS2_HASH_KEY_STRING, woden_type_def_set_content_model);
+    axis2_hash_set(type_def_impl->methods, "get_content_model", 
+            AXIS2_HASH_KEY_STRING, woden_type_def_get_content_model);
+    axis2_hash_set(type_def_impl->methods, "set_content", 
+            AXIS2_HASH_KEY_STRING, woden_type_def_set_content);
+    axis2_hash_set(type_def_impl->methods, "get_content", 
+            AXIS2_HASH_KEY_STRING, woden_type_def_get_content);
+    
+    return &(type_def_impl->type_def);
+}
+
+AXIS2_EXTERN woden_type_def_t * AXIS2_CALL
+woden_type_def_create(
+        const axis2_env_t *env)
+{
+    woden_type_def_impl_t *type_def_impl = NULL;
+   
+    AXIS2_ENV_CHECK(env, NULL);
+    type_def_impl = (woden_type_def_impl_t *) create(env);
+
+    type_def_impl->super = axis2_hash_make(env);
+    if(!type_def_impl->super) 
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    axis2_hash_set(type_def_impl->super, "WODEN_TYPE_DEF", 
+            AXIS2_HASH_KEY_STRING, &(type_def_impl->type_def));
+
+    return &(type_def_impl->type_def);
+}
+
+axis2_status_t AXIS2_CALL
+woden_type_def_free(
+        void *type_def,
+        const axis2_env_t *env)
+{
+    woden_type_def_impl_t *type_def_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    type_def_impl = INTF_TO_IMPL(type_def);
+
+    if(type_def_impl->f_content)
+    {
+        /*AXIS2_FREE(type_def_impl->f_content, env);*/
+        type_def_impl->f_content = NULL;
+    }
+    
+    if(type_def_impl->super)
+    {
+        axis2_hash_free(type_def_impl->super, env);
+        type_def_impl->super = NULL;
+    }
+    
+    if(type_def_impl->methods)
+    {
+        axis2_hash_free(type_def_impl->methods, env);
+        type_def_impl->methods = NULL;
+    }
+
+    if((&(type_def_impl->type_def))->ops)
+    {
+        AXIS2_FREE(env->allocator, type_def_impl->type_def.ops);
+        (&(type_def_impl->type_def))->ops = NULL;
+    }
+    
+    if(type_def_impl)
+    {
+        AXIS2_FREE(env->allocator, type_def_impl);
+        type_def_impl = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_hash_t *AXIS2_CALL
+woden_type_def_super_objs(
+        void *type_def,
+        const axis2_env_t *env)
+{
+    woden_type_def_impl_t *type_def_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    type_def_impl = INTF_TO_IMPL(type_def);
+
+    return type_def_impl->super;
+}
+
+woden_obj_types_t AXIS2_CALL
+woden_type_def_type(void *type_def,
+        const axis2_env_t *env)
+{
+    woden_type_def_impl_t *type_def_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    type_def_impl = INTF_TO_IMPL(type_def);
+
+    return type_def_impl->obj_type;
+}
+
+axis2_status_t AXIS2_CALL
+woden_type_def_resolve_methods(
+        woden_type_def_t *type_def,
+        const axis2_env_t *env,
+        woden_type_def_t *type_def_impl,
+        axis2_hash_t *methods)
+{
+    woden_type_def_impl_t *type_def_impl_l = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, methods, AXIS2_FAILURE);
+    type_def_impl_l = INTF_TO_IMPL (type_def_impl);
+    
+    type_def->ops = AXIS2_MALLOC(env->allocator, 
+                sizeof(woden_type_def_ops_t));
+    
+    type_def->ops->free = axis2_hash_get(methods, "free", 
+            AXIS2_HASH_KEY_STRING);
+    type_def->ops->super_objs = axis2_hash_get(methods, 
+            "super_objs", AXIS2_HASH_KEY_STRING);
+    type_def->ops->type = axis2_hash_get(methods, "type", 
+            AXIS2_HASH_KEY_STRING);
+    
+    type_def->ops->set_qname = axis2_hash_get(methods, 
+            "set_qname", AXIS2_HASH_KEY_STRING);
+    if(!type_def->ops->set_qname && type_def_impl_l)
+            type_def->ops->set_qname = 
+            type_def_impl_l->type_def.ops->set_qname;
+    
+    type_def->ops->get_qname = axis2_hash_get(methods, 
+            "get_qname", AXIS2_HASH_KEY_STRING);
+    if(!type_def->ops->get_qname && type_def_impl_l)
+            type_def->ops->get_qname = 
+            type_def_impl_l->type_def.ops->get_qname;
+    
+    type_def->ops->set_system = axis2_hash_get(methods, 
+            "set_system", AXIS2_HASH_KEY_STRING);
+    if(!type_def->ops->set_system && type_def_impl_l)
+            type_def->ops->set_system = 
+            type_def_impl_l->type_def.ops->set_system;
+    
+    type_def->ops->get_system = axis2_hash_get(methods, 
+            "get_system", AXIS2_HASH_KEY_STRING);
+    if(!type_def->ops->get_system && type_def_impl_l)
+            type_def->ops->get_system = 
+            type_def_impl_l->type_def.ops->get_system;
+    
+    type_def->ops->set_content_model = axis2_hash_get(methods, 
+            "set_content_model", AXIS2_HASH_KEY_STRING);
+    if(!type_def->ops->set_content_model && type_def_impl_l)
+            type_def->ops->set_content_model = 
+            type_def_impl_l->type_def.ops->set_content_model;
+    
+    type_def->ops->get_content_model = axis2_hash_get(methods, 
+            "get_content_model", AXIS2_HASH_KEY_STRING);
+    if(!type_def->ops->get_content_model && type_def_impl_l)
+            type_def->ops->get_content_model = 
+            type_def_impl_l->type_def.ops->get_content_model;
+    
+    type_def->ops->set_content = axis2_hash_get(methods, 
+            "set_content", AXIS2_HASH_KEY_STRING);
+    if(!type_def->ops->set_content && type_def_impl_l)
+            type_def->ops->set_content = 
+            type_def_impl_l->type_def.ops->set_content;
+    
+    type_def->ops->get_content = axis2_hash_get(methods, 
+            "get_content", AXIS2_HASH_KEY_STRING);
+    if(!type_def->ops->get_content && type_def_impl_l)
+            type_def->ops->get_content = 
+            type_def_impl_l->type_def.ops->get_content;
+    
+    return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+woden_type_def_set_qname(
+        void *type_def,
+        const axis2_env_t *env,
+        axis2_qname_t *qname)
+{
+    woden_type_def_impl_t *type_def_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, qname, AXIS2_FAILURE);
+    super = WODEN_TYPE_DEF_SUPER_OBJS(type_def, env);
+    type_def_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_TYPE_DEF", AXIS2_HASH_KEY_STRING));
+   
+    if(type_def_impl->f_qname)
+    {
+        AXIS2_QNAME_FREE(type_def_impl->f_qname, env);
+        type_def_impl->f_qname = NULL;
+    }
+    type_def_impl->f_qname = AXIS2_QNAME_CLONE(qname, env);
+    return AXIS2_SUCCESS;
+}
+
+axis2_qname_t *AXIS2_CALL
+woden_type_def_get_qname(
+        void *type_def,
+        const axis2_env_t *env)
+{
+    woden_type_def_impl_t *type_def_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_TYPE_DEF_SUPER_OBJS(type_def, env);
+    type_def_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_TYPE_DEF", AXIS2_HASH_KEY_STRING));
+
+    return type_def_impl->f_qname;
+}
+
+axis2_status_t AXIS2_CALL
+woden_type_def_set_system(
+        void *type_def,
+        const axis2_env_t *env,
+        axis2_uri_t *type_system_uri)
+{
+    woden_type_def_impl_t *type_def_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, type_system_uri, AXIS2_FAILURE);
+    super = WODEN_TYPE_DEF_SUPER_OBJS(type_def, env);
+    type_def_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_TYPE_DEF", AXIS2_HASH_KEY_STRING));
+   
+    if(type_def_impl->f_system)
+    {
+        /* Free f_content */
+    }
+    type_def_impl->f_system = type_system_uri;
+    return AXIS2_SUCCESS;
+}
+
+axis2_uri_t *AXIS2_CALL
+woden_type_def_get_system(
+        void *type_def,
+        const axis2_env_t *env)
+{
+    woden_type_def_impl_t *type_def_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_TYPE_DEF_SUPER_OBJS(type_def, env);
+    type_def_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_TYPE_DEF", AXIS2_HASH_KEY_STRING));
+
+    return type_def_impl->f_system;
+}
+
+axis2_status_t AXIS2_CALL
+woden_type_def_set_content_model(
+        void *type_def,
+        const axis2_env_t *env,
+        axis2_char_t *content_model)
+{
+    woden_type_def_impl_t *type_def_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, content_model, AXIS2_FAILURE);
+    super = WODEN_TYPE_DEF_SUPER_OBJS(type_def, env);
+    type_def_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_TYPE_DEF", AXIS2_HASH_KEY_STRING));
+   
+    if(type_def_impl->f_content_model)
+    {
+        /* Free f_content */
+    }
+    type_def_impl->f_content_model = content_model;
+    return AXIS2_SUCCESS;
+}
+
+axis2_char_t *AXIS2_CALL
+woden_type_def_get_content_model(
+        void *type_def,
+        const axis2_env_t *env)
+{
+    woden_type_def_impl_t *type_def_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_TYPE_DEF_SUPER_OBJS(type_def, env);
+    type_def_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_TYPE_DEF", AXIS2_HASH_KEY_STRING));
+
+    return type_def_impl->f_content_model;
+}
+
+axis2_status_t AXIS2_CALL
+woden_type_def_set_content(
+        void *type_def,
+        const axis2_env_t *env,
+        void *type_def_content)
+{
+    woden_type_def_impl_t *type_def_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, type_def, AXIS2_FAILURE);
+    super = WODEN_TYPE_DEF_SUPER_OBJS(type_def, env);
+    type_def_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_TYPE_DEF", AXIS2_HASH_KEY_STRING));
+   
+    if(type_def_impl->f_content)
+    {
+        /* Free f_content */
+    }
+    type_def_impl->f_content = type_def_content;
+    return AXIS2_SUCCESS;
+}
+
+void *AXIS2_CALL
+woden_type_def_get_content(
+        void *type_def,
+        const axis2_env_t *env)
+{
+    woden_type_def_impl_t *type_def_impl = NULL;
+    axis2_hash_t *super = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    super = WODEN_TYPE_DEF_SUPER_OBJS(type_def, env);
+    type_def_impl = INTF_TO_IMPL(axis2_hash_get(super, 
+                "WODEN_TYPE_DEF", AXIS2_HASH_KEY_STRING));
+
+    return type_def_impl->f_content;
+}
+



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message