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/07/20 08:15:34 UTC

svn commit: r423798 - in /webservices/axis2/trunk/c: include/ modules/core/context/ modules/core/description/ samples/ util/include/ util/src/ woden/samples/wsdl10/

Author: damitha
Date: Wed Jul 19 23:15:33 2006
New Revision: 423798

URL: http://svn.apache.org/viewvc?rev=423798&view=rev
Log:
Added get_properties method to ctx. 

Modified:
    webservices/axis2/trunk/c/include/axis2_ctx.h
    webservices/axis2/trunk/c/modules/core/context/ctx.c
    webservices/axis2/trunk/c/modules/core/description/client_utils.c
    webservices/axis2/trunk/c/samples/configure.ac
    webservices/axis2/trunk/c/util/include/axis2_error.h
    webservices/axis2/trunk/c/util/include/axis2_property.h
    webservices/axis2/trunk/c/util/src/error.c
    webservices/axis2/trunk/c/woden/samples/wsdl10/test_wsdl1.c

Modified: webservices/axis2/trunk/c/include/axis2_ctx.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_ctx.h?rev=423798&r1=423797&r2=423798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_ctx.h (original)
+++ webservices/axis2/trunk/c/include/axis2_ctx.h Wed Jul 19 23:15:33 2006
@@ -105,6 +105,15 @@
                 get_persistent_map)(
                     struct axis2_ctx *ctx,
                     const axis2_env_t *env);
+	/**
+	 * @param ctx pointer to context struct
+	 * @param env pointer to environment struct
+	 */
+        axis2_hash_t* (AXIS2_CALL *
+                get_properties)(
+                    struct axis2_ctx *ctx,
+                    const axis2_env_t *env);
+
 
         /**
          * Deallocate memory
@@ -174,6 +183,11 @@
     @sa axis2_ctx_ops#get_non_persistant_map */
 #define AXIS2_CTX_GET_NON_PERSISTANT_MAP(ctx, env) \
     ((ctx)->ops->get_non_persistent_map(ctx, env))
+
+/** Get properties.
+    @sa axis2_ctx_ops#get_properties */
+#define AXIS2_CTX_GET_PROPERTIES(ctx, env) \
+    ((ctx)->ops->get_properties(ctx, env))
 
 /** Get persistant map.
     @sa axis2_ctx_ops#get_persistant_map */

Modified: webservices/axis2/trunk/c/modules/core/context/ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/context/ctx.c?rev=423798&r1=423797&r2=423798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/ctx.c Wed Jul 19 23:15:33 2006
@@ -39,6 +39,10 @@
                         const axis2_char_t *key, 
                         const axis2_bool_t persistent);
 
+axis2_hash_t* AXIS2_CALL 
+axis2_ctx_get_properties(struct axis2_ctx *ctx, 
+                        const axis2_env_t *env);
+
 axis2_status_t AXIS2_CALL 
 axis2_ctx_set_property(struct axis2_ctx *ctx, 
                        const axis2_env_t *env, 
@@ -114,6 +118,7 @@
     }
 
     ctx_impl->ctx.ops->get_property = axis2_ctx_get_property;        
+    ctx_impl->ctx.ops->get_properties = axis2_ctx_get_properties;        
     ctx_impl->ctx.ops->set_property = axis2_ctx_set_property;
     ctx_impl->ctx.ops->get_non_persistent_map = axis2_ctx_get_non_persistent_map;
     ctx_impl->ctx.ops->get_persistent_map = axis2_ctx_get_persistent_map;
@@ -183,6 +188,20 @@
     
     return ret;
 }
