axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r356124 [3/3] - in /webservices/axis2/trunk/c/modules: core/description/src/ core/phaseresolver/src/ wsdl/src/
Date Mon, 12 Dec 2005 03:14:32 GMT
Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_feature.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_feature.c?rev=356124&r1=356123&r2=356124&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_feature.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_feature.c Sun Dec 11 19:13:55 2005
@@ -60,30 +60,40 @@
 axis2_wsdl_feature_t * AXIS2_CALL 
 axis2_wsdl_feature_create (axis2_env_t **env)
 {
+    axis2_wsdl_feature_impl_t *wsdl_feature_impl = NULL;
+    
 	AXIS2_ENV_CHECK(env, NULL);
 	
-	axis2_wsdl_feature_impl_t *wsdl_feature_impl = 
-		(axis2_wsdl_feature_impl_t *) AXIS2_MALLOC((*env)->allocator,
+	wsdl_feature_impl = (axis2_wsdl_feature_impl_t *) AXIS2_MALLOC((*env)->allocator,
 			sizeof(axis2_wsdl_feature_impl_t));
 	
 	
 	if(NULL == wsdl_feature_impl)
+    {
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL); 
+        return NULL;
+    }
+    
+    wsdl_feature_impl->name = NULL;
+    wsdl_feature_impl->required = AXIS2_FALSE;
+    wsdl_feature_impl->wsdl_feature.ops = NULL;
+    wsdl_feature_impl->wsdl_feature.wsdl_component = NULL;
 	
     wsdl_feature_impl->wsdl_feature.wsdl_component = axis2_wsdl_component_create(env);
     if(NULL == wsdl_feature_impl->wsdl_feature.wsdl_component)
     {
-        AXIS2_FREE((*env)->allocator, wsdl_feature_impl);
+        axis2_wsdl_feature_free(&(wsdl_feature_impl->wsdl_feature), env);
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+        return NULL;
     }    
     
 	wsdl_feature_impl->wsdl_feature.ops = 
 		AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_wsdl_feature_ops_t));
 	if(NULL == wsdl_feature_impl->wsdl_feature.ops)
     {
-        AXIS2_WSDL_FEATURE_FREE(wsdl_feature_impl->wsdl_feature.wsdl_component, env);
-        AXIS2_FREE((*env)->allocator, wsdl_feature_impl);
+        axis2_wsdl_feature_free(&(wsdl_feature_impl->wsdl_feature), env);
 		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+        return NULL;
     }
     
 	wsdl_feature_impl->wsdl_feature.ops->free =  axis2_wsdl_feature_free;
@@ -96,9 +106,6 @@
     wsdl_feature_impl->wsdl_feature.ops->set_required = 
         axis2_wsdl_feature_set_required;
 	
-	wsdl_feature_impl->name = NULL;
-    wsdl_feature_impl->required = AXIS2_FALSE;
-	
 	return &(wsdl_feature_impl->wsdl_feature);
 }
 
@@ -108,21 +115,29 @@
 axis2_wsdl_feature_free (axis2_wsdl_feature_t *wsdl_feature, 
                             axis2_env_t **env)
 {
+    axis2_wsdl_feature_impl_t *feature_impl = NULL;
+    
     AXIS2_FUNC_PARAM_CHECK(wsdl_feature, env, AXIS2_FAILURE);
+    
+    feature_impl = AXIS2_INTF_TO_IMPL(wsdl_feature);
+    
 	if(NULL != wsdl_feature->ops)
         AXIS2_FREE((*env)->allocator, wsdl_feature->ops);
     
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_feature)->name)
+    if(NULL != feature_impl->name)
     {
-        AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_feature)->name);
+        AXIS2_FREE((*env)->allocator, feature_impl->name);
+        feature_impl->name = NULL;
     }
     
     if(NULL != wsdl_feature->wsdl_component)
     {
         AXIS2_WSDL_COMPONENT_FREE(wsdl_feature->wsdl_component, env);
+        wsdl_feature->wsdl_component = NULL;
     }
     
-    AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_feature));
+    AXIS2_FREE((*env)->allocator, feature_impl);
+    feature_impl = NULL;
     
 	return AXIS2_SUCCESS;
 }
