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 sa...@apache.org on 2006/01/26 05:32:36 UTC

svn commit: r372432 - in /webservices/axis2/trunk/c/test/server/echo: echo.c echo.h echo_skeleton.c

Author: samisa
Date: Wed Jan 25 20:32:30 2006
New Revision: 372432

URL: http://svn.apache.org/viewcvs?rev=372432&view=rev
Log:
Added the OM processing logic to get the service process in OM parameter comming in

Modified:
    webservices/axis2/trunk/c/test/server/echo/echo.c
    webservices/axis2/trunk/c/test/server/echo/echo.h
    webservices/axis2/trunk/c/test/server/echo/echo_skeleton.c

Modified: webservices/axis2/trunk/c/test/server/echo/echo.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/server/echo/echo.c?rev=372432&r1=372431&r2=372432&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/server/echo/echo.c (original)
+++ webservices/axis2/trunk/c/test/server/echo/echo.c Wed Jan 25 20:32:30 2006
@@ -18,7 +18,51 @@
 axis2_om_node_t *
 echo (axis2_om_node_t *node)
 {
-    printf("echoing the incoming node\n");
-	return node;
+    axis2_allocator_t *allocator = NULL;
+    axis2_env_t *env = NULL;
+    axis2_error_t *error = NULL;
+    axis2_log_t *axis_log     = NULL;
+
+    axis2_om_node_t *text_parent_node = NULL;
+    axis2_om_node_t *text_node = NULL;
+
+    allocator = axis2_allocator_init (NULL);
+    axis_log = axis2_log_create(allocator, NULL);
+    error = axis2_error_create(allocator);
+    env = axis2_env_create_with_error_log(allocator, error,  axis_log);
+                
+    
+    if (!node)
+    {
+        printf("Echo client ERROR: input parameter NULL\n");
+        return NULL;
+    }
+
+    text_parent_node = AXIS2_OM_NODE_GET_FIRST_CHILD(node, &env);
+    if (!text_parent_node)
+    {
+        printf("Echo client ERROR: invalid XML in request\n");
+        return node;
+    }
+    
+    text_node = AXIS2_OM_NODE_GET_FIRST_CHILD(text_parent_node, &env);
+    if (!text_node)
+    {
+        printf("Echo client ERROR: invalid XML in request\n");
+        return node;
+    }
+    
+    if (AXIS2_OM_NODE_GET_NODE_TYPE(text_node, &env) == AXIS2_OM_TEXT)
+    {
+        axis2_om_text_t *text = (axis2_om_text_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(text_node, &env);
+        if( text && AXIS2_OM_TEXT_GET_VALUE(text ,&env))
+            printf("Eching text value  %s \n", AXIS2_OM_TEXT_GET_VALUE(text,&env));
+    }
+    else
+    {
+        printf("Echo client ERROR: invalid XML in request\n");
+    }
+	
+    return node;
 }
 

Modified: webservices/axis2/trunk/c/test/server/echo/echo.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/server/echo/echo.h?rev=372432&r1=372431&r2=372432&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/server/echo/echo.h (original)
+++ webservices/axis2/trunk/c/test/server/echo/echo.h Wed Jan 25 20:32:30 2006
@@ -18,6 +18,9 @@
 
 
 #include <axis2_svc_skeleton.h>
+#include <axis2_log_default.h>
+#include <axis2_error_default.h>
+#include <axis2_om_text.h>
 #include <axis2_om_node.h>
 
 axis2_om_node_t *echo(axis2_om_node_t *node);

Modified: webservices/axis2/trunk/c/test/server/echo/echo_skeleton.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/server/echo/echo_skeleton.c?rev=372432&r1=372431&r2=372432&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/server/echo/echo_skeleton.c (original)
+++ webservices/axis2/trunk/c/test/server/echo/echo_skeleton.c Wed Jan 25 20:32:30 2006
@@ -82,7 +82,7 @@
         AXIS2_FREE((*env)->allocator, svc_skeleton);
         svc_skeleton = NULL;
     }
-    
+    return AXIS2_SUCCESS; 
 }
 
 /*
@@ -106,8 +106,6 @@
 int axis2_get_instance(struct axis2_svc_skeleton **inst,
                         axis2_env_t **env)
 {
-    axis2_status_t status = AXIS2_FAILURE;
-    
 	*inst = axis2_echo_create(env);
     /*if(NULL != *inst)
     {