axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r376232 - in /webservices/axis2/trunk/c/modules: core/addr/any_content_type.c core/description/module_desc.c core/description/svc_grp.c wsdl/wsdl_binding.c wsdl/wsdl_interface.c wsdl/wsdl_svc.c
Date Thu, 09 Feb 2006 09:09:39 GMT
Author: damitha
Date: Thu Feb  9 01:09:38 2006
New Revision: 376232

URL: http://svn.apache.org/viewcvs?rev=376232&view=rev
Log:
Setting values to hash map should be done using a key which
has type axis2_char_t. In some code fragments this done using
qname. This could lead to unexpected problems. So fixed it.

Modified:
    webservices/axis2/trunk/c/modules/core/addr/any_content_type.c
    webservices/axis2/trunk/c/modules/core/description/module_desc.c
    webservices/axis2/trunk/c/modules/core/description/svc_grp.c
    webservices/axis2/trunk/c/modules/wsdl/wsdl_binding.c
    webservices/axis2/trunk/c/modules/wsdl/wsdl_interface.c
    webservices/axis2/trunk/c/modules/wsdl/wsdl_svc.c

Modified: webservices/axis2/trunk/c/modules/core/addr/any_content_type.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/addr/any_content_type.c?rev=376232&r1=376231&r2=376232&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/addr/any_content_type.c (original)
+++ webservices/axis2/trunk/c/modules/core/addr/any_content_type.c Thu Feb  9 01:09:38 2006
@@ -106,14 +106,17 @@
 {
     axis2_any_content_type_impl_t *any_content_type_impl = NULL;
     
-    AXIS2_FUNC_PARAM_CHECK(any_content_type, env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     
     any_content_type_impl = AXIS2_INTF_TO_IMPL(any_content_type);
     
     if (any_content_type_impl->value_map)
     {
-        axis2_hash_set(any_content_type_impl->value_map, qname, 
-            sizeof(axis2_qname_t), value);
+        axis2_char_t *name = NULL;
+
+        name = AXIS2_QNAME_TO_STRING(qname, env);
+        axis2_hash_set(any_content_type_impl->value_map, name, 
+            AXIS2_HASH_KEY_STRING, value);
     }
     return AXIS2_SUCCESS;
 }
@@ -125,14 +128,17 @@
 {
     axis2_any_content_type_impl_t *any_content_type_impl = NULL;
     
-    AXIS2_FUNC_PARAM_CHECK(any_content_type, env, NULL);
+    AXIS2_ENV_CHECK(env, NULL);
     
     any_content_type_impl = AXIS2_INTF_TO_IMPL(any_content_type);
     
     if (any_content_type_impl->value_map)
     {
-        return axis2_hash_get(any_content_type_impl->value_map, qname, 
-            sizeof(axis2_qname_t));
+        axis2_char_t *name = NULL;
+
+        name = AXIS2_QNAME_TO_STRING(qname, env);
+        return axis2_hash_get(any_content_type_impl->value_map, name, 
+            AXIS2_HASH_KEY_STRING);
     }
     return NULL;
 }

Modified: webservices/axis2/trunk/c/modules/core/description/module_desc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/module_desc.c?rev=376232&r1=376231&r2=376232&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/module_desc.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/module_desc.c Thu Feb  9 01:09:38 2006
@@ -472,7 +472,8 @@
                                     axis2_op_t *op)
 {
     axis2_module_desc_impl_t *module_desc_impl = NULL;
-    axis2_qname_t *optr_name = NULL;
+    axis2_qname_t *op_qname = NULL;
+    axis2_char_t *op_name = NULL;
     
     AXIS2_FUNC_PARAM_CHECK(module_desc, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, op, AXIS2_FAILURE);
@@ -485,15 +486,14 @@
             return AXIS2_FAILURE;
 	}	
     
-    optr_name = AXIS2_OP_GET_QNAME(op, env);
+    op_qname = AXIS2_OP_GET_QNAME(op, env);
     
-    if(NULL == optr_name)
+    if(NULL == op_qname)
     {
         return AXIS2_FAILURE;
     }