@@ -140,9 +155,19 @@
                                 axis2_env_t **env,
                                 axis2_char_t *name) 
 {
+    axis2_wsdl_feature_impl_t *feature_impl = NULL;
+    
     AXIS2_FUNC_PARAM_CHECK(wsdl_feature, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, name, AXIS2_FAILURE);
-    AXIS2_INTF_TO_IMPL(wsdl_feature)->name = name;
+    
+    feature_impl = AXIS2_INTF_TO_IMPL(wsdl_feature);
+    
+    if(feature_impl->name)
+    {
+        AXIS2_FREE((*env)->allocator, feature_impl->name);
+        feature_impl->name = NULL;
+    }
+    feature_impl->name = name;
     return AXIS2_SUCCESS;
 }
 

Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_interface.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_interface.c?rev=356124&r1=356123&r2=356124&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_interface.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_interface.c Sun Dec 11 19:13:55 2005
@@ -111,7 +111,8 @@
 axis2_status_t AXIS2_CALL
 axis2_wsdl_interface_set_operation(axis2_wsdl_interface_t *wsdl_interface,
                                     axis2_env_t **env,
-                                    void *operation);
+                                    void *operation,
+                                    axis2_operation_type_t opt_type);
 
 axis2_status_t AXIS2_CALL
 axis2_wsdl_interface_set_super_interfaces(axis2_wsdl_interface_t *wsdl_interface,
@@ -258,44 +259,70 @@
                         axis2_wsdl_interface_t *wsdl_interface, 
                         axis2_env_t **env)
 {
+    axis2_wsdl_interface_impl_t *wsdl_interface_impl = NULL;
+    
     AXIS2_FUNC_PARAM_CHECK(wsdl_interface, env, AXIS2_FAILURE);
+    
+    wsdl_interface_impl = AXIS2_INTF_TO_IMPL(wsdl_interface);
+    
 	if(NULL != wsdl_interface->ops)
         AXIS2_FREE((*env)->allocator, wsdl_interface->ops);
     
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_interface)->super_interfaces)
+    if(NULL != wsdl_interface_impl->super_interfaces)
     {
-        axis2_hash_free(AXIS2_INTF_TO_IMPL(wsdl_interface)->
-            super_interfaces, env);
+        axis2_hash_free(wsdl_interface_impl->super_interfaces, env);
     }
     
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_interface)->operations)
+    if(NULL != wsdl_interface_impl->operations)
     {
-        axis2_hash_free(AXIS2_INTF_TO_IMPL(wsdl_interface)->
-            operations, env);
+        axis2_hash_index_t *hi = NULL;
+        void *val = NULL;
+        for (hi = axis2_hash_first (wsdl_interface_impl->operations, env); hi;
+                 hi = axis2_hash_next ( env, hi))
+        {
+            struct axis2_wsdl_operation *wsdl_optr = NULL;
+            struct axis2_operation *optr = NULL;
+            axis2_hash_this (hi, NULL, NULL, &val);
+            if(AXIS2_OPERATION == wsdl_interface->optr_type)
+            {
+                optr = (struct axis2_operation *) val;
+                AXIS2_OPERATION_FREE (optr, env);
+            }
+            if(AXIS2_WSDL_OPERATION == wsdl_interface->optr_type)
+            {
+                wsdl_optr = (struct axis2_wsdl_operation *) val;
+                AXIS2_WSDL_OPERATION_FREE(wsdl_optr, env);
+            }
+            
+            val = NULL;
+            optr = NULL;
+            wsdl_optr = NULL;
+               
+        }
+        axis2_hash_free(wsdl_interface_impl->operations, env);
+        wsdl_interface_impl->operations = NULL;
     }
     
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_interface)->faults)
+    if(NULL != wsdl_interface_impl->faults)
     {
-        AXIS2_LINKED_LIST_FREE(AXIS2_INTF_TO_IMPL(wsdl_interface)->
-            faults, env);
+        AXIS2_LINKED_LIST_FREE(wsdl_interface_impl->faults, env);
     }
     
     if(NULL != AXIS2_INTF_TO_IMPL(wsdl_interface)->qname)
     {
-        AXIS2_QNAME_FREE(AXIS2_INTF_TO_IMPL(wsdl_interface)->qname, env);
+        AXIS2_QNAME_FREE(wsdl_interface_impl->qname, env);
     }
     
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_interface)->style_default)
+    if(NULL != wsdl_interface_impl->style_default)
     {
-        AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_interface)->
-            style_default);
+        AXIS2_FREE((*env)->allocator, wsdl_interface_impl->style_default);
     }
     
     if(NULL != wsdl_interface->extensible_component)
         AXIS2_WSDL_EXTENSIBLE_COMPONENT_FREE(wsdl_interface->
             extensible_component, env);
     
-    AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_interface));
+    AXIS2_FREE((*env)->allocator, wsdl_interface_impl);
     
 	return AXIS2_SUCCESS;
 }
