ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r386001 - in /webservices/axis2/trunk/c/modules/wsdl: Makefile.am wsdl_desc.c wsdl_extensible_attribute.c wsdl_extensible_element.c wsdl_feature.c wsdl_import.c wsdl_include.c wsdl_types.c
Date Wed, 15 Mar 2006 08:43:07 GMT
Author: damitha
Date: Wed Mar 15 00:43:05 2006
New Revision: 386001

URL: http://svn.apache.org/viewcvs?rev=386001&view=rev
Log:
Work regarding to WOM

Added:
    webservices/axis2/trunk/c/modules/wsdl/wsdl_desc.c
    webservices/axis2/trunk/c/modules/wsdl/wsdl_extensible_attribute.c
    webservices/axis2/trunk/c/modules/wsdl/wsdl_import.c
    webservices/axis2/trunk/c/modules/wsdl/wsdl_include.c
    webservices/axis2/trunk/c/modules/wsdl/wsdl_types.c
Modified:
    webservices/axis2/trunk/c/modules/wsdl/Makefile.am
    webservices/axis2/trunk/c/modules/wsdl/wsdl_extensible_element.c
    webservices/axis2/trunk/c/modules/wsdl/wsdl_feature.c

Modified: webservices/axis2/trunk/c/modules/wsdl/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/Makefile.am?rev=386001&r1=386000&r2=386001&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/wsdl/Makefile.am Wed Mar 15 00:43:05 2006
@@ -1,4 +1,5 @@
 TESTS =
+SUBDIRS=
 lib_LTLIBRARIES = libaxis2_wsdl.la
 libaxis2_wsdl_la_SOURCES = wsdl_op.c \
                         wsdl_svc.c \
@@ -15,7 +16,12 @@
                         wsdl_endpoint.c \
                         wsdl_fault_ref.c \
                         wsdl_extensible_element.c \
-                        wsdl_soap_op.c
+                        wsdl_extensible_attribute.c \
+                        wsdl_soap_op.c \
+                        wsdl_types.c \
+                        wsdl_import.c \
+                        wsdl_include.c \
+                        wsdl_desc.c
 
 INCLUDES = -I$(top_builddir)/include \
             -I$(top_builddir)/modules/util \

