You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2007/11/18 16:50:19 UTC

svn commit: r596094 - in /webservices/axis2/scratch/c/dinesh/axis2c-762/src/core: clientapi/svc_client.c deployment/conf_init.c deployment/dep_engine.c

Author: dinesh
Date: Sun Nov 18 07:50:18 2007
New Revision: 596094

URL: http://svn.apache.org/viewvc?rev=596094&view=rev
Log:
using svc_client with axis2.xml , which has pointers to modules directory and libs directory

Modified:
    webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/clientapi/svc_client.c
    webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/deployment/conf_init.c
    webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/deployment/dep_engine.c

Modified: webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/clientapi/svc_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/clientapi/svc_client.c?rev=596094&r1=596093&r2=596094&view=diff
==============================================================================
--- webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/clientapi/svc_client.c (original)
+++ webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/clientapi/svc_client.c Sun Nov 18 07:50:18 2007
@@ -247,7 +247,8 @@
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-
+    
+    
     svc_client->svc = NULL;
     svc_client->conf = NULL;
     svc_client->conf_ctx = NULL;
@@ -285,8 +286,7 @@
     }
     else
     {
-        if (!
-            (svc_client->svc =
+        if (!(svc_client->svc =
              axis2_svc_client_create_annonymous_svc(svc_client, env)))
         {
             axis2_svc_client_free(svc_client, env);

Modified: webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/deployment/conf_init.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/deployment/conf_init.c?rev=596094&r1=596093&r2=596094&view=diff
==============================================================================
--- webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/deployment/conf_init.c (original)
+++ webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/deployment/conf_init.c Sun Nov 18 07:50:18 2007
@@ -25,6 +25,8 @@
 #include <axis2_dep_engine.h>
 #include <axis2_module.h>
 
+#define DEFAULT_REPO_PATH "."
+
 axis2_status_t AXIS2_CALL axis2_init_modules(
     const axutil_env_t * env,
     axis2_conf_ctx_t * conf_ctx);
@@ -164,16 +166,48 @@
     axis2_dep_engine_t *dep_engine = NULL;
     axis2_conf_t *conf = NULL;
     axis2_phase_resolver_t *phase_resolver = NULL;
+    axis2_status_t status;
+    unsigned int len = 0;
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    dep_engine = axis2_dep_engine_create(env);
+    /* building conf using axis2.xml, in that case we check whether
+     * last 9 characters of the axis2_home equals to the "axis2.xml"
+     * else treat it as a directory 
+     */
+
+    status = axutil_file_handler_access (axis2_home, AXIS2_R_OK);
+	if (status == AXIS2_SUCCESS)
+	{
+		len = strlen (axis2_home);
+		if (!strcmp ((axis2_home + (len - 9)), "axis2.xml"))
+		{
+            dep_engine = axis2_dep_engine_create_with_axis2_xml (env, 
+                                                                 axis2_home);
+		}
+        else
+        {
+            dep_engine = axis2_dep_engine_create(env);
+        }
+	}
+	else
+	{
+		AXIS2_LOG_WARNING (env->log, AXIS2_LOG_SI, "provided repo path %s is " 
+						   "not exsist or no permissions to read, set "
+						   "axis2_home to DEFAULT_REPO_PATH", axis2_home);
+		axis2_home = DEFAULT_REPO_PATH;
+        dep_engine = axis2_dep_engine_create(env);
+	}
+
+
     if (!dep_engine)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
                         "dep engine create with repos name failed, dep_engine value is NULL");
         return NULL;
     }
+
+
 
     conf = axis2_dep_engine_load_client(dep_engine, env, axis2_home);
     if (!conf)

Modified: webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/deployment/dep_engine.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/deployment/dep_engine.c?rev=596094&r1=596093&r2=596094&view=diff
==============================================================================
--- webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/deployment/dep_engine.c (original)
+++ webservices/axis2/scratch/c/dinesh/axis2c-762/src/core/deployment/dep_engine.c Sun Nov 18 07:50:18 2007
@@ -822,35 +822,46 @@
 {
     axis2_bool_t is_repos_exist = AXIS2_FALSE;
     axis2_status_t status = AXIS2_FAILURE;
+    axis2_bool_t flag = AXIS2_FALSE;
 
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, client_home, NULL);
 
-    dep_engine->axis2_repos = axutil_strdup(env, client_home);
-    if (!dep_engine->axis2_repos)
-    {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;
-    }
-    if (client_home && 0 != axutil_strcmp("", client_home))
+    flag = axis2_dep_engine_get_file_flag (dep_engine, env);
+
+    if (flag == AXIS2_FALSE)
     {
-        status =
-            axis2_dep_engine_check_client_home(dep_engine, env, client_home);
-        if (AXIS2_SUCCESS == status)
+        dep_engine->axis2_repos = axutil_strdup(env, client_home);
+        if (!dep_engine->axis2_repos)
+        {
+            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+            return NULL;
+        }
+        if (client_home && 0 != axutil_strcmp("", client_home))
+        {
+            status =
+                axis2_dep_engine_check_client_home(dep_engine, env, client_home);
+            if (AXIS2_SUCCESS == status)
+            {
+                is_repos_exist = AXIS2_TRUE;
+            }
+        }
+        else
         {
-            is_repos_exist = AXIS2_TRUE;
+            dep_engine->conf_name =
+                axutil_strdup(env, AXIS2_CONFIGURATION_RESOURCE);
+            if (!dep_engine->conf_name)
+            {
+                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+                return NULL;
+            }
         }
     }
     else
     {
-        dep_engine->conf_name =
-            axutil_strdup(env, AXIS2_CONFIGURATION_RESOURCE);
-        if (!dep_engine->conf_name)
-        {
-            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-            return NULL;
-        }
+        is_repos_exist = AXIS2_TRUE;
     }
+
     dep_engine->conf = axis2_conf_create(env);
     if (!dep_engine->conf)
     {
@@ -874,6 +885,9 @@
       parameters in axis2 xml.
     */
 
+	axis2_conf_set_axis2_flag (dep_engine->conf, env, dep_engine->file_flag);
+	axis2_conf_set_axis2_xml (dep_engine->conf, env, dep_engine->conf_name);
+
     status = axis2_conf_builder_populate_conf(dep_engine->conf_builder, env);
     if (AXIS2_SUCCESS != status)
     {
@@ -881,6 +895,15 @@
         dep_engine->conf = NULL;
         return NULL;
     }
+
+    status = axis2_dep_engine_set_svc_and_module_dir_path (dep_engine, env);
+    if (AXIS2_SUCCESS != status)
+    {
+        axis2_conf_free(dep_engine->conf, env);
+        dep_engine->conf = NULL;
+        return NULL;
+    }
+
 
     if (AXIS2_TRUE == is_repos_exist)
     {



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