@@ -390,21 +417,31 @@
 axis2_status_t AXIS2_CALL
 axis2_wsdl_interface_set_operation(axis2_wsdl_interface_t *wsdl_interface,
                                     axis2_env_t **env,
-                                    void *operation) 
+                                    void *operation,
+                                    axis2_operation_type_t optr_type) 
 {
     struct axis2_operation *operation_l = NULL;
+    axis2_qname_t *wsdl_opt_name = NULL;
+    axis2_char_t *op_name = NULL;
+        
+    AXIS2_FUNC_PARAM_CHECK(wsdl_interface, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, operation, AXIS2_FAILURE);
+    
     operation_l = (struct axis2_operation *) operation;
-    if (NULL == AXIS2_WSDL_OPERATION_GET_NAME(operation_l->wsdl_operation, env)) 
+    wsdl_opt_name = AXIS2_WSDL_OPERATION_GET_NAME(operation_l->wsdl_operation, env); 
  
+    if (!wsdl_opt_name) 
     {
         /* The Operation name cannot be null (required) */
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_INVALID_STATE_WSDL_OPERATION, 
             AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    axis2_char_t *op_name = AXIS2_QNAME_GET_LOCALPART(AXIS2_WSDL_OPERATION_GET_NAME(
-        operation_l->wsdl_operation, env), env);
+    
+    op_name = AXIS2_QNAME_GET_LOCALPART(wsdl_opt_name, env);
+    
     axis2_hash_set(AXIS2_INTF_TO_IMPL(wsdl_interface)->operations, op_name,  
         AXIS2_HASH_KEY_STRING, operation);
+    wsdl_interface->optr_type = optr_type;
     
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_operation.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_operation.c?rev=356124&r1=356123&r2=356124&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_operation.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_operation.c Sun Dec 11 19:13:55 2005
@@ -79,7 +79,7 @@
 axis2_wsdl_operation_set_msg_exchange_pattern (
 		                                axis2_wsdl_operation_t *wsdl_operation,
                                         axis2_env_t **env,
-                                        const axis2_char_t *msg_exchange_pattern);
+                                        axis2_char_t *msg_exchange_pattern);
 
 axis2_char_t * AXIS2_CALL 
 axis2_wsdl_operation_get_msg_exchange_pattern 
@@ -169,37 +169,48 @@
 axis2_wsdl_operation_t * AXIS2_CALL 
 axis2_wsdl_operation_create (axis2_env_t **env)
 {
-	axis2_wsdl_operation_impl_t *wsdl_operation_impl = 
-        (axis2_wsdl_operation_impl_t *) AXIS2_MALLOC ((*env)->allocator, 
-        sizeof(axis2_wsdl_operation_impl_t));
+    axis2_wsdl_operation_impl_t *wsdl_operation_impl = NULL;
+    
+	wsdl_operation_impl = (axis2_wsdl_operation_impl_t *) AXIS2_MALLOC ((*env)->
+        allocator, sizeof(axis2_wsdl_operation_impl_t));
     
 	if(!wsdl_operation_impl)
 	{
 		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
 	}
     
+    wsdl_operation_impl->infaults = NULL;
+    wsdl_operation_impl->outfaults = NULL;
+    wsdl_operation_impl->wsdl_operation.extensible_component = NULL;
+    wsdl_operation_impl->msg_exchange_pattern = NULL;
+	wsdl_operation_impl->style = STYLE_DOC;
+	wsdl_operation_impl->name = NULL;
+    wsdl_operation_impl->input_msg = NULL;
+    wsdl_operation_impl->output_msg = NULL;
+    wsdl_operation_impl->safety = AXIS2_FALSE;
+    
     wsdl_operation_impl->infaults = axis2_linked_list_create(env);
     if(NULL == wsdl_operation_impl->infaults)
     {
-        AXIS2_FREE((*env)->allocator, wsdl_operation_impl);
+        axis2_wsdl_operation_free(&(wsdl_operation_impl->wsdl_operation), env);
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+        return NULL;
 	}
     
     wsdl_operation_impl->outfaults = axis2_linked_list_create(env);
     if(NULL == wsdl_operation_impl->outfaults)
     {
-        AXIS2_LINKED_LIST_FREE(wsdl_operation_impl->infaults, env);
-        AXIS2_FREE((*env)->allocator, wsdl_operation_impl);
+        axis2_wsdl_operation_free(&(wsdl_operation_impl->wsdl_operation), env);
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+        return NULL;
 	}
     
     wsdl_operation_impl->wsdl_operation.extensible_component = axis2_wsdl_extensible_component_create(env);
     if(NULL == wsdl_operation_impl->wsdl_operation.extensible_component)
     {
-        AXIS2_LINKED_LIST_FREE(wsdl_operation_impl->infaults, env);
-        AXIS2_LINKED_LIST_FREE(wsdl_operation_impl->outfaults, env);
-        AXIS2_FREE((*env)->allocator, wsdl_operation_impl);
+        axis2_wsdl_operation_free(&(wsdl_operation_impl->wsdl_operation), env);
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+        return NULL;
 	}
     
 	wsdl_operation_impl->wsdl_operation.ops = (axis2_wsdl_operation_ops_t *)
@@ -207,11 +218,9 @@
     
 	if(NULL == wsdl_operation_impl->wsdl_operation.ops)
 	{
-        AXIS2_WSDL_COMPONENT_FREE(wsdl_operation_impl->wsdl_operation.extensible_component,
env);
-        AXIS2_LINKED_LIST_FREE(wsdl_operation_impl->infaults, env);
-        AXIS2_LINKED_LIST_FREE(wsdl_operation_impl->outfaults, env);
-        AXIS2_FREE((*env)->allocator, wsdl_operation_impl);
+        axis2_wsdl_operation_free(&(wsdl_operation_impl->wsdl_operation), env);
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+        return NULL;
 	}
     
 	wsdl_operation_impl->wsdl_operation.ops->free = axis2_wsdl_operation_free;
@@ -272,13 +281,6 @@
         
     wsdl_operation_impl->wsdl_operation.ops->add_outfault = 
         axis2_wsdl_operation_add_outfault;
-
-	wsdl_operation_impl->msg_exchange_pattern = NULL;
-	wsdl_operation_impl->style = STYLE_DOC;
-	wsdl_operation_impl->name = NULL;
-    wsdl_operation_impl->input_msg = NULL;
-    wsdl_operation_impl->output_msg = NULL;
-    wsdl_operation_impl->safety = AXIS2_FALSE;
 	
 	return &(wsdl_operation_impl->wsdl_operation);	
 }
@@ -289,44 +291,82 @@
 axis2_wsdl_operation_free (axis2_wsdl_operation_t *wsdl_operation,
                             axis2_env_t **env)
 {
+    axis2_wsdl_operation_impl_t *wsdl_operation_impl = NULL;
+    
 	AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, AXIS2_FAILURE);
     
+    wsdl_operation_impl = AXIS2_INTF_TO_IMPL(wsdl_operation);
+    
     if(NULL != wsdl_operation->ops)
+    {
         AXIS2_FREE((*env)->allocator, wsdl_operation->ops);
+        wsdl_operation->ops = NULL;
+    }
     
     if(NULL != wsdl_operation->extensible_component)
-        AXIS2_WSDL_COMPONENT_FREE(wsdl_operation->extensible_component, env);
-    
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_operation)->input_msg)
-        AXIS2_WSDL_MSG_REF_FREE(AXIS2_INTF_TO_IMPL(wsdl_operation)->
-            input_msg, env);
-    
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_operation)->output_msg)
-        AXIS2_WSDL_MSG_REF_FREE(AXIS2_INTF_TO_IMPL(wsdl_operation)->
-            output_msg, env);
-    
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_operation)->infaults)
-        AXIS2_LINKED_LIST_FREE(AXIS2_INTF_TO_IMPL(wsdl_operation)->
-            infaults, env);
-    
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_operation)->outfaults)
-        AXIS2_LINKED_LIST_FREE(AXIS2_INTF_TO_IMPL(wsdl_operation)->
-            outfaults, env);
-    
+    {
+        AXIS2_WSDL_EXTENSIBLE_COMPONENT_FREE(wsdl_operation->extensible_component, env);
+        wsdl_operation->extensible_component = NULL;
+    }
     
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_operation)->msg_exchange_pattern)
-        AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_operation)->
-            msg_exchange_pattern);
+    if(NULL != wsdl_operation_impl->infaults)
+    {
+        void *val = NULL;
+        int i = 0;
+        for (i = 0; i < AXIS2_LINKED_LIST_SIZE(wsdl_operation_impl->infaults, env);
i++)
+        {
+            struct axis2_wsdl_fault_ref *fault = NULL;
+            fault = AXIS2_LINKED_LIST_GET(wsdl_operation_impl->infaults, env, i);
+            
+            fault = (struct axis2_wsdl_fault_ref *) val;
+            if (fault)
+               AXIS2_PHASE_FREE (fault, env);
+            
+            val = NULL;
+            fault = NULL;
+               
+        }
+        AXIS2_LINKED_LIST_FREE(wsdl_operation_impl->infaults, env);
+        wsdl_operation_impl->infaults = NULL;
+    }
     
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_operation)->name)
-        AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_operation)->
-            name);
+    if(NULL != wsdl_operation_impl->outfaults)
+    {
+        void *val = NULL;
+        int i = 0;
+        for (i = 0; i < AXIS2_LINKED_LIST_SIZE(wsdl_operation_impl->outfaults, env);
i++)
+        {
+            struct axis2_wsdl_fault_ref *fault = NULL;
+            fault = AXIS2_LINKED_LIST_GET(wsdl_operation_impl->outfaults, env, i);
+            
+            fault = (struct axis2_wsdl_fault_ref *) val;
+            if (fault)
+               AXIS2_PHASE_FREE (fault, env);
+            
+            val = NULL;
+            fault = NULL;
+               
+        }
+        AXIS2_LINKED_LIST_FREE(wsdl_operation_impl->outfaults, env);
+        wsdl_operation_impl->outfaults = NULL;
+    }
     
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_operation)->style)
-        AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_operation)->
-            style);
+    if(NULL != wsdl_operation_impl->name)
+    {
+        AXIS2_FREE((*env)->allocator, wsdl_operation_impl->name);
+        wsdl_operation_impl->name = NULL;
+    }
     
