You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by da...@apache.org on 2006/01/24 11:28:26 UTC

svn commit: r371882 - in /webservices/axis2/trunk/c: modules/core/deployment/ modules/core/description/ test/core/deployment/ test/unit/core/description/

Author: damitha
Date: Tue Jan 24 02:28:09 2006
New Revision: 371882

URL: http://svn.apache.org/viewcvs?rev=371882&view=rev
Log:
params are not properly set in service from svc builder. Fixed this problem

Modified:
    webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c
    webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c
    webservices/axis2/trunk/c/modules/core/deployment/svc_grp_builder.c
    webservices/axis2/trunk/c/modules/core/description/svc.c
    webservices/axis2/trunk/c/test/core/deployment/test_deployment.c
    webservices/axis2/trunk/c/test/unit/core/description/test_svc.c

Modified: webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c?rev=371882&r1=371881&r2=371882&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/dep_engine.c Tue Jan 24 02:28:09 2006
@@ -1302,9 +1302,6 @@
             engine_impl->curr_file = (axis2_arch_file_data_t *) 
                 AXIS2_ARRAY_LIST_GET(engine_impl->ws_to_deploy, env, i);
             
-            axis2_file_t *svc_folder = AXIS2_ARCH_FILE_DATA_GET_FILE(engine_impl->curr_file, env);
-            axis2_char_t *svc_folder_path = AXIS2_FILE_GET_PATH(svc_folder, env);
-            axis2_char_t *folder_name = AXIS2_FILE_GET_NAME(svc_folder, env);
             type = AXIS2_ARCH_FILE_DATA_GET_TYPE(engine_impl->curr_file, env);
             switch (type) 
             {

Modified: webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c?rev=371882&r1=371881&r2=371882&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c Tue Jan 24 02:28:09 2006
@@ -240,17 +240,12 @@
     axis2_char_t *svc_dll_name = NULL;
     axis2_dll_desc_t *dll_desc = NULL;
     axis2_param_t *impl_info_param = NULL;
-    /*axis2_char_t *repos_path = NULL;
-    axis2_char_t *svcs_path = NULL;
-    axis2_char_t *temp_path1 = NULL;
-    axis2_char_t *temp_path2 = NULL;
-    axis2_char_t *temp_path3 = NULL;
-    */
     axis2_arch_file_data_t *arch_file_data = NULL;
     axis2_file_t *svc_folder = NULL;
     axis2_char_t *temp_path = NULL;
     axis2_char_t *dll_path = NULL;
     axis2_char_t *svc_folder_path = NULL;
+    axis2_param_container_t *param_container_l = NULL;
     int i = 0;
     int size = 0;
     
@@ -269,8 +264,11 @@
     itr = AXIS2_OM_ELEMENT_GET_CHILDREN_WITH_QNAME(svc_element, env, qparamst,
         svc_node);
     parent = AXIS2_SVC_GET_PARENT(builder_impl->svc, env);
+    param_container_l = (axis2_param_container_t *)
+        AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(builder_impl->svc->wsdl_svc->
+            wsdl_component, env, AXIS2_PARAMETER_KEY);
     status = AXIS2_DESC_BUILDER_PROCESS_PARAMS(svc_builder->desc_builder, env, 
-        itr, builder_impl->svc->param_container, parent->param_container);
+        itr, param_container_l, parent->param_container);
     if(AXIS2_SUCCESS != status)
     {
         AXIS2_QNAME_FREE(qparamst, env);
@@ -331,8 +329,8 @@
     
     /* create dll_desc and set it in a parameter. then set that param in svc */
     dll_desc = axis2_dll_desc_create(env);
-    impl_info_param = AXIS2_PARAM_CONTAINER_GET_PARAM(builder_impl->svc->
-        param_container, env, AXIS2_SERVICE_CLASS);
+    impl_info_param = AXIS2_PARAM_CONTAINER_GET_PARAM(param_container_l, env, 
+        AXIS2_SERVICE_CLASS);
     if(!impl_info_param)
     {
         AXIS2_DLL_DESC_FREE(dll_desc, env);
@@ -340,15 +338,6 @@
     }
     svc_dll_name = AXIS2_PARAM_GET_VALUE(impl_info_param, env);
     
-    /*repos_path = AXIS2_DEP_ENGINE_GET_REPOS_PATH(builder_impl->svc_builder.
-        desc_builder->engine, env);
-    printf("repos_path:%s\n", repos_path);
-    temp_path1 = AXIS2_STRACAT(repos_path, AXIS2_PATH_SEP_STR, env);
-    temp_path2 = AXIS2_STRACAT(temp_path1, AXIS2_SERVICE_FOLDER, env);
-    svcs_path = AXIS2_STRACAT(temp_path2, AXIS2_PATH_SEP_STR, env);
-    temp_path3 = AXIS2_STRACAT(svcs_path, svc_name, env);
-    svc_folder_path = AXIS2_STRACAT(temp_path3, AXIS2_PATH_SEP_STR, env);*/
-    
     arch_file_data = AXIS2_DEP_ENGINE_GET_CURRENT_FILE_ITEM(builder_impl->
         svc_builder.desc_builder->engine, env);
     svc_folder = AXIS2_ARCH_FILE_DATA_GET_FILE(arch_file_data, env);
@@ -361,19 +350,22 @@
      * therefore we free the value
      */
     AXIS2_FREE((*env)->allocator, svc_dll_name);
+    svc_dll_name = NULL;
     /* free all temp vars */
-    /*AXIS2_FREE((*env)->allocator, svcs_path);
-    AXIS2_FREE((*env)->allocator, temp_path1);
-    AXIS2_FREE((*env)->allocator, temp_path2);
-    AXIS2_FREE((*env)->allocator, temp_path3);*/
     AXIS2_FREE((*env)->allocator, temp_path);
+    temp_path = NULL;
     AXIS2_FREE((*env)->allocator, svc_folder_path);
+    svc_folder_path = NULL;
     AXIS2_FREE((*env)->allocator, dll_path);
+    dll_path = NULL;
     
     AXIS2_DLL_DESC_SET_TYPE(dll_desc, env, AXIS2_SVC_DLL);
     axis2_class_loader_init(env);
-    AXIS2_PARAM_SET_VALUE(impl_info_param, env, dll_desc);
-      
+    status = AXIS2_PARAM_SET_VALUE(impl_info_param, env, dll_desc);
+    if(AXIS2_SUCCESS != status)
+    {
+        return AXIS2_FAILURE;
+    }
     /* end of my logic */
     /* processing service wide modules which required to engage globally */
     qmodulest = axis2_qname_create(env, AXIS2_MODULEST, NULL, NULL);

Modified: webservices/axis2/trunk/c/modules/core/deployment/svc_grp_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/svc_grp_builder.c?rev=371882&r1=371881&r2=371882&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/svc_grp_builder.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/svc_grp_builder.c Tue Jan 24 02:28:09 2006
@@ -236,6 +236,7 @@
             svc_builder = axis2_svc_builder_create_with_dep_engine_and_svc(env,
                 grp_builder->desc_builder->engine, axis_svc);
             status = AXIS2_SVC_BUILDER_POPULATE_SVC(svc_builder, env, svc_node);
+            AXIS2_SVC_BUILDER_FREE(svc_builder, env);
             
         }
     }