Added: webservices/axis2/trunk/c/modules/wsdl/wsdl_desc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/wsdl_desc.c?rev=386001&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/wsdl_desc.c (added)
+++ webservices/axis2/trunk/c/modules/wsdl/wsdl_desc.c Wed Mar 15 00:43:05 2006
@@ -0,0 +1,1106 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+#include <axis2_wsdl_desc.h>
+#include <axis2_wsdl_types.h>
+#include <axis2_wsdl_component.h>
+#include <axis2_wsdl_binding.h>
+#include <axis2_wsdl_import.h>
+#include <axis2_wsdl_include.h>
+#include <axis2_wsdl_extensible_attribute.h>
+#include <axis2_wsdl_binding_fault.h>
+
+
+/** 
+ * @brief Wsdl Description struct impl
+ *	Axis2 Wsdl Description Implementation 
+ */ 
+typedef struct axis2_wsdl_desc_impl
+{
+	axis2_wsdl_desc_t wsdl_desc;
+    /**
+     * The name token of WSDL 1.1 Definition.
+     */
+    axis2_qname_t *wsdl1_def_name;
+    /* TODO local name and the naspace name to be made static or through a 
+     * Constant class.*/
+    /* TODO required; thus check it up */
+    /**
+     * Field targetNameSpace
+     */
+    axis2_char_t *target_namespace;
+    /* TODO The object structure of some external xml data binding is going to 
+     *be pluged here eventually.*/  
+    /**
+     * Field types
+     */
+    axis2_wsdl_types_t *types;
+    /**
+     * This List will be a list of <code>WSDLInterface</code> objects.
+     */
+    axis2_hash_t *interfaces;
+    /**
+     * This <code>HashMap </code> is a Map of <code>WSDLBinding </code> objects.
+     */
+    axis2_hash_t *bindings;
+    /**
+     * This <code>HashMap </code> is a list of <code>WSDLService </code> objects.
+     * Support of multiple is backed by the requirements in the specification.
+     */
+    axis2_hash_t *svcs;
+    /**
+     * WSDL imports
+     */
+    axis2_array_list_t *imports;
+    /**
+     * WSDL Includes.
+     */
+    axis2_array_list_t *includes;
+    /**
+     * Will keep a map of all the Namespaces associated with the
+     * Definition Component and will be keyed by the Namespace prefix.
+     */
+    axis2_hash_t *namespaces;
+    
+} axis2_wsdl_desc_impl_t;
+
+#define AXIS2_INTF_TO_IMPL(wsdl_desc) ((axis2_wsdl_desc_impl_t *)wsdl_desc)
+	
+/*************************** Function headers *********************************/
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_free (axis2_wsdl_desc_t *wsdl_desc, 
+                        axis2_env_t **env);	
+
+/**
+ * Returns a Map of <code>wsdl_bindings</code> Objects keyed by the 
+ * <code>axis2_qname_t</code> of the Binding.
+ *
+ * @return
+ */
+axis2_hash_t *AXIS2_CALL
+axis2_wsdl_desc_get_bindings(axis2_wsdl_desc_t *wsdl_desc,  
+                                axis2_env_t **env);
+
+/**
+ * Sets the whole new set of Bindings to the axis2_wsd_desc.
+ *
+ * @param bindings
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_bindings(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env,
+                                axis2_hash_t *bindings);
+
+/**
+ * The axis2_wsdl_binding Will be added to the map keyed  with its own qname.
+ * If the  axis2_wsdl_binding is null it will not be added.
+ * If the axis2_wsdl_binding is not null and  Binding name is null then
+ * error is set.
+ *
+ * @param binding <code>axis2_wsdl_binding</code> Object
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_add_binding(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_wsdl_binding_t *binding);
+
+/**
+ * Retrives the <code>axis2_wsdl_binding_t</code> by its qname. Wil return NULL
+ * if <code>axis2_wsdl_binding_t</code> is not found.
+ *
+ * @param qname The qname of the Binding.
+ * @return
+ */
+axis2_wsdl_binding_t *AXIS2_CALL
+axis2_wsdl_desc_get_binding(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env,
+                                axis2_qname_t *qname);
+
+/**
+ * The Interface component will be added to the map keyed with its own name.
+ * If the Interface is NULL it will not be added.
+ * If the interface name is NULL an Error will be set and return.
+ *
+ * @param interface
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_add_interface(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env,
+                                axis2_wsdl_interface_t *interface);
+
+/**
+ * The Interface will be returned if it exsists,
+ * otherwise null will be returned.
+ *
+ * @param qname qname of the Interface.
+ * @return The Interface with the relavent qname
+ */
+axis2_wsdl_interface_t *AXIS2_CALL
+axis2_wsdl_desc_get_interface(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env,
+                                axis2_qname_t *qname);
+
+/**
+ * Method get_interfaces
+ *
+ * @return
+ */
+axis2_hash_t *AXIS2_CALL
+axis2_wsdl_desc_get_interfaces(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env);
+
+/**
+ * Method axis2_wsdl_desc_set_interfaces
+ *
+ * @param interfaces
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_interfaces(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_hash_t *interfaces);
+
+/**
+ * Method get_svcs
+ *
+ * @return
+ */
+axis2_hash_t *AXIS2_CALL
+axis2_wsdl_desc_get_svcs(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env);
+
+/**
+ * Method axis2_wsdl_desc_set_svcs
+ *
+ * @param svcs
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_svcs(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_hash_t *svcs);
+
+/**
+ * Will return the <code>axis2_wsdl_svc </code> if found otherwise return NULL.
+ *
+ * @param qname <code>qname</code> of the svc
+ * @return The svc with the relevant qname
+ */
+axis2_wsdl_svc_t *AXIS2_CALL
+axis2_wsdl_desc_get_svc(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env,
+                                axis2_qname_t *qname);
+
+/**
+ * Will add the <code>axis2_wsdl_svc_t</code> to the map.
+ * If svc is NULL it will not be added.
+ * If the <code>axis2_wsdl_svc_t</code> name is NULL an error will be set.
+ *
+ * @param svc
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_add_svc(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env,
+                                axis2_wsdl_svc_t *svc);
+
+/**
+ * Method get_target_namespace
+ *
+ * @return
+ */
+axis2_char_t *AXIS2_CALL
+axis2_wsdl_desc_get_target_namespace(axis2_wsdl_desc_t *wsdl_desc,
+                                        axis2_env_t **env);
+
+/**
+ * Method set_target_namespace
+ *
+ * @param target_namespace
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_target_namespace(axis2_wsdl_desc_t *wsdl_desc,
+                                        axis2_env_t **env,
+                                        axis2_char_t *target_namespace);
+
+/**
+ * Method get_types
+ *
+ * @return
+ */
+axis2_wsdl_types_t *AXIS2_CALL
+axis2_wsdl_desc_get_types(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env);
+
+/**
+ * Method axis2_wsdl_desc_set_types
+ *
+ * @param types
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_types(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_wsdl_types_t *types);
+
+/**
+ * Gets the name attribute of the WSDL 1.1 Definitions Element
+ *
+ * @return
+ */
+axis2_qname_t *AXIS2_CALL
+axis2_wsdl_desc_get_wsdl1_def_name(axis2_wsdl_desc_t *wsdl_desc,
+                                    axis2_env_t **env);
+
+/**
+ * Sets the name attribute of the WSDL 1.1 Definitions Element
+ *
+ * @param wsdl1_def_name
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_wsdl1_def_name(axis2_wsdl_desc_t *wsdl_desc,
+                                    axis2_env_t **env,
+                                    axis2_qname_t *wsdl1_def_name);
+
+/**
+ * Will return the Namespace URI as a String if there exists an
+ * Namespace URI associated with the given prefix, in the Definition
+ * Component, Will return NULL if not found.
+ *
+ * @param prefix Prefix defined in the Definitions elemet in the WSDL file
+ * @return The Namespace URI for the prefix.
+ */
+axis2_char_t *AXIS2_CALL
+axis2_wsdl_desc_get_namespace(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env,
+                                axis2_char_t *prefix);
+
+/**
+ * Will return all the Namespaces associated with the Definition
+ * Component and will be keyed by the Napespace Prefix.
+ *
+ * @return
+ */
+axis2_hash_t *AXIS2_CALL
+axis2_wsdl_desc_get_namespaces(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env);
+
+/**
+ * Sets the Namespaces associated with the Difinition Component
+ * and they should be keyed by its Namespace Prefix.
+ *
+ * @param namespaces
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_namespaces(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_hash_t *namespaces);
+
+/**
+ * Returns the WSDL Imports in an <code>axis2_array_list_t</code>
+ *
+ * @return
+ */
+axis2_array_list_t *AXIS2_CALL
+axis2_wsdl_desc_get_imports(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t *env);
+
+/**
+ * Sets the imports as an <code>axis2_array_list_t</code>
+ *
+ * @param imports
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_imports(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_array_list_t *imports);
+
+/**
+ * Adds an import to the list.
+ *
+ * @param wsdl_import
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_add_import(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_wsdl_import_t *wsdl_import);
+
+/**
+ * Returns the Includes in an <code>axis2_array_list_t</code>
+ *
+ * @return
+ */
+axis2_array_list_t *AXIS2_CALL
+axis2_wsdl_desc_get_includes(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t *env);
+
+/**
+ * Sets the includes as an <code>axis2_array_list_t</code>
+ *
+ * @param includes
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_includes(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_array_list_t *includes);
+
+/**
+ * Adds an wsdl include to the list.
+ *
+ * @param wsdl_include
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_add_include(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_wsdl_include_t *wsdl_include);
+
+
+/************************* End of function headers ****************************/	
+
+axis2_wsdl_desc_t * AXIS2_CALL
+axis2_wsdl_desc_create (axis2_env_t **env)
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    
+	wsdl_desc_impl = (axis2_wsdl_desc_impl_t *) AXIS2_MALLOC ((*env)->
+        allocator, sizeof (axis2_wsdl_desc_impl_t));
+     
+	if(NULL == wsdl_desc_impl)
+	{
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+	}
+    
+    wsdl_desc_impl->wsdl1_def_name = NULL;
+    wsdl_desc_impl->target_namespace = NULL;
+    wsdl_desc_impl->types = NULL;
+    wsdl_desc_impl->interfaces = NULL;
+    wsdl_desc_impl->bindings = NULL;
+    wsdl_desc_impl->svcs = NULL;
+    wsdl_desc_impl->imports = NULL;
+    wsdl_desc_impl->includes = NULL;
+    wsdl_desc_impl->namespaces = NULL;
+    wsdl_desc_impl->wsdl_desc.ops = NULL;
+    
+    wsdl_desc_impl->wsdl_desc.component = axis2_wsdl_component_create(env);
+    
+	if(NULL == wsdl_desc_impl->wsdl_desc.component)
+	{
+        axis2_wsdl_desc_free(&(wsdl_desc_impl->wsdl_desc), env);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;        
+	}    
+    
+    wsdl_desc_impl->wsdl_desc.ops = AXIS2_MALLOC((*env)->allocator, 
+        sizeof(axis2_wsdl_desc_ops_t));
+	if(NULL == wsdl_desc_impl->wsdl_desc.ops)
+	{
+        axis2_wsdl_desc_free(&(wsdl_desc_impl->wsdl_desc), env);
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+	}
+	
+	wsdl_desc_impl->wsdl_desc.ops->free = axis2_wsdl_desc_free;
+    wsdl_desc_impl->wsdl_desc.ops->get_bindings = axis2_wsdl_desc_get_bindings;
+    wsdl_desc_impl->wsdl_desc.ops->set_bindings = axis2_wsdl_desc_set_bindings;
+    wsdl_desc_impl->wsdl_desc.ops->add_binding = axis2_wsdl_desc_add_binding;
+    wsdl_desc_impl->wsdl_desc.ops->get_binding = axis2_wsdl_desc_get_binding;
+    wsdl_desc_impl->wsdl_desc.ops->add_interface = axis2_wsdl_desc_add_interface;
+    wsdl_desc_impl->wsdl_desc.ops->get_interface = axis2_wsdl_desc_get_interface;
+    wsdl_desc_impl->wsdl_desc.ops->get_interfaces = axis2_wsdl_desc_get_interfaces;
+    wsdl_desc_impl->wsdl_desc.ops->set_interfaces = axis2_wsdl_desc_set_interfaces;
+    wsdl_desc_impl->wsdl_desc.ops->get_svcs = axis2_wsdl_desc_get_svcs;
+    wsdl_desc_impl->wsdl_desc.ops->set_svcs = axis2_wsdl_desc_set_svcs;
+    wsdl_desc_impl->wsdl_desc.ops->get_svc = axis2_wsdl_desc_get_svc;
+    wsdl_desc_impl->wsdl_desc.ops->add_svc = axis2_wsdl_desc_add_svc;
+    wsdl_desc_impl->wsdl_desc.ops->get_target_namespace = 
+        axis2_wsdl_desc_get_target_namespace;
+    wsdl_desc_impl->wsdl_desc.ops->set_target_namespace = 
+            axis2_wsdl_desc_set_target_namespace;
+    wsdl_desc_impl->wsdl_desc.ops->get_types = axis2_wsdl_desc_get_types;
+    wsdl_desc_impl->wsdl_desc.ops->set_types = axis2_wsdl_desc_set_types;
+    wsdl_desc_impl->wsdl_desc.ops->get_wsdl1_def_name = 
+            axis2_wsdl_desc_get_wsdl1_def_name;
+    wsdl_desc_impl->wsdl_desc.ops->set_wsdl1_def_name = 
+            axis2_wsdl_desc_set_wsdl1_def_name;
+    wsdl_desc_impl->wsdl_desc.ops->get_namespace = axis2_wsdl_desc_get_namespace;
+    wsdl_desc_impl->wsdl_desc.ops->get_namespaces = axis2_wsdl_desc_get_namespaces;
+    wsdl_desc_impl->wsdl_desc.ops->set_namespaces = axis2_wsdl_desc_set_namespaces;
+    wsdl_desc_impl->wsdl_desc.ops->get_imports = axis2_wsdl_desc_get_imports;
+    wsdl_desc_impl->wsdl_desc.ops->set_imports = axis2_wsdl_desc_set_imports;
+    wsdl_desc_impl->wsdl_desc.ops->add_import = axis2_wsdl_desc_add_import;
+    wsdl_desc_impl->wsdl_desc.ops->get_includes = axis2_wsdl_desc_get_includes;
+    wsdl_desc_impl->wsdl_desc.ops->set_includes = axis2_wsdl_desc_set_includes;
+    wsdl_desc_impl->wsdl_desc.ops->add_include = axis2_wsdl_desc_add_include; 
+    
+	return &(wsdl_desc_impl->wsdl_desc);
+}
+
+/*************************Function implementations*****************************/
+
+axis2_status_t AXIS2_CALL 
+axis2_wsdl_desc_free (
+                        axis2_wsdl_desc_t *wsdl_desc, 
+                        axis2_env_t **env)
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE); 
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+    
+	if(wsdl_desc->ops)
+    {
+        AXIS2_FREE((*env)->allocator, wsdl_desc->ops);
+        wsdl_desc->ops = NULL;
+    }
+    
+    if(wsdl_desc->component)
+    {
+        AXIS2_WSDL_COMPONENT_FREE(wsdl_desc->component, env);
+        wsdl_desc->component = NULL;
+    }
+    
+    if(wsdl_desc_impl)
+        AXIS2_FREE((*env)->allocator, wsdl_desc_impl);
+    wsdl_desc_impl = NULL;
+    
+	return AXIS2_SUCCESS;
+}
+
+/**
+ * Returns a Map of <code>wsdl_bindings</code> Objects keyed by the 
+ * <code>axis2_qname_t</code> of the Binding.
+ *
+ * @return
+ */
+axis2_hash_t *AXIS2_CALL
+axis2_wsdl_desc_get_bindings(axis2_wsdl_desc_t *wsdl_desc,  
+                                axis2_env_t **env) 
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    return AXIS2_INTF_TO_IMPL(wsdl_desc)->bindings;
+}
+
+/**
+ * Sets the whole new set of Bindings to the axis2_wsd_desc.
+ *
+ * @param bindings
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_bindings(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env,
+                                axis2_hash_t *bindings) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+    
+    /* TODO free previous bindings before assign new bindings */
+    wsdl_desc_impl->bindings = bindings;
+  
+    return AXIS2_SUCCESS;
+}
+
+/**
+ * The axis2_wsdl_binding Will be added to the map keyed  with its own qname.
+ * If the  axis2_wsdl_binding is null it will not be added.
+ * If the axis2_wsdl_binding is not null and  Binding name is null then
+ * error is set.
+ *
+ * @param binding <code>axis2_wsdl_binding</code> Object
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_add_binding(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_wsdl_binding_t *binding) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+    axis2_qname_t *binding_qname = NULL;
+    axis2_char_t *binding_name = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, binding, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+
+    binding_qname = AXIS2_WSDL_BINDING_GET_NAME(binding, env);
+    if(NULL == binding_name)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_WSDL_BINDING_NAME_IS_REQUIRED,
+            AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    binding_name = AXIS2_QNAME_TO_STRING(binding_qname, env);
+    if(!wsdl_desc_impl->bindings)
+    {
+        wsdl_desc_impl->bindings = axis2_hash_make(env);
+        if(!wsdl_desc_impl->bindings)
+        {
+            AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+            return AXIS2_FAILURE;
+        }
+    }
+    axis2_hash_set(wsdl_desc_impl->bindings, binding_name, AXIS2_HASH_KEY_STRING,
+        binding);
+    return AXIS2_SUCCESS;
+}
+
+/**
+ * Retrives the <code>axis2_wsdl_binding_t</code> by its qname. Wil return NULL
+ * if <code>axis2_wsdl_binding_t</code> is not found.
+ *
+ * @param qname The qname of the Binding.
+ * @return
+ */
+axis2_wsdl_binding_t *AXIS2_CALL
+axis2_wsdl_desc_get_binding(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env,
+                                axis2_qname_t *qname) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+    axis2_char_t *name = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+    
+    name = AXIS2_QNAME_TO_STRING(qname, env);
+    if(wsdl_desc_impl->bindings)
+    {
+        return (axis2_wsdl_binding_t *) axis2_hash_get(wsdl_desc_impl->bindings, 
+            name, AXIS2_HASH_KEY_STRING);
+    }
+    return NULL;
+}
+
+/**
+ * The Interface component will be added to the map keyed with its own name.
+ * If the Interface is NULL it will not be added.
+ * If the interface name is NULL an Error will be set and return.
+ *
+ * @param interface
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_add_interface(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env,
+                                axis2_wsdl_interface_t *interface) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+    axis2_qname_t *interface_qname = NULL;
+    axis2_char_t *interface_name = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, interface, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+
+    interface_qname = AXIS2_WSDL_INTERFACE_GET_NAME(interface, env);
+    if(NULL == interface_qname)
+    {
+        AXIS2_ERROR_SET((*env)->error, 
+            AXIS2_ERROR_WSDL_INTERFACE_NAME_IS_REQUIRED, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    interface_name = AXIS2_QNAME_TO_STRING(interface_qname, env);
+    if(!wsdl_desc_impl->interfaces)
+    {
+        wsdl_desc_impl->interfaces = axis2_hash_make(env);
+        if(!wsdl_desc_impl->interfaces)
+        {
+            AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+            return AXIS2_FAILURE;
+        }
+    }
+    axis2_hash_set(wsdl_desc_impl->interfaces, interface_name, 
+        AXIS2_HASH_KEY_STRING, interface);
+    return AXIS2_SUCCESS;
+}
+
+/**
+ * The Interface will be returned if it exsists,
+ * otherwise null will be returned.
+ *
+ * @param qname qname of the Interface.
+ * @return The Interface with the relavent qname
+ */
+axis2_wsdl_interface_t *AXIS2_CALL
+axis2_wsdl_desc_get_interface(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env,
+                                axis2_qname_t *qname) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+    axis2_char_t *name = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+    
+    name = AXIS2_QNAME_TO_STRING(qname, env);
+    if(wsdl_desc_impl->interfaces)
+    {
+        return (axis2_wsdl_interface_t *) axis2_hash_get(wsdl_desc_impl->interfaces, 
+            name, AXIS2_HASH_KEY_STRING);
+    }
+    return NULL;
+}
+
+/**
+ * Method get_interfaces
+ *
+ * @return
+ */
+axis2_hash_t *AXIS2_CALL
+axis2_wsdl_desc_get_interfaces(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env) 
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(wsdl_desc)->interfaces;
+}
+
+/**
+ * Method axis2_wsdl_desc_set_interfaces
+ *
+ * @param interfaces
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_interfaces(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_hash_t *interfaces) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+    
+    /*TODO free existing interfaces before setting new map */
+    wsdl_desc_impl->interfaces = interfaces;
+  
+    return AXIS2_SUCCESS;
+}
+
+/**
+ * Method get_svcs
+ *
+ * @return
+ */
+axis2_hash_t *AXIS2_CALL
+axis2_wsdl_desc_get_svcs(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env) 
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(wsdl_desc)->svcs;
+}
+
+/**
+ * Method axis2_wsdl_desc_set_svcs
+ *
+ * @param svcs
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_svcs(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_hash_t *svcs) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+    
+    /*TODO free existing svcs before setting new map */
+    wsdl_desc_impl->svcs = svcs;
+  
+    return AXIS2_SUCCESS;
+}
+
+/**
+ * Will return the <code>axis2_wsdl_svc </code> if found otherwise return NULL.
+ *
+ * @param qname <code>qname</code> of the svc
+ * @return The svc with the relevant qname
+ */
+axis2_wsdl_svc_t *AXIS2_CALL
+axis2_wsdl_desc_get_svc(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env,
+                                axis2_qname_t *qname) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+    axis2_char_t *name = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+    
+    name = AXIS2_QNAME_TO_STRING(qname, env);
+    if(wsdl_desc_impl->svcs)
+    {
+        return (axis2_wsdl_svc_t *) axis2_hash_get(wsdl_desc_impl->svcs, 
+            name, AXIS2_HASH_KEY_STRING);
+    }
+    return NULL;
+}
+
+/**
+ * Will add the <code>axis2_wsdl_svc_t</code> to the map.
+ * If svc is NULL it will not be added.
+ * If the <code>axis2_wsdl_svc_t</code> name is NULL an error will be set.
+ *
+ * @param svc
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_add_svc(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env,
+                                axis2_wsdl_svc_t *svc) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+    axis2_qname_t *svc_qname = NULL;
+    axis2_char_t *svc_name = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, svc, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+
+    svc_qname = AXIS2_WSDL_SVC_GET_QNAME(svc, env);
+    if(NULL == svc_qname)
+    {
+        AXIS2_ERROR_SET((*env)->error, 
+            AXIS2_ERROR_WSDL_SVC_NAME_IS_REQUIRED, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    svc_name = AXIS2_QNAME_TO_STRING(svc_qname, env);
+    if(!wsdl_desc_impl->svcs)
+    {
+        wsdl_desc_impl->svcs = axis2_hash_make(env);
+        if(!wsdl_desc_impl->svcs)
+        {
+            AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+            return AXIS2_FAILURE;
+        }
+    }
+    axis2_hash_set(wsdl_desc_impl->svcs, svc_name, 
+        AXIS2_HASH_KEY_STRING, svc);
+    return AXIS2_SUCCESS;
+}
+
+/**
+ * Method get_target_namespace
+ *
+ * @return
+ */
+axis2_char_t *AXIS2_CALL
+axis2_wsdl_desc_get_target_namespace(axis2_wsdl_desc_t *wsdl_desc,
+                                        axis2_env_t **env) 
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(wsdl_desc)->target_namespace;
+}
+
+/**
+ * Method set_target_namespace
+ *
+ * @param target_namespace
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_target_namespace(axis2_wsdl_desc_t *wsdl_desc,
+                                        axis2_env_t **env,
+                                        axis2_char_t *target_namespace) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, target_namespace, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+
+    if(wsdl_desc_impl->target_namespace)
+    {
+        AXIS2_FREE((*env)->allocator, wsdl_desc_impl->target_namespace);
+        wsdl_desc_impl->target_namespace = NULL;
+    }
+    wsdl_desc_impl->target_namespace = AXIS2_STRDUP(target_namespace, env);
+    if(wsdl_desc_impl->target_namespace)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}
+
+/**
+ * Method get_types
+ *
+ * @return
+ */
+axis2_wsdl_types_t *AXIS2_CALL
+axis2_wsdl_desc_get_types(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env) 
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(wsdl_desc)->types;
+}
+
+/**
+ * Method axis2_wsdl_desc_set_types
+ *
+ * @param types
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_types(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_wsdl_types_t *types) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+    AXIS2_PARAM_CHECK((*env)->error, types, AXIS2_FAILURE);
+    
+    if(wsdl_desc_impl->types)
+    {
+        AXIS2_WSDL_TYPES_FREE(wsdl_desc_impl->types, env);
+        wsdl_desc_impl->types = NULL;
+    }
+    wsdl_desc_impl->types = types;
+  
+    return AXIS2_SUCCESS;
+}
+
+
+/**
+ * Gets the name attribute of the WSDL 1.1 Definitions Element
+ *
+ * @return
+ */
+axis2_qname_t *AXIS2_CALL
+axis2_wsdl_desc_get_wsdl1_def_name(axis2_wsdl_desc_t *wsdl_desc,
+                                    axis2_env_t **env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(wsdl_desc)->wsdl1_def_name;
+}
+
+/**
+ * Sets the name attribute of the WSDL 1.1 Definitions Element
+ *
+ * @param wsdl1_def_name
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_wsdl1_def_name(axis2_wsdl_desc_t *wsdl_desc,
+                                    axis2_env_t **env,
+                                    axis2_qname_t *wsdl1_def_name) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+    
+    if(wsdl_desc_impl->wsdl1_def_name)
+    {
+        AXIS2_QNAME_FREE(wsdl_desc_impl->wsdl1_def_name, env);
+        wsdl_desc_impl->wsdl1_def_name = NULL;
+    }
+    wsdl_desc_impl->wsdl1_def_name = AXIS2_QNAME_CLONE(wsdl1_def_name, env);
+  
+    return AXIS2_SUCCESS;
+}
+
+/**
+ * Will return the Namespace URI as a String if there exists an
+ * Namespace URI associated with the given prefix, in the Definition
+ * Component, Will return NULL if not found.
+ *
+ * @param prefix Prefix defined in the Definitions elemet in the WSDL file
+ * @return The Namespace URI for the prefix.
+ */
+axis2_char_t *AXIS2_CALL
+axis2_wsdl_desc_get_namespace(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env,
+                                axis2_char_t *prefix) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, prefix, NULL);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+
+    return (axis2_char_t *) axis2_hash_get(wsdl_desc_impl->namespaces, prefix, 
+        AXIS2_HASH_KEY_STRING);
+}
+
+/**
+ * Will return all the Namespaces associated with the Definition
+ * Component and will be keyed by the Napespace Prefix.
+ *
+ * @return
+ */
+axis2_hash_t *AXIS2_CALL
+axis2_wsdl_desc_get_namespaces(axis2_wsdl_desc_t *wsdl_desc,
+                                axis2_env_t **env) 
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    return AXIS2_INTF_TO_IMPL(wsdl_desc)->namespaces;
+}
+
+/**
+ * Sets the Namespaces associated with the Difinition Component
+ * and they should be keyed by its Namespace Prefix.
+ *
+ * @param namespaces
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_namespaces(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_hash_t *namespaces) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+    
+    /*TODO free existing namespaces before setting new map */
+    wsdl_desc_impl->namespaces = namespaces;
+  
+    return AXIS2_SUCCESS;
+}
+
+/**
+ * Returns the WSDL Imports in an <code>axis2_array_list_t</code>
+ *
+ * @return
+ */
+axis2_array_list_t *AXIS2_CALL
+axis2_wsdl_desc_get_imports(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t *env) 
+{
+    return AXIS2_INTF_TO_IMPL(wsdl_desc)->imports;
+}
+
+/**
+ * Sets the imports as an <code>axis2_array_list_t</code>
+ *
+ * @param imports
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_imports(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_array_list_t *imports) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+    AXIS2_PARAM_CHECK((*env)->error, imports, AXIS2_FAILURE);
+    
+    if(wsdl_desc_impl->imports)
+    {
+        /* TODO Free elements of the array */
+        AXIS2_ARRAY_LIST_FREE(wsdl_desc_impl->imports, env);
+        wsdl_desc_impl->imports = NULL;
+    }
+    wsdl_desc_impl->imports = imports;
+  
+    return AXIS2_SUCCESS;
+}
+
+/**
+ * Adds an import to the list.
+ *
+ * @param wsdl_import
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_add_import(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_wsdl_import_t *wsdl_import) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, wsdl_import, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+    
+    return AXIS2_ARRAY_LIST_ADD(wsdl_desc_impl->imports, env, wsdl_import);
+}
+
+/**
+ * Returns the Includes in an <code>axis2_array_list_t</code>
+ *
+ * @return
+ */
+axis2_array_list_t *AXIS2_CALL
+axis2_wsdl_desc_get_includes(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t *env) 
+{
+    return AXIS2_INTF_TO_IMPL(wsdl_desc)->includes;
+}
+
+/**
+ * Sets the includes as an <code>axis2_array_list_t</code>
+ *
+ * @param includes
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_set_includes(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_array_list_t *includes) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+    AXIS2_PARAM_CHECK((*env)->error, includes, AXIS2_FAILURE);
+    
+    if(wsdl_desc_impl->includes)
+    {
+        /* TODO Free elements of the array */
+        AXIS2_ARRAY_LIST_FREE(wsdl_desc_impl->includes, env);
+        wsdl_desc_impl->includes = NULL;
+    }
+    wsdl_desc_impl->includes = includes;
+  
+    return AXIS2_SUCCESS;
+}
+
+/**
+ * Adds an wsdl include to the list.
+ *
+ * @param wsdl_include
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_desc_add_include(axis2_wsdl_desc_t *wsdl_desc,
+                            axis2_env_t **env,
+                            axis2_wsdl_include_t *wsdl_include) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, wsdl_include, AXIS2_FAILURE);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+    
+    return AXIS2_ARRAY_LIST_ADD(wsdl_desc_impl->includes, env, wsdl_include);
+}
+
+axis2_wsdl_binding_t *AXIS2_CALL
+axis2_wsdl_desc_get_first_binding(axis2_wsdl_desc_t *wsdl_desc,
+                                    axis2_env_t **env) 
+{
+    axis2_wsdl_desc_impl_t *wsdl_desc_impl = NULL;
+    axis2_hash_index_t *index = NULL;
+    void *v = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    wsdl_desc_impl = AXIS2_INTF_TO_IMPL(wsdl_desc);
+    
+    index = axis2_hash_first(wsdl_desc_impl->bindings, env);
+    axis2_hash_this (index, NULL, NULL, &v);
+    if(v)
+        return (axis2_wsdl_binding_t *)v;
+    return NULL;
+}

Added: webservices/axis2/trunk/c/modules/wsdl/wsdl_extensible_attribute.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/wsdl_extensible_attribute.c?rev=386001&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/wsdl_extensible_attribute.c (added)
+++ webservices/axis2/trunk/c/modules/wsdl/wsdl_extensible_attribute.c Wed Mar 15 00:43:05 2006
@@ -0,0 +1,214 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+#include <axis2_wsdl_extensible_attribute.h>
+
+/** 
+ * @brief Wsdl extensible attribute struct impl
+ *	Wsdl extensible attribute
+ */ 
+typedef struct axis2_wsdl_extensible_attribute_impl
+{
+	axis2_wsdl_extensible_attribute_t extensible_attribute;
+    
+    axis2_qname_t *key;
+    axis2_qname_t *value;
+
+    
+} axis2_wsdl_extensible_attribute_impl_t;
+
+#define AXIS2_INTF_TO_IMPL(extensible_attribute) \
+		((axis2_wsdl_extensible_attribute_impl_t *)extensible_attribute)
+
+/************************* Function prototypes ********************************/
+
+axis2_status_t AXIS2_CALL
+	axis2_wsdl_extensible_attribute_free (
+                axis2_wsdl_extensible_attribute_t *extensible_attribute,
+				axis2_env_t **env);
+
+axis2_qname_t *AXIS2_CALL
+axis2_wsdl_extensible_attribute_get_key(
+                            axis2_wsdl_extensible_attribute_t *extensible_attribute,
+                            axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_extensible_attribute_set_key(
+                            axis2_wsdl_extensible_attribute_t *extensible_attribute,
+                            axis2_env_t **env,
+                            axis2_qname_t *key);
+                        
+axis2_qname_t *AXIS2_CALL
+axis2_wsdl_extensible_attribute_get_value(
+                            axis2_wsdl_extensible_attribute_t *extensible_attribute,
+                            axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_extensible_attribute_set_value(
+                            axis2_wsdl_extensible_attribute_t *extensible_attribute,
+                            axis2_env_t **env,
+                            axis2_qname_t *value);
+                        
+/************************** End of function prototypes ************************/
+
+axis2_wsdl_extensible_attribute_t * AXIS2_CALL 
+axis2_wsdl_extensible_attribute_create (axis2_env_t **env)
+{
+    axis2_wsdl_extensible_attribute_impl_t *extensible_attribute_impl = NULL;
+    
+	AXIS2_ENV_CHECK(env, NULL);
+	
+	extensible_attribute_impl = (axis2_wsdl_extensible_attribute_impl_t *) 
+        AXIS2_MALLOC((*env)->allocator, sizeof(axis2_wsdl_extensible_attribute_impl_t));
+	
+	
+	if(NULL == extensible_attribute_impl)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;        
+    }
+    
+    extensible_attribute_impl->key = NULL;
+    extensible_attribute_impl->value = NULL;
+    extensible_attribute_impl->extensible_attribute.ops = NULL;
+    
+	extensible_attribute_impl->extensible_attribute.ops = 
+		AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_wsdl_extensible_attribute_ops_t));
+	if(NULL == extensible_attribute_impl->extensible_attribute.ops)
+    {
+        axis2_wsdl_extensible_attribute_free(&(extensible_attribute_impl->
+            extensible_attribute), env);
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    
+    extensible_attribute_impl->extensible_attribute.ops->free =  
+        axis2_wsdl_extensible_attribute_free;
+    
+	extensible_attribute_impl->extensible_attribute.ops->get_key =  
+        axis2_wsdl_extensible_attribute_get_key;
+	extensible_attribute_impl->extensible_attribute.ops->set_key = 
+        axis2_wsdl_extensible_attribute_set_key;
+	extensible_attribute_impl->extensible_attribute.ops->get_value =  
+        axis2_wsdl_extensible_attribute_get_value;
+	extensible_attribute_impl->extensible_attribute.ops->set_value = 
+        axis2_wsdl_extensible_attribute_set_value;
+	
+    
+	return &(extensible_attribute_impl->extensible_attribute);
+}
+
+/***************************Function implementation****************************/
+
+axis2_status_t AXIS2_CALL 
+axis2_wsdl_extensible_attribute_free (
+                        axis2_wsdl_extensible_attribute_t *extensible_attribute, 
+                        axis2_env_t **env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+	if(NULL != extensible_attribute->ops)
+        AXIS2_FREE((*env)->allocator, extensible_attribute->ops);
+    
+    if(NULL != AXIS2_INTF_TO_IMPL(extensible_attribute)->key)
+    {
+        AXIS2_QNAME_FREE(AXIS2_INTF_TO_IMPL(extensible_attribute)->
+            key, env);
+        AXIS2_INTF_TO_IMPL(extensible_attribute)->key = NULL;    
+    }
+    
+    if(NULL != AXIS2_INTF_TO_IMPL(extensible_attribute)->value)
+    {
+        AXIS2_QNAME_FREE(AXIS2_INTF_TO_IMPL(extensible_attribute)->
+            value, env);
+        AXIS2_INTF_TO_IMPL(extensible_attribute)->value = NULL;
+    }
+    
+    AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(extensible_attribute));
+    
+	return AXIS2_SUCCESS;
+}
+
+axis2_qname_t *AXIS2_CALL
+axis2_wsdl_extensible_attribute_get_key(
+                            axis2_wsdl_extensible_attribute_t *extensible_attribute,
+                            axis2_env_t **env) 
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(extensible_attribute)->key;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_extensible_attribute_set_key(
+                            axis2_wsdl_extensible_attribute_t *extensible_attribute,
+                            axis2_env_t **env,
+                            axis2_qname_t *key) 
+{
+    axis2_wsdl_extensible_attribute_impl_t *extensible_attribute_impl = 
+        AXIS2_INTF_TO_IMPL(extensible_attribute);
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, key, AXIS2_FAILURE);
+    
+    if(extensible_attribute_impl->key)
+    {
+        AXIS2_QNAME_FREE(extensible_attribute_impl->key, env);
+        extensible_attribute_impl->key = NULL;
+    }
+    
+    extensible_attribute_impl->key = AXIS2_QNAME_CLONE(key, env);
+    if(!extensible_attribute_impl->key)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_qname_t *AXIS2_CALL
+axis2_wsdl_extensible_attribute_get_value(
+                            axis2_wsdl_extensible_attribute_t *extensible_attribute,
+                            axis2_env_t **env) 
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(extensible_attribute)->value;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_extensible_attribute_set_value(
+                            axis2_wsdl_extensible_attribute_t *extensible_attribute,
+                            axis2_env_t **env,
+                            axis2_qname_t *value) 
+{
+    axis2_wsdl_extensible_attribute_impl_t *extensible_attribute_impl = 
+        AXIS2_INTF_TO_IMPL(extensible_attribute);
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, value, AXIS2_FAILURE);
+    
+    if(extensible_attribute_impl->value)
+    {
+        AXIS2_QNAME_FREE(extensible_attribute_impl->value, env);
+        extensible_attribute_impl->value = NULL;
+    }
+    
+    extensible_attribute_impl->value = AXIS2_QNAME_CLONE(value, env);
+    if(!extensible_attribute_impl->value)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}