-    AXIS2_FREE((*env)->allocator, wsdl_operation);
+    if(NULL != wsdl_operation_impl->style)
+    {
+        AXIS2_FREE((*env)->allocator, wsdl_operation_impl->style);
+        wsdl_operation_impl->style = NULL;
+    }
+    if(wsdl_operation_impl)
+    {
+        AXIS2_FREE((*env)->allocator, wsdl_operation_impl);
+        wsdl_operation_impl = NULL;
+    }
 	return AXIS2_SUCCESS;
 }
 
@@ -334,7 +374,7 @@
 axis2_wsdl_operation_set_msg_exchange_pattern (
 		                                axis2_wsdl_operation_t *wsdl_operation, 
                                         axis2_env_t **env, 
-		                                const axis2_char_t *msg_exchange_pattern)
+		                                axis2_char_t *msg_exchange_pattern)
 {
     AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, msg_exchange_pattern, AXIS2_FAILURE);
@@ -363,10 +403,23 @@
                                 axis2_env_t **env,
 		                        axis2_qname_t *name)
 {
+    axis2_wsdl_operation_impl_t *wsdl_operation_impl = NULL;
+    
     AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, name, AXIS2_FAILURE);
-    	
-	AXIS2_INTF_TO_IMPL(wsdl_operation)->name = name;
+    
+    wsdl_operation_impl = AXIS2_INTF_TO_IMPL(wsdl_operation);
+	
+    if(wsdl_operation_impl->name)
+    {
+        AXIS2_FREE((*env)->allocator, wsdl_operation_impl->name);
+        wsdl_operation_impl->name = NULL;
+    }
+	wsdl_operation_impl->name = AXIS2_STRDUP(name, env);
+    if(!wsdl_operation_impl->name)
+    {
+        return AXIS2_FAILURE;
+    }
     
 	return AXIS2_SUCCESS;
 }
@@ -386,10 +439,19 @@
                                     axis2_env_t **env,
 		                            axis2_char_t *style)
 {
+    axis2_wsdl_operation_impl_t *wsdl_operation_impl = NULL;
+    
     AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, style, AXIS2_FAILURE);
     
-	AXIS2_INTF_TO_IMPL(wsdl_operation)->style = style;
+    wsdl_operation_impl = AXIS2_INTF_TO_IMPL(wsdl_operation);
+    
+    if(wsdl_operation_impl->style)
+    {
+        AXIS2_FREE((*env)->allocator, wsdl_operation_impl->style);
+        wsdl_operation_impl->style = NULL;
+    }
+	wsdl_operation_impl->style = style;
 	
 	return AXIS2_SUCCESS;		
 }
@@ -415,6 +477,31 @@
                                     axis2_env_t **env,
                                     axis2_linked_list_t *infaults) 
 {
+    axis2_wsdl_operation_impl_t *wsdl_operation_impl = NULL;
+    
+    AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, infaults, AXIS2_FAILURE);
+    
+    wsdl_operation_impl = AXIS2_INTF_TO_IMPL(wsdl_operation);
+    
+    if(wsdl_operation_impl->infaults)
+    {
+        void *val = NULL;
+        int i = 0;
+        for (i = 0; i < AXIS2_LINKED_LIST_SIZE(wsdl_operation_impl->infaults, env);
i++)
+        {
+            struct axis2_wsdl_fault_ref *fault = NULL;
+            fault = AXIS2_LINKED_LIST_GET(wsdl_operation_impl->infaults, env, i);
+            
+            fault = (struct axis2_wsdl_fault_ref *) val;
+            if (fault)
+               AXIS2_PHASE_FREE (fault, env);
+            
+            val = NULL;
+            fault = NULL;
+               
+        }
+    }
     AXIS2_INTF_TO_IMPL(wsdl_operation)->infaults = infaults;
     return AXIS2_SUCCESS;
 }
@@ -431,7 +518,20 @@
                                     axis2_env_t **env,
                                     axis2_wsdl_msg_ref_t *input_msg) 
 {
-    AXIS2_INTF_TO_IMPL(wsdl_operation)->input_msg = input_msg;
+    axis2_wsdl_operation_impl_t *wsdl_operation_impl = NULL;
+    
+    AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, env, AXIS2_FAILURE);
+    
+    wsdl_operation_impl = AXIS2_INTF_TO_IMPL(wsdl_operation);
+    
+    if(wsdl_operation_impl->input_msg)
+    {
+        AXIS2_WSDL_MSG_REF_FREE(wsdl_operation_impl->input_msg, env);
+        wsdl_operation_impl->input_msg = NULL;
+    }
+    wsdl_operation_impl->input_msg = input_msg;
+    
     return AXIS2_SUCCESS;
 }
 
