ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r376187 - in /webservices/axis2/trunk/c: modules/xml/soap/soap_header.c samples/server/echo/echo_skeleton.c samples/server/math/math_skeleton.c
Date Thu, 09 Feb 2006 05:05:00 GMT
Author: nandika
Date: Wed Feb  8 21:04:59 2006
New Revision: 376187

URL: http://svn.apache.org/viewcvs?rev=376187&view=rev
Log:
error checking and calling convention added 

Modified:
    webservices/axis2/trunk/c/modules/xml/soap/soap_header.c
    webservices/axis2/trunk/c/samples/server/echo/echo_skeleton.c
    webservices/axis2/trunk/c/samples/server/math/math_skeleton.c

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_header.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_header.c?rev=376187&r1=376186&r2=376187&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_header.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_header.c Wed Feb  8 21:04:59 2006
@@ -270,7 +270,7 @@
     
     header_block_node = AXIS2_SOAP_HEADER_BLOCK_GET_BASE_NODE(
                             header_block, env);
-    
+        
     AXIS2_OM_NODE_SET_BUILD_STATUS(header_block_node, env, AXIS2_TRUE);
     sprintf(key,"%d", header_impl->hbnumber++);
     if(header_impl->header_blocks)
@@ -487,29 +487,38 @@
     void *hb =  NULL;
     AXIS2_PARAM_CHECK((*env)->error, ns_uri, NULL);
     header_impl = AXIS2_INTF_TO_IMPL(header);
+    if(!(header_impl->header_blocks))
+        return NULL;
+    
     header_block_list = axis2_array_list_create(env, 10);
+    if(!header_block_list)
+        return NULL;
+        
     for(hash_index = axis2_hash_first(header_impl->header_blocks, env);
             hash_index; hash_index = axis2_hash_next( env, hash_index))
     {
         axis2_hash_this(hash_index, NULL, NULL, &hb);
-        header_block = (axis2_soap_header_block_t*)hb;
-        header_block_om_node = AXIS2_SOAP_HEADER_BLOCK_GET_BASE_NODE(header_block, env);
-        header_block_om_ele  = (axis2_om_element_t *)
-            AXIS2_OM_NODE_GET_DATA_ELEMENT(header_block_om_node, env);
-        ns = AXIS2_OM_ELEMENT_GET_NAMESPACE(header_block_om_ele, env);
-        hb_namespace_uri = AXIS2_OM_NAMESPACE_GET_URI(ns, env);
-        if(AXIS2_STRCMP(hb_namespace_uri, ns_uri) == 0)
+        if(hb)
         {
-            AXIS2_ARRAY_LIST_ADD(header_block_list, env, header_block);
-            found++;            
-        }            
+            header_block = (axis2_soap_header_block_t*)hb;
+            header_block_om_node = AXIS2_SOAP_HEADER_BLOCK_GET_BASE_NODE(header_block, env);
+            header_block_om_ele  = (axis2_om_element_t *)
+                AXIS2_OM_NODE_GET_DATA_ELEMENT(header_block_om_node, env);
+            ns = AXIS2_OM_ELEMENT_GET_NAMESPACE(header_block_om_ele, env);
+            hb_namespace_uri = AXIS2_OM_NAMESPACE_GET_URI(ns, env);
+            if(AXIS2_STRCMP(hb_namespace_uri, ns_uri) == 0)
+            {
+                AXIS2_ARRAY_LIST_ADD(header_block_list, env, header_block);
+                found++;            
+            }            
         
-        hb = NULL;
-        header_block = NULL;
-        header_block_om_ele = NULL;
-        header_block_om_node = NULL;
-        ns = NULL;
-        hb_namespace_uri = NULL;
+            hb = NULL;
+            header_block = NULL;
+            header_block_om_ele = NULL;
+            header_block_om_node = NULL;
+            ns = NULL;
+            hb_namespace_uri = NULL;
+        }            
     }
     if(found > 0)
     {

Modified: webservices/axis2/trunk/c/samples/server/echo/echo_skeleton.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/samples/server/echo/echo_skeleton.c?rev=376187&r1=376186&r2=376187&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/server/echo/echo_skeleton.c (original)
+++ webservices/axis2/trunk/c/samples/server/echo/echo_skeleton.c Wed Feb  8 21:04:59 2006
@@ -17,19 +17,22 @@
 #include "echo.h"
 #include <axis2_array_list.h>
 
-int 
+int AXIS2_CALL
 echo_free(axis2_svc_skeleton_t *svc_skeleton,
             axis2_env_t **env);
 
 /*
  * This method invokes the right service method 
  */
-axis2_om_node_t *echo_invoke(axis2_svc_skeleton_t *svc_skeleton,
-                                    axis2_env_t **env,
-                                    axis2_om_node_t *node);
-
-int echo_init(axis2_svc_skeleton_t *svc_skeleton,
-                        axis2_env_t **env);
+axis2_om_node_t* AXIS2_CALL 
+echo_invoke(axis2_svc_skeleton_t *svc_skeleton,
+            axis2_env_t **env,
+            axis2_om_node_t *node);
+            
+
+int AXIS2_CALL 
+echo_init(axis2_svc_skeleton_t *svc_skeleton,
+          axis2_env_t **env);
 
 
 axis2_svc_skeleton_t *
@@ -51,7 +54,8 @@
     return svc_skeleton;
 }
 