Modified: webservices/axis2/trunk/c/modules/wsdl/wsdl_extensible_element.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/wsdl_extensible_element.c?rev=386001&r1=386000&r2=386001&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/wsdl_extensible_element.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/wsdl_extensible_element.c Wed Mar 15 00:43:05 2006
@@ -182,6 +182,11 @@
         extensible_element_impl->type = NULL;
     }
     
-    extensible_element_impl->type = type;
+    extensible_element_impl->type = AXIS2_QNAME_CLONE(type, env);
+    if(!extensible_element_impl->type)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    } 
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/modules/wsdl/wsdl_feature.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/wsdl_feature.c?rev=386001&r1=386000&r2=386001&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/wsdl_feature.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/wsdl_feature.c Wed Mar 15 00:43:05 2006
@@ -167,7 +167,12 @@
         AXIS2_FREE((*env)->allocator, feature_impl->name);
         feature_impl->name = NULL;
     }
-    feature_impl->name = name;
+    feature_impl->name = AXIS2_STRDUP(name, env);
+    if(!feature_impl->name)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
     return AXIS2_SUCCESS;
 }
 

Added: webservices/axis2/trunk/c/modules/wsdl/wsdl_import.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/wsdl_import.c?rev=386001&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/wsdl_import.c (added)
+++ webservices/axis2/trunk/c/modules/wsdl/wsdl_import.c Wed Mar 15 00:43:05 2006
@@ -0,0 +1,217 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+#include <axis2_wsdl_import.h>
+
+/** 
+ * @brief Wsdl import struct impl
+ *	Wsdl imports  
+ */ 
+typedef struct axis2_wsdl_import_impl
+{
+	axis2_wsdl_import_t wsdl_import;
+    
+    axis2_char_t *location;
+    axis2_char_t *namespace;	
+} axis2_wsdl_import_impl_t;
+
+#define AXIS2_INTF_TO_IMPL(wsdl_import) \
+		((axis2_wsdl_import_impl_t *)wsdl_import)
+
+/************************* Function prototypes ********************************/
+
+axis2_status_t AXIS2_CALL
+	axis2_wsdl_import_free (axis2_wsdl_import_t *wsdl_import,
+									axis2_env_t **env);
+
+axis2_char_t *AXIS2_CALL
+axis2_wsdl_import_get_namespace(axis2_wsdl_import_t *wsdl_import,
+                                axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_import_set_namespace(axis2_wsdl_import_t *wsdl_import,
+                                axis2_env_t **env,
+                                axis2_char_t *namespace);
+
+axis2_char_t *AXIS2_CALL
+axis2_wsdl_import_get_location(axis2_wsdl_import_t *wsdl_import,
+                                axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_import_set_location(axis2_wsdl_import_t *wsdl_import,
+                                axis2_env_t **env,
+                                axis2_char_t *location);
+                                
+/************************** End of function prototypes ************************/
+
+axis2_wsdl_import_t * AXIS2_CALL 
+axis2_wsdl_import_create (axis2_env_t **env)
+{
+    axis2_wsdl_import_impl_t *wsdl_import_impl = NULL;
+    
+	AXIS2_ENV_CHECK(env, NULL);
+	
+	wsdl_import_impl = (axis2_wsdl_import_impl_t *) AXIS2_MALLOC((*env)->allocator,
+			sizeof(axis2_wsdl_import_impl_t));
+	
+	
+	if(NULL == wsdl_import_impl)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); 
+        return NULL;
+    }
+    
+    wsdl_import_impl->namespace = NULL;
+    wsdl_import_impl->location = NULL;
+    wsdl_import_impl->wsdl_import.ops = NULL;
+    wsdl_import_impl->wsdl_import.wsdl_component = NULL;
+	
+    wsdl_import_impl->wsdl_import.wsdl_component = axis2_wsdl_component_create(env);
+    if(NULL == wsdl_import_impl->wsdl_import.wsdl_component)
+    {
+        axis2_wsdl_import_free(&(wsdl_import_impl->wsdl_import), env);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }    
+    
+	wsdl_import_impl->wsdl_import.ops = 
+		AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_wsdl_import_ops_t));
+	if(NULL == wsdl_import_impl->wsdl_import.ops)
+    {
+        axis2_wsdl_import_free(&(wsdl_import_impl->wsdl_import), env);
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    
+	wsdl_import_impl->wsdl_import.ops->free =  axis2_wsdl_import_free;
+	wsdl_import_impl->wsdl_import.ops->get_namespace = 
+        axis2_wsdl_import_get_namespace;
+    wsdl_import_impl->wsdl_import.ops->set_namespace = 
+        axis2_wsdl_import_set_namespace;
+	wsdl_import_impl->wsdl_import.ops->get_location = 
+        axis2_wsdl_import_get_location;
+    wsdl_import_impl->wsdl_import.ops->set_location = 
+        axis2_wsdl_import_set_location;
+	
+	return &(wsdl_import_impl->wsdl_import);
+}
+
+/***************************Function implementation****************************/
+
+axis2_status_t AXIS2_CALL 
+axis2_wsdl_import_free (axis2_wsdl_import_t *wsdl_import, 
+                            axis2_env_t **env)
+{
+    axis2_wsdl_import_impl_t *import_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    import_impl = AXIS2_INTF_TO_IMPL(wsdl_import);
+    
+	if(NULL != wsdl_import->ops)
+        AXIS2_FREE((*env)->allocator, wsdl_import->ops);
+    
+    if(NULL != import_impl->namespace)
+    {
+        AXIS2_FREE((*env)->allocator, import_impl->namespace);
+        import_impl->namespace = NULL;
+    }
+
+    if(NULL != import_impl->location)
+    {
+        AXIS2_FREE((*env)->allocator, import_impl->location);
+        import_impl->location = NULL;
+    }
+    
+    if(NULL != wsdl_import->wsdl_component)
+    {
+        AXIS2_WSDL_COMPONENT_FREE(wsdl_import->wsdl_component, env);
+        wsdl_import->wsdl_component = NULL;
+    }
+    
+    AXIS2_FREE((*env)->allocator, import_impl);
+    import_impl = NULL;
+    
+	return AXIS2_SUCCESS;
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_wsdl_import_get_namespace(axis2_wsdl_import_t *wsdl_import,
+                                axis2_env_t **env) 
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(wsdl_import)->namespace;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_import_set_namespace(axis2_wsdl_import_t *wsdl_import,
+                                axis2_env_t **env,
+                                axis2_char_t *namespace) 
+{
+    axis2_wsdl_import_impl_t *import_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, namespace, AXIS2_FAILURE);
+    
+    import_impl = AXIS2_INTF_TO_IMPL(wsdl_import);
+    
+    if(import_impl->namespace)
+    {
+        AXIS2_FREE((*env)->allocator, import_impl->namespace);
+        import_impl->namespace = NULL;
+    }
+    import_impl->namespace = AXIS2_STRDUP(namespace, env);
+    if(!import_impl->namespace)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_wsdl_import_get_location(axis2_wsdl_import_t *wsdl_import,
+                                axis2_env_t **env) 
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(wsdl_import)->location;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_import_set_location(axis2_wsdl_import_t *wsdl_import,
+                                axis2_env_t **env,
+                                axis2_char_t *location) 
+{
+    axis2_wsdl_import_impl_t *import_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, location, AXIS2_FAILURE);
+    
+    import_impl = AXIS2_INTF_TO_IMPL(wsdl_import);
+    
+    if(import_impl->location)
+    {
+        AXIS2_FREE((*env)->allocator, import_impl->location);
+        import_impl->location = NULL;
+    }
+    import_impl->location = AXIS2_STRDUP(location, env);
+    if(!import_impl->location)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}