@@ -439,6 +539,8 @@
 axis2_wsdl_operation_get_outfaults(axis2_wsdl_operation_t *wsdl_operation,
                                     axis2_env_t **env) 
 {
+    AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, NULL);
+    
     return AXIS2_INTF_TO_IMPL(wsdl_operation)->outfaults;
 }
 
@@ -447,6 +549,31 @@
                                     axis2_env_t **env,
                                     axis2_linked_list_t *outfaults) 
 {
+    axis2_wsdl_operation_impl_t *wsdl_operation_impl = NULL;
+    
+    AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, outfaults, AXIS2_FAILURE);
+    
+    wsdl_operation_impl = AXIS2_INTF_TO_IMPL(wsdl_operation);
+    
+    if(wsdl_operation_impl->infaults)
+    {
+        void *val = NULL;
+        int i = 0;
+        for (i = 0; i < AXIS2_LINKED_LIST_SIZE(wsdl_operation_impl->outfaults, env);
i++)
+        {
+            struct axis2_wsdl_fault_ref *fault = NULL;
+            fault = AXIS2_LINKED_LIST_GET(wsdl_operation_impl->outfaults, env, i);
+            
+            fault = (struct axis2_wsdl_fault_ref *) val;
+            if (fault)
+               AXIS2_PHASE_FREE (fault, env);
+            
+            val = NULL;
+            fault = NULL;
+               
+        }
+    }
     AXIS2_INTF_TO_IMPL(wsdl_operation)->outfaults = outfaults;
     return AXIS2_SUCCESS;
 }
@@ -463,7 +590,19 @@
                                         axis2_env_t **env,
                                         axis2_wsdl_msg_ref_t *output_msg) 
 {
-    AXIS2_INTF_TO_IMPL(wsdl_operation)->output_msg = output_msg;
+    axis2_wsdl_operation_impl_t *wsdl_operation_impl = NULL;
+    
+    AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, output_msg, AXIS2_FAILURE);
+    
+    wsdl_operation_impl = AXIS2_INTF_TO_IMPL(wsdl_operation);
+    
+    if(wsdl_operation_impl->output_msg)
+    {
+        AXIS2_WSDL_MSG_REF_FREE(wsdl_operation_impl->output_msg, env);
+        wsdl_operation_impl->output_msg = NULL;
+    }
+    wsdl_operation_impl->output_msg = output_msg;
     return AXIS2_SUCCESS;
 }
 
@@ -487,11 +626,9 @@
 axis2_wsdl_operation_get_target_namespace(axis2_wsdl_operation_t *wsdl_operation,
                                             axis2_env_t **env) 
 {
-    if (NULL != AXIS2_INTF_TO_IMPL(wsdl_operation)->name) 
-    {
-        return AXIS2_QNAME_GET_URI(AXIS2_INTF_TO_IMPL(wsdl_operation)->name, env);
-    }
-    return NULL;
+    
+    return AXIS2_QNAME_GET_URI(AXIS2_INTF_TO_IMPL(wsdl_operation)->name, env);
+    
 }
 
 axis2_status_t AXIS2_CALL
@@ -499,12 +636,19 @@
                                     axis2_env_t **env,
                                     axis2_wsdl_fault_ref_t *infault) 
 {
+    AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, infault, AXIS2_FAILURE);
+    
     return AXIS2_LINKED_LIST_ADD(AXIS2_INTF_TO_IMPL(wsdl_operation)->infaults, env, infault);
 }
 
 axis2_status_t AXIS2_CALL
 axis2_wsdl_operation_add_outfault(axis2_wsdl_operation_t *wsdl_operation,
                                     axis2_env_t **env,
-                                    axis2_wsdl_fault_ref_t *outfault) {
+                                    axis2_wsdl_fault_ref_t *outfault) 
+{
+    AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, outfault, AXIS2_FAILURE);
+    
     return AXIS2_LINKED_LIST_ADD(AXIS2_INTF_TO_IMPL(wsdl_operation)->outfaults, env, outfault);
 }

Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_property.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_property.c?rev=356124&r1=356123&r2=356124&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_property.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_property.c Sun Dec 11 19:13:55 2005
@@ -70,30 +70,39 @@
 axis2_wsdl_property_t * AXIS2_CALL 
 axis2_wsdl_property_create (axis2_env_t **env)
 {
+    axis2_wsdl_property_impl_t *wsdl_property_impl = NULL;
 	AXIS2_ENV_CHECK(env, NULL);
 	
-	axis2_wsdl_property_impl_t *wsdl_property_impl = 
-		(axis2_wsdl_property_impl_t *) AXIS2_MALLOC((*env)->allocator,
-			sizeof(axis2_wsdl_property_impl_t));
+	wsdl_property_impl = (axis2_wsdl_property_impl_t *) AXIS2_MALLOC((*env)->
+        allocator, sizeof(axis2_wsdl_property_impl_t));
 	
 	
 	if(NULL == wsdl_property_impl)
+    {
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL); 
+        return NULL;
+    }
 	
-    wsdl_property_impl->wsdl_property.wsdl_component = axis2_wsdl_component_create(env);
+    wsdl_property_impl->name = NULL;
+    wsdl_property_impl->constraint = NULL;
+    wsdl_property_impl->value = NULL;
+    wsdl_property_impl->wsdl_property.wsdl_component = NULL;
     
+    wsdl_property_impl->wsdl_property.wsdl_component = axis2_wsdl_component_create(env);
     if(NULL == wsdl_property_impl->wsdl_property.wsdl_component)
     {
-        AXIS2_FREE((*env)->allocator, wsdl_property_impl);
+        axis2_wsdl_property_free(&(wsdl_property_impl->wsdl_property), env);
 		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+        return NULL;
     }
     
-	wsdl_property_impl->wsdl_property.ops = 
-		AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_wsdl_property_ops_t));
+	wsdl_property_impl->wsdl_property.ops = AXIS2_MALLOC ((*env)->allocator, 
+            sizeof(axis2_wsdl_property_ops_t));
 	if(NULL == wsdl_property_impl->wsdl_property.ops)
     {
-        AXIS2_FREE((*env)->allocator, wsdl_property_impl);
+        axis2_wsdl_property_free(&(wsdl_property_impl->wsdl_property), env);
 		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+        return NULL;
     }
     
 	wsdl_property_impl->wsdl_property.ops->free =  axis2_wsdl_property_free;