-    
-    axis2_hash_set(module_desc_impl->ops, optr_name, sizeof(axis2_qname_t), 
-        op);
+    op_name = AXIS2_QNAME_TO_STRING(op_qname, env);
+    axis2_hash_set(module_desc_impl->ops, op_name, AXIS2_HASH_KEY_STRING, op);
     
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/modules/core/description/svc_grp.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/svc_grp.c?rev=376232&r1=376231&r2=376232&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/svc_grp.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/svc_grp.c Thu Feb  9 01:09:38 2006
@@ -468,20 +468,22 @@
 axis2_status_t AXIS2_CALL 
 axis2_svc_grp_remove_svc (axis2_svc_grp_t *svc_grp, 
                             axis2_env_t **env,
-		                    axis2_qname_t* svc_name)
+		                    axis2_qname_t* svc_qname)
 {
     axis2_svc_t *svc = NULL;
+    axis2_char_t *svc_name = NULL;
         
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 	AXIS2_PARAM_CHECK((*env)->error, svc_name, AXIS2_FAILURE);
     
-    svc = axis2_svc_grp_get_svc(svc_grp, env, svc_name);
+    svc = axis2_svc_grp_get_svc(svc_grp, env, svc_qname);
     if (NULL != svc) 
     {
         /*this.parent.notifyObservers(AxisEvent.SERVICE_DEPLOY , service);*/
     }
-	axis2_hash_set (AXIS2_INTF_TO_IMPL(svc_grp)->svcs, 
-        svc_name, sizeof(axis2_qname_t), NULL);
+    svc_name = AXIS2_QNAME_TO_STRING(svc_qname, env);
+	axis2_hash_set (AXIS2_INTF_TO_IMPL(svc_grp)->svcs, svc_name, 
+        AXIS2_HASH_KEY_STRING, NULL);
 	
 	return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/modules/wsdl/wsdl_binding.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/wsdl_binding.c?rev=376232&r1=376231&r2=376232&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/wsdl_binding.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/wsdl_binding.c Thu Feb  9 01:09:38 2006
@@ -467,10 +467,10 @@
 {
     axis2_wsdl_binding_impl_t *binding_impl = NULL;
     axis2_qname_t *qname = NULL;
-    
-    AXIS2_FUNC_PARAM_CHECK(wsdl_binding, env, AXIS2_FAILURE);
+    axis2_char_t *name = NULL;
+   
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, binding_op, AXIS2_FAILURE);
-    
     binding_impl = AXIS2_INTF_TO_IMPL(wsdl_binding);
     
     qname = AXIS2_WSDL_BINDING_OP_GET_QNAME(binding_op, env);
@@ -478,8 +478,9 @@
     {
         return AXIS2_FAILURE;
     }
-    axis2_hash_set(binding_impl->binding_ops, qname, 
-        sizeof(axis2_qname_t), binding_op);
+    name = AXIS2_QNAME_TO_STRING(qname, env);
+    axis2_hash_set(binding_impl->binding_ops, name, AXIS2_HASH_KEY_STRING,
+        binding_op);
     
     return AXIS2_SUCCESS;
 }
@@ -487,12 +488,18 @@
 axis2_wsdl_binding_op_t *AXIS2_CALL
 axis2_wsdl_binding_get_binding_op(axis2_wsdl_binding_t *wsdl_binding,
                                             axis2_env_t **env,
-                                            axis2_qname_t *qName) 
+                                            axis2_qname_t *qname) 
 {
-    AXIS2_FUNC_PARAM_CHECK(wsdl_binding, env, NULL);
-    return (axis2_wsdl_binding_op_t *) axis2_hash_get(
-        AXIS2_INTF_TO_IMPL(wsdl_binding)->binding_ops, qName,
-            sizeof(axis2_qname_t));
+    axis2_wsdl_binding_impl_t *binding_impl = NULL;
+    axis2_char_t *name = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, qname, NULL);
+    binding_impl = AXIS2_INTF_TO_IMPL(wsdl_binding);
+    
+    name = AXIS2_QNAME_TO_STRING(qname, env);
+    return (axis2_wsdl_binding_op_t *) axis2_hash_get(binding_impl->binding_ops, 
+        name, AXIS2_HASH_KEY_STRING);
 }
 
 axis2_status_t AXIS2_CALL
@@ -502,6 +509,7 @@
 {
     axis2_wsdl_binding_impl_t *binding_impl = NULL;
     axis2_qname_t *fault_ref = NULL;
+    axis2_char_t *fault_ref_name = NULL;
     
     AXIS2_FUNC_PARAM_CHECK(wsdl_binding, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, binding_fault, AXIS2_FAILURE);
@@ -513,8 +521,9 @@
     {
         return AXIS2_FAILURE;
     }
-    axis2_hash_set(binding_impl->binding_faults, fault_ref, sizeof(axis2_qname_t),
-        binding_fault);
+    fault_ref_name = AXIS2_QNAME_TO_STRING(fault_ref, env);
+    axis2_hash_set(binding_impl->binding_faults, fault_ref_name,
+        AXIS2_HASH_KEY_STRING, binding_fault);
     return AXIS2_SUCCESS;
 }
 
