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 se...@apache.org on 2008/03/07 16:07:21 UTC

svn commit: r634705 - in /webservices/axis2/trunk/c: include/axis2_svc.h src/core/deployment/svc_builder.c src/core/description/svc.c src/core/transport/http/util/http_transport_utils.c

Author: senaka
Date: Fri Mar  7 07:07:20 2008
New Revision: 634705

URL: http://svn.apache.org/viewvc?rev=634705&view=rev
Log:
Adding support for a default static WSDL path,
as a result of a discussion on the dev list, [1].

[1] http://marc.info/?l=axis-c-dev&m=120489679120417&w=2

Regards,
Senaka

Modified:
    webservices/axis2/trunk/c/include/axis2_svc.h
    webservices/axis2/trunk/c/src/core/deployment/svc_builder.c
    webservices/axis2/trunk/c/src/core/description/svc.c
    webservices/axis2/trunk/c/src/core/transport/http/util/http_transport_utils.c

Modified: webservices/axis2/trunk/c/include/axis2_svc.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_svc.h?rev=634705&r1=634704&r2=634705&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_svc.h (original)
+++ webservices/axis2/trunk/c/include/axis2_svc.h Fri Mar  7 07:07:20 2008
@@ -583,10 +583,10 @@
 
     /**
      * Get the static wsdl file of the services, which is in the
-     * service.xml, <wsdl> tag
+     * service.xml, wsdl_path parameter
      * @param svc pointer to service struct
      * @param env pointer to environment struct
-     * @return services description string
+     * @return static wsdl file location
      */
     AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
     axis2_svc_get_svc_wsdl_path(
@@ -604,6 +604,30 @@
         axis2_svc_t * svc,
         const axutil_env_t * env,
         const axis2_char_t * wsdl_path);
+
+    /**
+     * Get the folder path on disk of the services, which is in the
+     * service.xml
+     * @param svc pointer to service struct
+     * @param env pointer to environment struct
+     * @return folder path on disk
+     */
+    AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
+    axis2_svc_get_svc_folder_path(
+        const axis2_svc_t * svc,
+        const axutil_env_t * env);
+
+    /**
+     * Set the folder path of the service which is in service.xml
+     * @param svc pointer to service struct
+     * @param env pointer to environment struct
+     * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE 
+     */
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axis2_svc_set_svc_folder_path(
+        axis2_svc_t * svc,
+        const axutil_env_t * env,
+        const axis2_char_t * folder_path);
 
     /**
      * Gets the name of the file that holds the implementation of the 

Modified: webservices/axis2/trunk/c/src/core/deployment/svc_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/deployment/svc_builder.c?rev=634705&r1=634704&r2=634705&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/deployment/svc_builder.c (original)
+++ webservices/axis2/trunk/c/src/core/deployment/svc_builder.c Fri Mar  7 07:07:20 2008
@@ -308,6 +308,7 @@
     timestamp = axutil_file_get_timestamp(svc_folder, env);
     axutil_dll_desc_set_timestamp(dll_desc, env, timestamp);
     svc_folder_path = axutil_file_get_path(svc_folder, env);
+    axis2_svc_set_svc_folder_path(svc_builder->svc, env, svc_folder_path);
     dll_path = axutil_strcat(env, svc_folder_path, AXIS2_PATH_SEP_STR,
                              svc_dll_name, NULL);
     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "DLL path is : %s", dll_path);

Modified: webservices/axis2/trunk/c/src/core/description/svc.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/description/svc.c?rev=634705&r1=634704&r2=634705&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/description/svc.c (original)
+++ webservices/axis2/trunk/c/src/core/description/svc.c Fri Mar  7 07:07:20 2008
@@ -35,12 +35,15 @@
     /** to store module descriptions at deploy time parsing */
     axutil_array_list_t *module_list;
 
-    /* service description  */
+    /** service description  */
     axis2_char_t *svc_desc;
 
-    /*wsdl file path */
+    /** wsdl file path */
     axis2_char_t *wsdl_path;
 
+    /** service folder path */
+    axis2_char_t *folder_path;
+
     /**
      * WSDL related stuff
      */
@@ -134,6 +137,7 @@
     svc->filename = NULL;
     svc->svc_desc = NULL;
     svc->wsdl_path = NULL;
+    svc->folder_path = NULL;
     svc->last_update = 0;
     svc->param_container = NULL;
     svc->flow_container = NULL;
@@ -430,6 +434,18 @@
         svc->target_ns = NULL;
     }
 
+    if (svc->wsdl_path)
+    {
+        AXIS2_FREE(env->allocator, svc->wsdl_path);
+        svc->wsdl_path = NULL;
+    }
+
+    if (svc->folder_path)
+    {
+        AXIS2_FREE(env->allocator, svc->folder_path);
+        svc->folder_path = NULL;
+    }
+
     if (svc->target_ns_prefix)
     {
         AXIS2_FREE(env->allocator, svc->target_ns_prefix);
@@ -1463,7 +1479,26 @@
     const axis2_char_t * wsdl_path)
 {
     AXIS2_PARAM_CHECK(env->error, wsdl_path, AXIS2_FAILURE);
-    svc->wsdl_path = (axis2_char_t *) wsdl_path;
+    svc->wsdl_path = (axis2_char_t *) axutil_strdup(env, wsdl_path);
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
+axis2_svc_get_svc_folder_path(
+    const axis2_svc_t * svc,
+    const axutil_env_t * env)
+{
+    return svc->folder_path;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axis2_svc_set_svc_folder_path(
+    axis2_svc_t * svc,
+    const axutil_env_t * env,
+    const axis2_char_t * folder_path)
+{
+    AXIS2_PARAM_CHECK(env->error, folder_path, AXIS2_FAILURE);
+    svc->folder_path = (axis2_char_t *) axutil_strdup(env, folder_path);
     return AXIS2_SUCCESS;
 }
 

Modified: webservices/axis2/trunk/c/src/core/transport/http/util/http_transport_utils.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/util/http_transport_utils.c?rev=634705&r1=634704&r2=634705&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/util/http_transport_utils.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/util/http_transport_utils.c Fri Mar  7 07:07:20 2008
@@ -38,6 +38,7 @@
 #include <axis2_disp.h>
 #include <axis2_msg.h>
 #include <stdlib.h>
+#include <platforms/axutil_platform_auto_sense.h>
 
 #define AXIOM_MIME_BOUNDARY_BYTE 45
 
@@ -1490,9 +1491,16 @@
                                                                    env), env);
             if (!axutil_strcmp(svc_name, sname))
             {
-                wsdl_path =
-                    (axis2_char_t *) axis2_svc_get_svc_wsdl_path((axis2_svc_t *)
-                                                                 service, env);
+                wsdl_path = (axis2_char_t *) axutil_strdup(env, 
+                                axis2_svc_get_svc_wsdl_path((axis2_svc_t *)
+                                                            service, env));
+                if (!wsdl_path)
+                {
+                    wsdl_path = axutil_strcat(env, 
+                                    axis2_svc_get_svc_folder_path((axis2_svc_t *)
+                                     service, env), AXIS2_PATH_SEP_STR,
+                                    svc_name, ".wsdl", NULL);
+                }
                 break;
             }
 
@@ -1530,6 +1538,7 @@
             content[i] = '\0';
             wsdl_string = content;
         }
+        AXIS2_FREE(env->allocator, wsdl_path);
     }
     else
     {



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