@@ -110,10 +119,6 @@
     wsdl_property_impl->wsdl_property.ops->set_value = 
         axis2_wsdl_property_set_value;
 	
-	wsdl_property_impl->name = NULL;
-    wsdl_property_impl->constraint = NULL;
-    wsdl_property_impl->value = NULL;
-	
 	return &(wsdl_property_impl->wsdl_property);
 }
 
@@ -123,29 +128,31 @@
 axis2_wsdl_property_free (axis2_wsdl_property_t *wsdl_property, 
                             axis2_env_t **env)
 {
+    axis2_wsdl_property_impl_t *property_impl = NULL;
+    
     AXIS2_FUNC_PARAM_CHECK(wsdl_property, env, AXIS2_FAILURE);
 	if(NULL != wsdl_property->ops)
         AXIS2_FREE((*env)->allocator, wsdl_property->ops);
     
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_property)->name)
-    {
-        AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_property)->name);
-    }
+    property_impl = AXIS2_INTF_TO_IMPL(wsdl_property);
     
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_property)->constraint)
+    if(NULL != property_impl->name)
     {
-        AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_property)->constraint);
+        AXIS2_FREE((*env)->allocator, property_impl->name);
+        property_impl->name = NULL;
     }
     
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_property)->value)
-    {
-        AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_property)->value);
-    }
+    property_impl->constraint = NULL;
+    
+    property_impl->value = NULL;
     
     if(NULL != wsdl_property->wsdl_component)
+    {
         AXIS2_WSDL_COMPONENT_FREE(wsdl_property->wsdl_component, env);
+        wsdl_property->wsdl_component = NULL;
+    }
     
-    AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_property));
+    AXIS2_FREE((*env)->allocator, property_impl);
     
 	return AXIS2_SUCCESS;
 }
@@ -165,6 +172,7 @@
 {
     AXIS2_FUNC_PARAM_CHECK(wsdl_property, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, constraint, AXIS2_FAILURE);
+    
     AXIS2_INTF_TO_IMPL(wsdl_property)->constraint = constraint;
     return AXIS2_SUCCESS;
 }
@@ -182,9 +190,19 @@
                                 axis2_env_t **env,
                                 axis2_char_t *name) 
 {
+    axis2_wsdl_property_impl_t *property_impl = NULL;
+    
     AXIS2_FUNC_PARAM_CHECK(wsdl_property, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, name, AXIS2_FAILURE);
-    AXIS2_INTF_TO_IMPL(wsdl_property)->name = name;
+    
+    property_impl = AXIS2_INTF_TO_IMPL(wsdl_property);
+    
+    if(property_impl->name)
+    {
+        AXIS2_FREE((*env)->allocator, property_impl->name);
+        property_impl->name = NULL;
+    }
+    property_impl->name = name;
     return AXIS2_SUCCESS;
 }
 
@@ -201,8 +219,14 @@
                                 axis2_env_t **env,
                                 void *value) 
 {
+    axis2_wsdl_property_impl_t *property_impl = NULL;
+    
     AXIS2_FUNC_PARAM_CHECK(wsdl_property, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, value, AXIS2_FAILURE);
-    AXIS2_INTF_TO_IMPL(wsdl_property)->value = value;
+    
+    property_impl = AXIS2_INTF_TO_IMPL(wsdl_property);
+    
+    property_impl->value = value;
+    
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_soap_operation.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_soap_operation.c?rev=356124&r1=356123&r2=356124&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_soap_operation.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_soap_operation.c Sun Dec 11 19:13:55 2005
@@ -64,15 +64,28 @@
 axis2_wsdl_soap_operation_t * AXIS2_CALL 
 axis2_wsdl_soap_operation_create (axis2_env_t **env)
 {
+    axis2_wsdl_soap_operation_impl_t *soap_operation_impl = NULL;
+    
 	AXIS2_ENV_CHECK(env, NULL);
 	
-	axis2_wsdl_soap_operation_impl_t *soap_operation_impl = 
-		(axis2_wsdl_soap_operation_impl_t *) AXIS2_MALLOC((*env)->allocator,
-			sizeof(axis2_wsdl_soap_operation_impl_t));
-	
+	soap_operation_impl = (axis2_wsdl_soap_operation_impl_t *) 
+        AXIS2_MALLOC((*env)->allocator, sizeof(axis2_wsdl_soap_operation_impl_t));
 	
 	if(NULL == soap_operation_impl)
+    {
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL); 
+        return NULL;
+    }
+    
+    soap_operation_impl->style = NULL;
+    soap_operation_impl->soap_action = NULL;
+    soap_operation_impl->soap_operation.ops = NULL;
+    axis2_qname_t *type_l = NULL;
+    
+    type_l = axis2_qname_create(env, "operation", SOAP_11_OPERATION, NULL);
+    
+    AXIS2_WSDL_EXTENSIBLE_ELEMENT_SET_TYPE(soap_operation_impl->soap_operation.
+        extensible_element, env, type_l);
     
 	soap_operation_impl->soap_operation.ops = 
 		AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_wsdl_soap_operation_ops_t));
@@ -81,6 +94,7 @@
         axis2_wsdl_soap_operation_free(&(soap_operation_impl->
             soap_operation), env);
 		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+        return NULL;
     }
     
     soap_operation_impl->soap_operation.ops->free =  
@@ -94,15 +108,6 @@
         axis2_wsdl_soap_operation_get_soap_action;
 	soap_operation_impl->soap_operation.ops->set_soap_action = 
         axis2_wsdl_soap_operation_set_soap_action;