@@ -523,9 +532,15 @@
                                         axis2_env_t **env,
                                         axis2_qname_t *ref) 
 {
-    AXIS2_FUNC_PARAM_CHECK(wsdl_binding, env, NULL);
+    axis2_wsdl_binding_impl_t *binding_impl = NULL;
+    axis2_char_t *ref_name = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK((*env)->error, ref, NULL);
+    binding_impl = AXIS2_INTF_TO_IMPL(wsdl_binding);
     
+    ref_name = AXIS2_QNAME_TO_STRING(ref, env);
+
     return (axis2_wsdl_binding_fault_t *) axis2_hash_get(
-        AXIS2_INTF_TO_IMPL(wsdl_binding)->binding_faults, ref, sizeof(axis2_qname_t));
+        binding_impl->binding_faults, ref_name, AXIS2_HASH_KEY_STRING);
 }

Modified: webservices/axis2/trunk/c/modules/wsdl/wsdl_interface.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/wsdl_interface.c?rev=376232&r1=376231&r2=376232&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/wsdl_interface.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/wsdl_interface.c Thu Feb  9 01:09:38 2006
@@ -384,8 +384,16 @@
                                             axis2_env_t **env,
                                             axis2_qname_t *qname)
 {
-    return (axis2_wsdl_interface_t *) axis2_hash_get(AXIS2_INTF_TO_IMPL(
-        wsdl_interface)->super_interfaces, qname, sizeof(axis2_qname_t));
+    axis2_wsdl_interface_impl_t *interface_impl = NULL;
+    axis2_char_t *name = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, qname, NULL);
+    interface_impl = AXIS2_INTF_TO_IMPL(wsdl_interface);
+
+    name = AXIS2_QNAME_TO_STRING(qname, env);
+    return (axis2_wsdl_interface_t *) axis2_hash_get(
+        interface_impl->super_interfaces, name, AXIS2_HASH_KEY_STRING);
 }
 
 axis2_char_t *AXIS2_CALL
@@ -528,10 +536,10 @@
 {
     axis2_wsdl_interface_impl_t *interface_impl = NULL;
     axis2_qname_t *qname = NULL;
+    axis2_char_t *name = NULL;
     
-    AXIS2_FUNC_PARAM_CHECK(wsdl_interface, env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, interface_component, AXIS2_FAILURE);
-    
     interface_impl = AXIS2_INTF_TO_IMPL(wsdl_interface);
     
     qname = axis2_wsdl_interface_get_name(interface_component, env);
@@ -539,8 +547,10 @@
     {
         return AXIS2_FAILURE;
     }
-    axis2_hash_set(AXIS2_INTF_TO_IMPL(wsdl_interface)->super_interfaces, qname,
-        sizeof(axis2_qname_t), interface_component);
+
+    name = AXIS2_QNAME_TO_STRING(qname, env);
+    axis2_hash_set(interface_impl->super_interfaces, name,
+        AXIS2_HASH_KEY_STRING, interface_component);
     
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/modules/wsdl/wsdl_svc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/wsdl_svc.c?rev=376232&r1=376231&r2=376232&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/wsdl_svc.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/wsdl_svc.c Thu Feb  9 01:09:38 2006
@@ -263,11 +263,16 @@
                                 axis2_env_t **env,
                                 axis2_wsdl_endpoint_t *endpoint) 
 {
-    AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK((*env)->error, endpoint, AXIS2_FAILURE);
+    axis2_wsdl_svc_impl_t *wsdl_svc_impl = NULL;
+    axis2_char_t *endpoint_name = NULL;
     
-    axis2_hash_set(AXIS2_INTF_TO_IMPL(wsdl_svc)->endpoints, 
-        AXIS2_WSDL_ENDPOINT_GET_NAME(endpoint, env), sizeof(axis2_qname_t), endpoint);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, endpoint, AXIS2_FAILURE);
+    wsdl_svc_impl = AXIS2_INTF_TO_IMPL(wsdl_svc);
+   
+    endpoint_name = AXIS2_WSDL_ENDPOINT_GET_NAME(endpoint, env);
+    axis2_hash_set(wsdl_svc_impl->endpoints, endpoint_name , 
+        AXIS2_HASH_KEY_STRING, endpoint);
     
     return AXIS2_SUCCESS;
 }
@@ -277,9 +282,16 @@
                                 axis2_env_t **env,
                                 axis2_qname_t *qname) 
 {
-    AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, NULL);
-    return (axis2_wsdl_endpoint_t *) axis2_hash_get(AXIS2_INTF_TO_IMPL(
-        wsdl_svc)->endpoints, qname, sizeof(axis2_qname_t));
+    axis2_wsdl_svc_impl_t *wsdl_svc_impl = NULL;
+    axis2_char_t *name = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, qname, AXIS2_FAILURE);
+    wsdl_svc_impl = AXIS2_INTF_TO_IMPL(wsdl_svc);
+
+    name = AXIS2_QNAME_TO_STRING(qname, env);
+    return (axis2_wsdl_endpoint_t *) axis2_hash_get(wsdl_svc_impl->endpoints, 
+        name, AXIS2_HASH_KEY_STRING);
 }
 
 axis2_char_t *AXIS2_CALL



Mime
View raw message