Added: webservices/axis2/trunk/c/modules/wsdl/wsdl_include.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/wsdl_include.c?rev=386001&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/wsdl_include.c (added)
+++ webservices/axis2/trunk/c/modules/wsdl/wsdl_include.c Wed Mar 15 00:43:05 2006
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+#include <axis2_wsdl_include.h>
+
+/** 
+ * @brief Wsdl Include struct impl
+ *	Wsdl Includes  
+ */ 
+typedef struct axis2_wsdl_include_impl
+{
+	axis2_wsdl_include_t wsdl_include;
+    
+    axis2_char_t *location;
+} axis2_wsdl_include_impl_t;
+
+#define AXIS2_INTF_TO_IMPL(wsdl_include) \
+		((axis2_wsdl_include_impl_t *)wsdl_include)
+
+/************************* Function prototypes ********************************/
+
+axis2_status_t AXIS2_CALL
+	axis2_wsdl_include_free (axis2_wsdl_include_t *wsdl_include,
+									axis2_env_t **env);
+
+axis2_char_t *AXIS2_CALL
+axis2_wsdl_include_get_location(axis2_wsdl_include_t *wsdl_include,
+                                axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_include_set_location(axis2_wsdl_include_t *wsdl_include,
+                                axis2_env_t **env,
+                                axis2_char_t *location);
+                                
+/************************** End of function prototypes ************************/
+
+axis2_wsdl_include_t * AXIS2_CALL 
+axis2_wsdl_include_create (axis2_env_t **env)
+{
+    axis2_wsdl_include_impl_t *wsdl_include_impl = NULL;
+    
+	AXIS2_ENV_CHECK(env, NULL);
+	
+	wsdl_include_impl = (axis2_wsdl_include_impl_t *) AXIS2_MALLOC((*env)->allocator,
+			sizeof(axis2_wsdl_include_impl_t));
+	
+	
+	if(NULL == wsdl_include_impl)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); 
+        return NULL;
+    }
+    
+    wsdl_include_impl->location = NULL;
+    wsdl_include_impl->wsdl_include.ops = NULL;
+    wsdl_include_impl->wsdl_include.wsdl_component = NULL;
+	
+    wsdl_include_impl->wsdl_include.wsdl_component = axis2_wsdl_component_create(env);
+    if(NULL == wsdl_include_impl->wsdl_include.wsdl_component)
+    {
+        axis2_wsdl_include_free(&(wsdl_include_impl->wsdl_include), env);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }    
+    
+	wsdl_include_impl->wsdl_include.ops = 
+		AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_wsdl_include_ops_t));
+	if(NULL == wsdl_include_impl->wsdl_include.ops)
+    {
+        axis2_wsdl_include_free(&(wsdl_include_impl->wsdl_include), env);
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    
+	wsdl_include_impl->wsdl_include.ops->free =  axis2_wsdl_include_free;
+	wsdl_include_impl->wsdl_include.ops->get_location = 
+        axis2_wsdl_include_get_location;
+    wsdl_include_impl->wsdl_include.ops->set_location = 
+        axis2_wsdl_include_set_location;
+	
+	return &(wsdl_include_impl->wsdl_include);
+}
+
+/***************************Function implementation****************************/
+
+axis2_status_t AXIS2_CALL 
+axis2_wsdl_include_free (axis2_wsdl_include_t *wsdl_include, 
+                            axis2_env_t **env)
+{
+    axis2_wsdl_include_impl_t *include_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    include_impl = AXIS2_INTF_TO_IMPL(wsdl_include);
+    
+	if(NULL != wsdl_include->ops)
+        AXIS2_FREE((*env)->allocator, wsdl_include->ops);
+
+    if(NULL != include_impl->location)
+    {
+        AXIS2_FREE((*env)->allocator, include_impl->location);
+        include_impl->location = NULL;
+    }
+    
+    if(NULL != wsdl_include->wsdl_component)
+    {
+        AXIS2_WSDL_COMPONENT_FREE(wsdl_include->wsdl_component, env);
+        wsdl_include->wsdl_component = NULL;
+    }
+    
+    AXIS2_FREE((*env)->allocator, include_impl);
+    include_impl = NULL;
+    
+	return AXIS2_SUCCESS;
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_wsdl_include_get_location(axis2_wsdl_include_t *wsdl_include,
+                                axis2_env_t **env) 
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(wsdl_include)->location;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_include_set_location(axis2_wsdl_include_t *wsdl_include,
+                                axis2_env_t **env,
+                                axis2_char_t *location) 
+{
+    axis2_wsdl_include_impl_t *include_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, location, AXIS2_FAILURE);
+    
+    include_impl = AXIS2_INTF_TO_IMPL(wsdl_include);
+    
+    if(include_impl->location)
+    {
+        AXIS2_FREE((*env)->allocator, include_impl->location);
+        include_impl->location = NULL;
+    }
+    include_impl->location = AXIS2_STRDUP(location, env);
+    if(!include_impl->location)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}