-	
-    soap_operation_impl->style = NULL;
-    soap_operation_impl->soap_action = NULL;
-    
-    axis2_qname_t *type_l = axis2_qname_create(env, "operation", 
-        SOAP_11_OPERATION, NULL);
-    
-    AXIS2_WSDL_EXTENSIBLE_ELEMENT_SET_TYPE(soap_operation_impl->soap_operation.
-        extensible_element, env, type_l);
     
 	return &(soap_operation_impl->soap_operation);
 }
@@ -110,14 +115,21 @@
 axis2_wsdl_soap_operation_t * AXIS2_CALL 
 axis2_wsdl_soap_operation_create_with_type (axis2_env_t **env, axis2_qname_t *type)
 {
+    axis2_wsdl_soap_operation_t *soap_operation = NULL;
+    
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK((*env)->error, type, NULL);
-    axis2_wsdl_soap_operation_t *soap_operation =
-        axis2_wsdl_soap_operation_create(env);
     
-    AXIS2_WSDL_EXTENSIBLE_ELEMENT_SET_TYPE(soap_operation->extensible_element, env, type);
+    soap_operation = axis2_wsdl_soap_operation_create(env);
     
+    if(AXIS2_FAILURE == AXIS2_WSDL_EXTENSIBLE_ELEMENT_SET_TYPE(soap_operation->
+        extensible_element, env, type))
+    {
+        axis2_wsdl_soap_operation_free(soap_operation, env);
+        soap_operation = NULL;
+    }
     return soap_operation;
+    
 }
 
 /***************************Function implementation****************************/
@@ -127,23 +139,33 @@
                         axis2_wsdl_soap_operation_t *soap_operation, 
                         axis2_env_t **env)
 {
-    axis2_wsdl_soap_operation_impl_t *soap_operation_impl = 
-        AXIS2_INTF_TO_IMPL(soap_operation);
+    axis2_wsdl_soap_operation_impl_t *soap_operation_impl = NULL;
+    
     AXIS2_FUNC_PARAM_CHECK(soap_operation, env, AXIS2_FAILURE);
+    
+    soap_operation_impl = AXIS2_INTF_TO_IMPL(soap_operation);
+    
 	if(NULL != soap_operation->ops)
+    {
         AXIS2_FREE((*env)->allocator, soap_operation->ops);
+        soap_operation->ops = NULL;
+    }
     
     if(NULL != soap_operation_impl->style)
     {
         AXIS2_FREE((*env)->allocator, soap_operation_impl->style);
+        soap_operation_impl->style = NULL;
     }
     
     if(NULL != soap_operation_impl->soap_action)
     {
         AXIS2_FREE((*env)->allocator, soap_operation_impl->soap_action);
+        soap_operation_impl->soap_action = NULL;
     }
     
-    AXIS2_FREE((*env)->allocator, soap_operation_impl);
+    if(soap_operation_impl)
+        AXIS2_FREE((*env)->allocator, soap_operation_impl);
+    soap_operation_impl = NULL;
     
 	return AXIS2_SUCCESS;
 }
@@ -169,7 +191,10 @@
     AXIS2_PARAM_CHECK((*env)->error, style, AXIS2_FAILURE);
     
     if(soap_operation_impl->style)
+    {
         AXIS2_FREE((*env)->allocator, style);
+        soap_operation_impl->style = NULL;
+    }
     
     soap_operation_impl->style = style;
     return AXIS2_SUCCESS;
@@ -196,7 +221,10 @@
     AXIS2_PARAM_CHECK((*env)->error, soap_action, AXIS2_FAILURE);
     
     if(soap_operation_impl->soap_action)
+    {
         AXIS2_FREE((*env)->allocator, soap_action);
+        soap_operation_impl->soap_action = NULL;
+    }
     
     soap_operation_impl->soap_action = soap_action;
     return AXIS2_SUCCESS;

Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_svc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_svc.c?rev=356124&r1=356123&r2=356124&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_svc.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_svc.c Sun Dec 11 19:13:55 2005
@@ -70,7 +70,7 @@
 axis2_status_t AXIS2_CALL 
 axis2_wsdl_svc_set_endpoint(axis2_wsdl_svc_t *wsdl_svc,
                                 axis2_env_t **env,
-                                axis2_wsdl_endpoint_t *endpoint);
+                                struct axis2_wsdl_endpoint *endpoint);
 
 axis2_wsdl_endpoint_t * AXIS2_CALL
 axis2_wsdl_svc_get_endpoint(axis2_wsdl_svc_t *wsdl_svc,
@@ -95,39 +95,46 @@
 axis2_wsdl_svc_t * AXIS2_CALL 
 axis2_wsdl_svc_create (axis2_env_t **env)
 {
+    axis2_wsdl_svc_impl_t *wsdl_svc_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
     
-	axis2_wsdl_svc_impl_t *wsdl_svc_impl = (axis2_wsdl_svc_impl_t *)
-		AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_wsdl_svc_t));
+	wsdl_svc_impl = (axis2_wsdl_svc_impl_t *) AXIS2_MALLOC ((*env)->allocator, 
+            sizeof(axis2_wsdl_svc_t));
 	if(NULL == wsdl_svc_impl)
 	{
 		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+        return NULL;
 	}
     
+    wsdl_svc_impl->svc_interface = NULL;
+    wsdl_svc_impl->wsdl_svc.wsdl_component = NULL;
+    wsdl_svc_impl->endpoints = NULL;
+    wsdl_svc_impl->wsdl_svc.ops = NULL;
+    
     wsdl_svc_impl->wsdl_svc.wsdl_component = axis2_wsdl_component_create(env);
     if(NULL == wsdl_svc_impl->wsdl_svc.wsdl_component)
 	{
-        AXIS2_FREE((*env)->allocator, wsdl_svc_impl);
+        axis2_wsdl_svc_free(&(wsdl_svc_impl->wsdl_svc), env);
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+        return NULL;
     }
     
     wsdl_svc_impl->endpoints = axis2_hash_make(env);
     if(NULL == wsdl_svc_impl->endpoints)
     {
-        AXIS2_WSDL_COMPONENT_FREE(wsdl_svc_impl->wsdl_svc.wsdl_component, env);
-        AXIS2_FREE((*env)->allocator, wsdl_svc_impl);
+        axis2_wsdl_svc_free(&(wsdl_svc_impl->wsdl_svc), env);
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+        return NULL;
     }
