axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From din...@apache.org
Subject svn commit: r596188 - in /webservices/axis2/trunk/c/samples/server/echo: echo.c echo.h echo_skeleton.c
Date Mon, 19 Nov 2007 03:47:24 GMT
Author: dinesh
Date: Sun Nov 18 19:47:24 2007
New Revision: 596188

URL: http://svn.apache.org/viewvc?rev=596188&view=rev
Log:
revert the samples to older version. 

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

Modified: webservices/axis2/trunk/c/samples/server/echo/echo.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/echo/echo.c?rev=596188&r1=596187&r2=596188&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/server/echo/echo.c (original)
+++ webservices/axis2/trunk/c/samples/server/echo/echo.c Sun Nov 18 19:47:24 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -22,6 +23,10 @@
     const axutil_env_t * env,
     axis2_char_t * text);
 
+void set_custom_error(
+    const axutil_env_t * env,
+    axis2_char_t * error_message);
+
 axiom_node_t *
 axis2_echo_echo(
     const axutil_env_t * env,
@@ -40,24 +45,21 @@
      */
     if (!node)                  /* 'echoString' node */
     {
-		AXIS2_ERROR_SET (env->error, USER_ERROR_NO_1, AXIS2_FAILURE);
-		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "%s", AXIS2_ERROR_GET_MESSAGE (env->error));
+        set_custom_error(env, "Invalid payload; echoString node is NULL");
         return NULL;
     }
 
     text_parent_node = axiom_node_get_first_element(node, env);
     if (!text_parent_node)
     {
-		AXIS2_ERROR_SET (env->error, USER_ERROR_NO_2, AXIS2_FAILURE);
-		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "%s", AXIS2_ERROR_GET_MESSAGE (env->error));
+        set_custom_error(env, "Invalid payload; text node is NULL");
         return NULL;
     }
 
     text_node = axiom_node_get_first_child(text_parent_node, env);
     if (!text_node)             /* actual text to echo */
     {
-      	AXIS2_ERROR_SET (env->error, USER_ERROR_NO_3, AXIS2_FAILURE);
-		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "%s", AXIS2_ERROR_GET_MESSAGE (env->error));
+        set_custom_error(env, "Invalid payload; text to be echoed is NULL");
         return NULL;
     }
 
@@ -74,12 +76,10 @@
     }
     else
     {
-        AXIS2_ERROR_SET (env->error, USER_ERROR_NO_4, AXIS2_FAILURE);
-		AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "%s", AXIS2_ERROR_GET_MESSAGE (env->error));
+        set_custom_error(env, "Invalid payload; invalid XML in request");
         return NULL;
     }
-	
-	
+
     return ret_node;
 }
 
@@ -106,3 +106,11 @@
     return echo_om_node;
 }
 
+void
+set_custom_error(
+    const axutil_env_t * env,
+    axis2_char_t * error_message)
+{
+    axutil_error_set_error_message(env->error, error_message);
+    AXIS2_ERROR_SET(env->error, AXIS2_ERROR_LAST + 1, AXIS2_FAILURE);
+}

Modified: webservices/axis2/trunk/c/samples/server/echo/echo.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/echo/echo.h?rev=596188&r1=596187&r2=596188&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/server/echo/echo.h (original)
+++ webservices/axis2/trunk/c/samples/server/echo/echo.h Sun Nov 18 19:47:24 2007
@@ -25,13 +25,6 @@
 #include <axiom_node.h>
 #include <axiom_element.h>
 
-
-/* USER_ERROR_NO_# defined wrt USER_ERROR_CODES_START*/
-#define USER_ERROR_NO_1 (USER_ERROR_CODES_START + 1) 
-#define USER_ERROR_NO_2 (USER_ERROR_CODES_START + 2)
-#define USER_ERROR_NO_3 (USER_ERROR_CODES_START + 3)
-#define USER_ERROR_NO_4 (USER_ERROR_CODES_START + 4)
-
 axiom_node_t *axis2_echo_echo(
     const axutil_env_t * env,
     axiom_node_t * node);

Modified: webservices/axis2/trunk/c/samples/server/echo/echo_skeleton.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/echo/echo_skeleton.c?rev=596188&r1=596187&r2=596188&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/server/echo/echo_skeleton.c (original)
+++ webservices/axis2/trunk/c/samples/server/echo/echo_skeleton.c Sun Nov 18 19:47:24 2007
@@ -21,15 +21,10 @@
 #include <axis2_msg_ctx.h>
 #include <stdio.h>
 
-
 int AXIS2_CALL echo_free(
     axis2_svc_skeleton_t * svc_skeleton,
     const axutil_env_t * env);
 
-extern axis2_char_t *axutil_error_messages[AXUTIL_ERROR_MAX];
-
-void static user_defined_errors_init ();
-
 /*
  * This method invokes the right service method
  */
@@ -78,7 +73,6 @@
     const axutil_env_t * env)
 {
     /* Any initialization stuff of echo service should go here */
-	
     return AXIS2_SUCCESS;
 }
 
@@ -98,7 +92,7 @@
      * To see how to deal with multiple impl methods, have a look at the
      * math sample.
      */
-	user_defined_errors_init ();
+
     return axis2_echo_echo(env, node);
 }
 
@@ -172,17 +166,4 @@
         status = AXIS2_SVC_SKELETON_FREE(inst, env);
     }
     return status;
-}
-
-void 
-user_defined_errors_init ()
-{
-	/*
-	 * USER_ERROR_NO_1, USER_ERROR_2, USER_ERROR_NO_3 in echo.h
-	 */
-	 
-	axutil_error_messages[USER_ERROR_NO_1] = "Invalid payload; echoString node is NULL";
-	axutil_error_messages[USER_ERROR_NO_2] = "Invalid payload; text node is NULL";
-	axutil_error_messages[USER_ERROR_NO_3] = "Invalid payload; text to be echoed is NULL";
-	axutil_error_messages[USER_ERROR_NO_4] = "Invalid payload; invalid XML in request";
 }



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


Mime
View raw message