Added: webservices/axis2/trunk/c/modules/wsdl/wsdl_types.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/wsdl_types.c?rev=386001&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/wsdl_types.c (added)
+++ webservices/axis2/trunk/c/modules/wsdl/wsdl_types.c Wed Mar 15 00:43:05 2006
@@ -0,0 +1,193 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+#include <axis2_wsdl_types.h>
+#include <axis2_wsdl_extensible_element.h>
+#include <axis2_wsdl_extensible_component.h>
+
+/** 
+ * @brief Wsdl Types struct impl
+ *	Axis2 Wsdl Types Implementation 
+ */ 
+typedef struct axis2_wsdl_types_impl
+{
+	axis2_wsdl_types_t wsdl_types;
+    
+} axis2_wsdl_types_impl_t;
+
+#define AXIS2_INTF_TO_IMPL(wsdl_types) ((axis2_wsdl_types_impl_t *)wsdl_types)
+	
+/*************************** Function headers *********************************/
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_types_free (axis2_wsdl_types_t *wsdl_types, 
+                        axis2_env_t **env);	
+
+/**
+ * Adds the <code>ExtensionElement</code> to the map keyed with the 
+ * <code>axis2_qname_t</code>
+ *
+ * @param element
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_types_add_element(axis2_wsdl_types_t *wsdl_types,
+                                axis2_env_t **env,
+                                axis2_wsdl_extensible_element_t *element);
+
+
+/**
+ * Will return the first Element with the given <code>QName</code>
+ * Returns null if not found.
+ *
+ * @param qname
+ * @return
+ */
+axis2_wsdl_extensible_element_t *AXIS2_CALL
+axis2_wsdl_types_get_first_element(axis2_wsdl_types_t *wsdl_types,
+                                    axis2_env_t **env,
+                                    axis2_qname_t *qname);
+
+/************************* End of function headers ****************************/	
+
+axis2_wsdl_types_t * AXIS2_CALL
+axis2_wsdl_types_create (axis2_env_t **env)
+{
+    axis2_wsdl_types_impl_t *wsdl_types_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    
+	wsdl_types_impl = (axis2_wsdl_types_impl_t *) AXIS2_MALLOC ((*env)->
+        allocator, sizeof (axis2_wsdl_types_impl_t));
+     
+	if(NULL == wsdl_types_impl)
+	{
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+	}
+    
+    wsdl_types_impl->wsdl_types.ops = NULL;
+    
+    wsdl_types_impl->wsdl_types.ext_component = 
+        axis2_wsdl_extensible_component_create(env);
+    
+	if(NULL == wsdl_types_impl->wsdl_types.ext_component)
+	{
+        axis2_wsdl_types_free(&(wsdl_types_impl->wsdl_types), env);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;        
+	}    
+    
+    wsdl_types_impl->wsdl_types.ops = AXIS2_MALLOC((*env)->allocator, 
+        sizeof(axis2_wsdl_types_ops_t));
+	if(NULL == wsdl_types_impl->wsdl_types.ops)
+	{
+        axis2_wsdl_types_free(&(wsdl_types_impl->wsdl_types), env);
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+	}
+	
+	wsdl_types_impl->wsdl_types.ops->free = axis2_wsdl_types_free;
+    wsdl_types_impl->wsdl_types.ops->add_element = axis2_wsdl_types_add_element;
+    wsdl_types_impl->wsdl_types.ops->get_first_element = 
+            axis2_wsdl_types_get_first_element;
+	return &(wsdl_types_impl->wsdl_types);
+}
+
+/*************************Function implementations*****************************/
+
+axis2_status_t AXIS2_CALL 
+axis2_wsdl_types_free (
+                        axis2_wsdl_types_t *wsdl_types, 
+                        axis2_env_t **env)
+{
+    axis2_wsdl_types_impl_t *wsdl_types_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE); 
+    wsdl_types_impl = AXIS2_INTF_TO_IMPL(wsdl_types);
+    
+	if(wsdl_types->ops)
+    {
+        AXIS2_FREE((*env)->allocator, wsdl_types->ops);
+        wsdl_types->ops = NULL;
+    }
+    
+    if(wsdl_types->ext_component)
+    {
+        AXIS2_WSDL_COMPONENT_FREE(wsdl_types->ext_component, env);
+        wsdl_types->ext_component = NULL;
+    }
+    
+    if(wsdl_types_impl)
+        AXIS2_FREE((*env)->allocator, wsdl_types_impl);
+    wsdl_types_impl = NULL;
+    
+	return AXIS2_SUCCESS;
+}
+
+
+/**
+ * Adds the <code>ExtensionElement</code> to the map keyed with the 
+ * <code>axis2_qname_t</code>
+ *
+ * @param element
+ */
+axis2_status_t AXIS2_CALL
+axis2_wsdl_types_add_element(axis2_wsdl_types_t *wsdl_types,
+                                axis2_env_t **env,
+                                axis2_wsdl_extensible_element_t *element)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, element, AXIS2_FAILURE); 
+
+    return AXIS2_WSDL_COMPONENT_ADD_EXTENSIBILITY_ELEMENT(wsdl_types->
+        ext_component->wsdl_component, env, element);
+}
+
+/**
+ * Will return the first Element with the given <code>QName</code>
+ * Returns null if not found.
+ *
+ * @param qname
+ * @return
+ */
+axis2_wsdl_extensible_element_t *AXIS2_CALL
+axis2_wsdl_types_get_first_element(axis2_wsdl_types_t *wsdl_types,
+                                    axis2_env_t **env,
+                                    axis2_qname_t *qname)
+{
+    axis2_linked_list_t *ext_elements = NULL;
+    int i = 0;
+    int size = 0;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, qname, NULL);
+    
+    ext_elements = AXIS2_WSDL_COMPONENT_GET_EXTENSIBILITY_ELEMENTS(wsdl_types->
+        ext_component->wsdl_component, env);
+    size = AXIS2_LINKED_LIST_SIZE(ext_elements, env);
+    for(i = 0; i < size; i++)
+    {
+        axis2_wsdl_extensible_element_t *temp = NULL;
+        axis2_qname_t *qname_l = NULL;
+        temp = AXIS2_LINKED_LIST_GET(ext_elements, env, i);
+        qname_l = AXIS2_WSDL_EXTENSIBLE_ELEMENT_GET_TYPE(temp, env);
+        if(AXIS2_QNAME_EQUALS(qname, env, qname_l))
+        {
+            return temp;
+        }
+    }
+    return NULL;;
+}



Mime
View raw message