-int echo_init(axis2_svc_skeleton_t *svc_skeleton,
+int AXIS2_CALL
+echo_init(axis2_svc_skeleton_t *svc_skeleton,
                         axis2_env_t **env)
 {
     svc_skeleton->func_array = axis2_array_list_create(env, 0);
@@ -61,7 +65,7 @@
     return AXIS2_SUCCESS;
 }
 
-int 
+int AXIS2_CALL
 echo_free(axis2_svc_skeleton_t *svc_skeleton,
             axis2_env_t **env)
 {
@@ -88,9 +92,10 @@
 /*
  * This method invokes the right service method 
  */
-axis2_om_node_t *echo_invoke(axis2_svc_skeleton_t *svc_skeleton,
-                                    axis2_env_t **env,
-                                    axis2_om_node_t *node)
+axis2_om_node_t* AXIS2_CALL
+echo_invoke(axis2_svc_skeleton_t *svc_skeleton,
+            axis2_env_t **env,
+            axis2_om_node_t *node)
 {
     /* Depending on the function name invoke the
      *  corresponding echo method
@@ -103,8 +108,9 @@
  * Following block distinguish the exposed part of the dll.
  */
 
-int axis2_get_instance(struct axis2_svc_skeleton **inst,
-                        axis2_env_t **env)
+AXIS2_EXPORT int 
+axis2_get_instance(axis2_svc_skeleton_t **inst,
+                   axis2_env_t **env)
 {
 	*inst = axis2_echo_create(env);
     /*if(NULL != *inst)
@@ -119,8 +125,9 @@
     return AXIS2_SUCCESS;
 }
 
-int axis2_remove_instance(axis2_svc_skeleton_t *inst,
-                            axis2_env_t **env)
+AXIS2_EXPORT int 
+axis2_remove_instance(axis2_svc_skeleton_t *inst,
+                      axis2_env_t **env)
 {
     axis2_status_t status = AXIS2_FAILURE;
 	if (inst)

Modified: webservices/axis2/trunk/c/samples/server/math/math_skeleton.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/samples/server/math/math_skeleton.c?rev=376187&r1=376186&r2=376187&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/server/math/math_skeleton.c (original)
+++ webservices/axis2/trunk/c/samples/server/math/math_skeleton.c Wed Feb  8 21:04:59 2006
@@ -17,22 +17,23 @@
 #include "math.h"
 #include <axis2_array_list.h>
 
-int 
+int AXIS2_CALL
 math_free(axis2_svc_skeleton_t *svc_skeleton,
-            axis2_env_t **env);
+          axis2_env_t **env);
 
 /*
  * This method invokes the right service method 
  */
-axis2_om_node_t *math_invoke(axis2_svc_skeleton_t *svc_skeleton,
-                                    axis2_env_t **env,
-                                    axis2_om_node_t *node);
+axis2_om_node_t* AXIS2_CALL 
+math_invoke(axis2_svc_skeleton_t *svc_skeleton,
+            axis2_env_t **env,
+            axis2_om_node_t *node);
 
-int math_init(axis2_svc_skeleton_t *svc_skeleton,
+int AXIS2_CALL math_init(axis2_svc_skeleton_t *svc_skeleton,
                         axis2_env_t **env);
 
 
-axis2_svc_skeleton_t *
+AXIS2_DECLARE(axis2_svc_skeleton_t *)
 axis2_math_create(axis2_env_t **env)
 {
     axis2_svc_skeleton_t *svc_skeleton = NULL;
@@ -51,7 +52,8 @@
     return svc_skeleton;
 }
 
-int math_init(axis2_svc_skeleton_t *svc_skeleton,
+int AXIS2_CALL
+math_init(axis2_svc_skeleton_t *svc_skeleton,
                         axis2_env_t **env)
 {
     svc_skeleton->func_array = axis2_array_list_create(env, 0);
@@ -64,7 +66,7 @@
     return AXIS2_SUCCESS;
 }
 
-int 
+int AXIS2_CALL
 math_free(axis2_svc_skeleton_t *svc_skeleton,
             axis2_env_t **env)
 {
@@ -91,9 +93,10 @@
 /*
  * This method invokes the right service method 
  */
-axis2_om_node_t *math_invoke(axis2_svc_skeleton_t *svc_skeleton,
-                                    axis2_env_t **env,
-                                    axis2_om_node_t *node)
+axis2_om_node_t* AXIS2_CALL
+math_invoke(axis2_svc_skeleton_t *svc_skeleton,
+            axis2_env_t **env,
+            axis2_om_node_t *node)
 {
     /* Depending on the function name invoke the
      *  corresponding math method
@@ -132,7 +135,7 @@
  * Following block distinguish the exposed part of the dll.
  */
 
-int axis2_get_instance(struct axis2_svc_skeleton **inst,
+AXIS2_EXPORT int axis2_get_instance(struct axis2_svc_skeleton **inst,
                         axis2_env_t **env)
 {
 	*inst = axis2_math_create(env);
@@ -148,7 +151,7 @@
     return AXIS2_SUCCESS;
 }
 
-int axis2_remove_instance(axis2_svc_skeleton_t *inst,
+AXIS2_EXPORT int axis2_remove_instance(axis2_svc_skeleton_t *inst,
                             axis2_env_t **env)
 {
     axis2_status_t status = AXIS2_FAILURE;



Mime
View raw message