+
+axis2_hash_t* AXIS2_CALL 
+axis2_ctx_get_properties(struct axis2_ctx *ctx, 
+                        const axis2_env_t *env) 
+{
+    axis2_ctx_impl_t *ctx_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
+    
+    return ctx_impl->non_persistent_map;
+}
+
 
 axis2_hash_t* AXIS2_CALL 
 axis2_ctx_get_non_persistent_map(struct axis2_ctx *ctx, 

Modified: webservices/axis2/trunk/c/modules/core/description/client_utils.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/description/client_utils.c?rev=423798&r1=423797&r2=423798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/client_utils.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/client_utils.c Wed Jul 19 23:15:33 2006
@@ -76,7 +76,7 @@
     axis2_bool_t svc_found = AXIS2_FALSE;
     axis2_bool_t endpoint_found = AXIS2_FALSE;
     axis2_qname_t *svc_qname = NULL;
-    int i = 0, size = 0;
+    int i = 0;
     axis2_array_list_t *wsdl_svcs = NULL;
     axis2_array_list_t *endpoints = NULL;
     axis2_array_list_t *binding_ops = NULL;
@@ -92,13 +92,16 @@
     spec = WODEN_RESOLVER_GET_SPEC(resolver, env);
     if(WODEN_WSDL20 == spec)
     {
-
+        int no_of_svcs = 0;
+        int no_of_endpoints = 0;
+        int no_of_bindings = 0;
+        int no_of_interface_msg_refs = 0;
         axis2_svc = axis2_svc_create(env);
         
         wsdl_svcs = WODEN_DESC_GET_SVCS(desc, env);
         if(wsdl_svcs)
-            size = AXIS2_ARRAY_LIST_SIZE(wsdl_svcs, env);
-        for(i = 0; i < size; i++)
+            no_of_svcs = AXIS2_ARRAY_LIST_SIZE(wsdl_svcs, env);
+        for(i = 0; i < no_of_svcs; i++)
         {
             wsdl_svc = AXIS2_ARRAY_LIST_GET(wsdl_svcs, env, i);
             svc_qname = WODEN_SVC_GET_QNAME(wsdl_svc, env);
@@ -123,8 +126,8 @@
         }
         endpoints = WODEN_SVC_GET_ENDPOINTS(wsdl_svc, env);
         if(endpoints)
-            size = AXIS2_ARRAY_LIST_SIZE(endpoints, env);
-        for(i = 0; i < size; i++)
+            no_of_endpoints = AXIS2_ARRAY_LIST_SIZE(endpoints, env);
+        for(i = 0; i < no_of_endpoints; i++)
         {
             endpoint = AXIS2_ARRAY_LIST_GET(endpoints, env, i);
             ep_ncname = WODEN_ENDPOINT_GET_NAME(endpoint, env);
@@ -154,12 +157,13 @@
             AXIS2_OPTIONS_SET_TO(options, env, endpoint_ref);
         }
 
-        binding = WODEN_ENDPOINT_GET_BINDING(endpoint, env);
+        if(endpoint)
+            binding = WODEN_ENDPOINT_GET_BINDING(endpoint, env);
         if(binding)
             binding_ops = WODEN_BINDING_GET_BINDING_OPS(binding, env);
         if(binding_ops)
-            size = AXIS2_ARRAY_LIST_SIZE(binding_ops, env);
-        for(i = 0; i < size; i++)
+            no_of_bindings = AXIS2_ARRAY_LIST_SIZE(binding_ops, env);
+        for(i = 0; i < no_of_bindings; i++)
         {
             void *binding_op = NULL;
             void *interface_op = NULL;
@@ -168,7 +172,7 @@
             axis2_uri_t *soap_action_uri = NULL;
             axis2_array_list_t *interface_msg_refs = NULL;
             axis2_array_list_t *ext_elements = NULL;
-            int i = 0, size = 0;
+            int i = 0;
             axis2_bool_t in = AXIS2_FALSE;
             axis2_bool_t out = AXIS2_FALSE;
             axis2_qname_t *op_qname = NULL;
@@ -179,8 +183,9 @@
             interface_msg_refs = WODEN_INTERFACE_OP_GET_INTERFACE_MSG_REFS(
                     interface_op, env);
             if(interface_msg_refs)
-                size = AXIS2_ARRAY_LIST_SIZE(interface_msg_refs, env);
-            for(i = 0; i < size; i++)
+                no_of_interface_msg_refs = AXIS2_ARRAY_LIST_SIZE(
+                        interface_msg_refs, env);
+            for(i = 0; i < no_of_interface_msg_refs; i++)
             {
                 void *interface_msg_ref = NULL; 
                 void *direction = NULL;
@@ -214,11 +219,15 @@
     {
 
         axis2_svc = axis2_svc_create(env);
+        int no_of_svcs = 0;
+        int no_of_endpoints = 0;
+        int no_of_bindings = 0;
+        int no_of_interface_msg_refs = 0;
         
         wsdl_svcs = WODEN_WSDL10_DESC_GET_SVCS(desc, env);
         if(wsdl_svcs)
-            size = AXIS2_ARRAY_LIST_SIZE(wsdl_svcs, env);
-        for(i = 0; i < size; i++)
+            no_of_svcs = AXIS2_ARRAY_LIST_SIZE(wsdl_svcs, env);
+        for(i = 0; i < no_of_svcs; i++)
         {
             wsdl_svc = AXIS2_ARRAY_LIST_GET(wsdl_svcs, env, i);
             svc_qname = WODEN_SVC_GET_QNAME(wsdl_svc, env);
@@ -243,8 +252,8 @@
         }
         endpoints = WODEN_SVC_GET_ENDPOINTS(wsdl_svc, env);
         if(endpoints)
-            size = AXIS2_ARRAY_LIST_SIZE(endpoints, env);
-        for(i = 0; i < size; i++)
+            no_of_endpoints = AXIS2_ARRAY_LIST_SIZE(endpoints, env);
+        for(i = 0; i < no_of_endpoints; i++)
         {
             endpoint = AXIS2_ARRAY_LIST_GET(endpoints, env, i);
             ep_ncname = WODEN_WSDL10_ENDPOINT_GET_NAME(endpoint, env);
@@ -273,13 +282,13 @@
             endpoint_ref = axis2_endpoint_ref_create(env, address);
             AXIS2_OPTIONS_SET_TO(options, env, endpoint_ref);
         }
-
-        binding = WODEN_WSDL10_ENDPOINT_GET_BINDING(endpoint, env);
+        if(endpoint)
+            binding = WODEN_WSDL10_ENDPOINT_GET_BINDING(endpoint, env);
         if(binding)
             binding_ops = WODEN_BINDING_GET_BINDING_OPS(binding, env);
         if(binding_ops)
-            size = AXIS2_ARRAY_LIST_SIZE(binding_ops, env);
-        for(i = 0; i < size; i++)
+            no_of_bindings = AXIS2_ARRAY_LIST_SIZE(binding_ops, env);
+        for(i = 0; i < no_of_bindings; i++)
         {
             void *binding_op = NULL;
             void *interface_op = NULL;
@@ -288,7 +297,7 @@
             axis2_uri_t *soap_action_uri = NULL;
             axis2_array_list_t *interface_msg_refs = NULL;
             axis2_array_list_t *ext_elements = NULL;
-            int i = 0, size = 0;
+            int i = 0;
             axis2_bool_t in = AXIS2_FALSE;
             axis2_bool_t out = AXIS2_FALSE;
             axis2_qname_t *op_qname = NULL;
@@ -299,8 +308,9 @@
             interface_msg_refs = WODEN_INTERFACE_OP_GET_INTERFACE_MSG_REFS(
                     interface_op, env);
             if(interface_msg_refs)
-                size = AXIS2_ARRAY_LIST_SIZE(interface_msg_refs, env);
-            for(i = 0; i < size; i++)
+                no_of_interface_msg_refs = AXIS2_ARRAY_LIST_SIZE(
+                        interface_msg_refs, env);
+            for(i = 0; i < no_of_interface_msg_refs; i++)
             {
                 void *interface_msg_ref = NULL; 
                 void *direction = NULL;

Modified: webservices/axis2/trunk/c/samples/configure.ac
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/configure.ac?rev=423798&r1=423797&r2=423798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/configure.ac (original)
+++ webservices/axis2/trunk/c/samples/configure.ac Wed Jul 19 23:15:33 2006
@@ -126,6 +126,7 @@
     server/mtom/Makefile \
     client/Makefile \
     client/echo/Makefile \
+    client/diclient/Makefile \
     client/math/Makefile \
     client/mtom/Makefile \
     client/mtom/resources/Makefile \

Modified: webservices/axis2/trunk/c/util/include/axis2_error.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/include/axis2_error.h?rev=423798&r1=423797&r2=423798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/include/axis2_error.h (original)
+++ webservices/axis2/trunk/c/util/include/axis2_error.h Wed Jul 19 23:15:33 2006
@@ -86,6 +86,8 @@
         AXIS2_ERROR_UNKNOWN_TRANSPORT,
         /* Unsupported SOAP style */
         AXIS2_ERROR_UNSUPPORTED_TYPE,
+        /* Options object is not set */
+        AXIS2_ERROR_OPTIONS_OBJECT_IS_NOT_SET,
         /*
          * Group - core:clientapi:diclient
          */
@@ -565,6 +567,17 @@
         */
     const axis2_char_t *(AXIS2_CALL *
     get_message)(
+    const struct axis2_error *error);
+      
+    /**
+     * This fucntion is supposed to be overridden in an extended error structure.
+     * For example in Sandesha error structure this fucntion is overridden so that
+     * errors of axis2 range call the get_message function of error struct but
+     * errors of sandesha2 range get the messages from an array of that struct.
+     * @return error message for the extended struct.
+     */
+    const axis2_char_t *(AXIS2_CALL *
+    get_extended_message)(
     const struct axis2_error *error);
       
        axis2_status_t  (AXIS2_CALL *set_error_number) (struct axis2_error *error

Modified: webservices/axis2/trunk/c/util/include/axis2_property.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/include/axis2_property.h?rev=423798&r1=423797&r2=423798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/include/axis2_property.h (original)
+++ webservices/axis2/trunk/c/util/include/axis2_property.h Wed Jul 19 23:15:33 2006
@@ -48,6 +48,9 @@
     free) (axis2_property_t *property, 
             const axis2_env_t *env);
 
+    /**
+     * Default scope is AXIS2_SCOPE_REQUEST
+     */
     axis2_status_t (AXIS2_CALL *
     set_scope) (axis2_property_t *property,
                 const axis2_env_t *env,

Modified: webservices/axis2/trunk/c/util/src/error.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/error.c?rev=423798&r1=423797&r2=423798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/error.c (original)
+++ webservices/axis2/trunk/c/util/src/error.c Wed Jul 19 23:15:33 2006
@@ -19,7 +19,7 @@
 
 const axis2_char_t * AXIS2_CALL 
 axis2_error_impl_get_message (const axis2_error_t *error);
-      
+
 axis2_status_t AXIS2_CALL
 axis2_error_impl_set_error_number (axis2_error_t *error, axis2_error_codes_t error_number);
 
@@ -65,6 +65,8 @@
         "Unknown Transport";
     axis2_error_messages[AXIS2_ERROR_UNSUPPORTED_TYPE] =
         "type is not supported";
+    axis2_error_messages[AXIS2_ERROR_OPTIONS_OBJECT_IS_NOT_SET] =
+        "Options object is not set";
     /* core:clientapi:diclient */
 
     /* core:context */
@@ -505,6 +507,7 @@
     }
 
     error->ops->get_message = axis2_error_impl_get_message;
+    error->ops->get_extended_message = axis2_error_impl_get_message;
     error->ops->set_error_number = axis2_error_impl_set_error_number;
     error->ops->set_status_code = axis2_error_impl_set_status_code;
     error->ops->get_status_code = axis2_error_impl_get_status_code;

Modified: webservices/axis2/trunk/c/woden/samples/wsdl10/test_wsdl1.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/samples/wsdl10/test_wsdl1.c?rev=423798&r1=423797&r2=423798&view=diff
==============================================================================
--- webservices/axis2/trunk/c/woden/samples/wsdl10/test_wsdl1.c (original)
+++ webservices/axis2/trunk/c/woden/samples/wsdl10/test_wsdl1.c Wed Jul 19 23:15:33 2006
@@ -83,6 +83,7 @@
     if (svc_list)
     {
         void *svc = NULL;
+        axis2_array_list_t *endpoints = NULL;
         svc = AXIS2_ARRAY_LIST_GET(svc_list, env, 0);
         if (svc)
         {
@@ -91,6 +92,7 @@
             {
                 printf("First service qname is %s\n", AXIS2_QNAME_TO_STRING(svc_qname, env));
             }
+            endpoints = WODEN_SVC_GET_ENDPOINTS(svc, env);
         }
     }
     binding_list = WODEN_WSDL10_DESC_ELEMENT_GET_BINDING_ELEMENTS(desc, env);



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