Modified: webservices/axis2/trunk/c/modules/core/description/svc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/svc.c?rev=371882&r1=371881&r2=371882&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/svc.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/svc.c Tue Jan 24 02:28:09 2006
@@ -731,7 +731,7 @@
     } 
     else
     {
-        param_container_l = (struct axis2_param_container *)
+        param_container_l = (axis2_param_container_t *)
             AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(svc->wsdl_svc->
                 wsdl_component, env, AXIS2_PARAMETER_KEY);
         return AXIS2_PARAM_CONTAINER_ADD_PARAM(param_container_l, env, param);
@@ -750,6 +750,10 @@
     param_container_l = (axis2_param_container_t *)
         AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(svc->wsdl_svc->
             wsdl_component, env, AXIS2_PARAMETER_KEY);
+    if(!param_container_l)
+    {
+        return NULL;
+    }
     return AXIS2_PARAM_CONTAINER_GET_PARAM(param_container_l, env, name);
 }
 

Modified: webservices/axis2/trunk/c/test/core/deployment/test_deployment.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/core/deployment/test_deployment.c?rev=371882&r1=371881&r2=371882&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/core/deployment/test_deployment.c (original)
+++ webservices/axis2/trunk/c/test/core/deployment/test_deployment.c Tue Jan 24 02:28:09 2006
@@ -57,10 +57,17 @@
              NULL != hi; hi = axis2_hash_next (&env, hi))
         {
              axis2_hash_t *ops= NULL;
-             
+             axis2_svc_t *svc = NULL;
+             axis2_param_t *impl_info_param = NULL;
+
              axis2_hash_this(hi, NULL, NULL, &service);
-             
-             ops = AXIS2_SVC_GET_OPS(((axis2_svc_t *)service), &env);
+             svc = (axis2_svc_t *) service;
+             impl_info_param = AXIS2_SVC_GET_PARAM(svc, &env, AXIS2_SERVICE_CLASS);
+             if(!impl_info_param)
+             {
+                printf("imple_info_param is null\n");
+             }
+             ops = AXIS2_SVC_GET_OPS(svc, &env);
              if(ops)
              {
                 printf("ops count = %d\n", axis2_hash_count(ops));

Modified: webservices/axis2/trunk/c/test/unit/core/description/test_svc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/description/test_svc.c?rev=371882&r1=371881&r2=371882&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/description/test_svc.c (original)
+++ webservices/axis2/trunk/c/test/unit/core/description/test_svc.c Tue Jan 24 02:28:09 2006
@@ -35,6 +35,37 @@
     
 }
 
+void Testaxis2_svc_add_param(CuTest *tc)
+{
+    struct axis2_svc *svc = NULL;
+    axis2_status_t expected = AXIS2_FAILURE;
+    axis2_status_t actual = AXIS2_FAILURE;
+          
+    printf("**************************************\n");
+    printf("testing axis2_svc_add_param  method \n");
+    printf("**************************************\n");
+
+    axis2_allocator_t *allocator = axis2_allocator_init (NULL);
+    axis2_env_t *env = axis2_env_create (allocator);    
+
+    svc = axis2_svc_create(&env);
+    axis2_param_t *param = NULL;
+    axis2_char_t *param_name = NULL;
+    axis2_char_t *param_value = NULL;
+    axis2_param_container_t *param_container = NULL;
+
+    param_name = "damitha";
+    param_value = "kumarage";
+    param = axis2_param_create(&env, NULL, NULL);
+    AXIS2_PARAM_SET_NAME(param, &env, param_name);
+    AXIS2_PARAM_SET_VALUE(param, &env, param_value);
+    AXIS2_SVC_ADD_PARAM(svc, env, param);
+    
+
+    CuAssertIntEquals(tc, expected, actual);
+    
+}
+
 struct axis2_module_desc *create_module_desc(axis2_env_t **env) 
 {
     struct axis2_op *op = NULL;