-	wsdl_svc_impl->wsdl_svc.ops = 
-        (axis2_wsdl_svc_ops_t *) AXIS2_MALLOC ((*env)->allocator, 
-        sizeof(axis2_wsdl_svc_ops_t));
+    
+	wsdl_svc_impl->wsdl_svc.ops = (axis2_wsdl_svc_ops_t *) AXIS2_MALLOC ((*env)->
+        allocator, sizeof(axis2_wsdl_svc_ops_t));
     
 	if(NULL == wsdl_svc_impl->wsdl_svc.ops)
 	{
-        axis2_hash_free(wsdl_svc_impl->endpoints, env);
-        AXIS2_WSDL_COMPONENT_FREE(wsdl_svc_impl->wsdl_svc.wsdl_component, env);
-		AXIS2_FREE((*env)->allocator, wsdl_svc_impl);
-		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);	
+        axis2_wsdl_svc_free(&(wsdl_svc_impl->wsdl_svc), env);
+		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+        return NULL;        
 	}
     
 	wsdl_svc_impl->wsdl_svc.ops->free = axis2_wsdl_svc_free;
@@ -141,8 +148,6 @@
     wsdl_svc_impl->wsdl_svc.ops->get_svc_interface = axis2_wsdl_svc_get_svc_interface;
     wsdl_svc_impl->wsdl_svc.ops->set_svc_interface = axis2_wsdl_svc_set_svc_interface;
     
-    wsdl_svc_impl->svc_interface = NULL;
-    
 	return &(wsdl_svc_impl->wsdl_svc);
 }
 
@@ -152,28 +157,59 @@
 axis2_wsdl_svc_free (axis2_wsdl_svc_t *wsdl_svc,
                         axis2_env_t **env)
 {
+    axis2_wsdl_svc_impl_t *wsdl_svc_impl = NULL;
 	AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, AXIS2_FAILURE);
     
+    wsdl_svc_impl = AXIS2_INTF_TO_IMPL(wsdl_svc);
+    
     if(NULL != wsdl_svc->wsdl_component)
-        AXIS2_WSDL_COMPONENT_FREE(wsdl_svc->wsdl_component, 
-            env);
+    {
+        AXIS2_WSDL_COMPONENT_FREE(wsdl_svc->wsdl_component, env);
+        wsdl_svc->wsdl_component = NULL;
+    }
     
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_svc)->endpoints)
-        axis2_hash_free(AXIS2_INTF_TO_IMPL(wsdl_svc)->endpoints, env);
+    if(NULL != wsdl_svc_impl->endpoints)
+    {
+        axis2_hash_index_t *hi = NULL;
+        void *val = NULL;
+        for (hi = axis2_hash_first (wsdl_svc_impl->endpoints, env); hi;
+                 hi = axis2_hash_next ( env, hi))
+        {
+            struct axis2_wsdl_endpoint *endpoint = NULL;
+            axis2_hash_this (hi, NULL, NULL, &val);
+            endpoint = (struct axis2_wsdl_endpoint *) val;
+            if (endpoint)
+                AXIS2_TRANSPORT_IN_DESC_FREE (endpoint, env);
+            
+            val = NULL;
+            endpoint = NULL;
+               
+        }
+        axis2_hash_free(wsdl_svc_impl->endpoints, env);
+        wsdl_svc_impl->endpoints = NULL;
+    }
     
-    if(NULL != AXIS2_INTF_TO_IMPL(wsdl_svc)->svc_interface)
-        AXIS2_WSDL_INTERFACE_FREE(wsdl_svc, env);
+    if(NULL != wsdl_svc_impl->svc_interface)
+    {
+        AXIS2_WSDL_INTERFACE_FREE(wsdl_svc_impl->svc_interface, env);
+        wsdl_svc_impl->svc_interface = NULL;
+    }
     
     if(NULL != wsdl_svc->ops)
+    {
         AXIS2_FREE((*env)->allocator, wsdl_svc->ops);
+        wsdl_svc->ops = NULL;
+    }
     
-	AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_svc));
+    if(wsdl_svc_impl)
+	    AXIS2_FREE((*env)->allocator, wsdl_svc_impl);
+    wsdl_svc_impl = NULL;
     
 	return AXIS2_SUCCESS;
 }
 
 axis2_qname_t * AXIS2_CALL 
-axis2_svc_get_name(axis2_wsdl_svc_t *wsdl_svc, 
+axis2_wsdl_svc_get_name(axis2_wsdl_svc_t *wsdl_svc, 
                     axis2_env_t **env)
 {
     AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, NULL);
@@ -181,13 +217,22 @@
 }
 
 axis2_status_t AXIS2_CALL
-axis2_svc_set_name(axis2_wsdl_svc_t *wsdl_svc, 
+axis2_wsdl_svc_set_name(axis2_wsdl_svc_t *wsdl_svc, 
                     axis2_env_t **env, 
                     axis2_qname_t *qname) 
 {
+    axis2_qname_t *svc_name = NULL;
+    
     AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, qname, AXIS2_FAILURE);
-    AXIS2_INTF_TO_IMPL(wsdl_svc)->qname = qname;
+    
+    svc_name = AXIS2_QNAME_CLONE(qname, env);
+    if(NULL == svc_name)
+    {
+        return AXIS2_FAILURE;
+    }
+    
+    AXIS2_INTF_TO_IMPL(wsdl_svc)->qname = svc_name;
     
     return AXIS2_SUCCESS;
 }
@@ -214,7 +259,7 @@
 axis2_status_t AXIS2_CALL 
 axis2_wsdl_svc_set_endpoint(axis2_wsdl_svc_t *wsdl_svc,
                                 axis2_env_t **env,
-                                axis2_wsdl_endpoint_t *endpoint) 
+                                struct axis2_wsdl_endpoint *endpoint) 
 {
     AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, endpoint, AXIS2_FAILURE);



Mime
View raw message