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 sh...@apache.org on 2009/08/18 12:15:53 UTC

svn commit: r805347 [15/31] - in /webservices/axis2/trunk/c/src: core/addr/ core/clientapi/ core/context/ core/deployment/ core/description/ core/engine/ core/phaseresolver/ core/receivers/ core/transport/amqp/receiver/ core/transport/amqp/receiver/qpi...

Modified: webservices/axis2/trunk/c/src/core/engine/soap_body_disp.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/engine/soap_body_disp.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/engine/soap_body_disp.c (original)
+++ webservices/axis2/trunk/c/src/core/engine/soap_body_disp.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -26,10 +25,10 @@
 #include <axiom_soap_envelope.h>
 #include <axiom_soap_body.h>
 
-const axis2_char_t *AXIS2_SOAP_MESSAGE_BODY_DISP_NAME =
-    "soap_message_body_based_dispatcher";
+const axis2_char_t *AXIS2_SOAP_MESSAGE_BODY_DISP_NAME = "soap_message_body_based_dispatcher";
 
-axis2_status_t AXIS2_CALL axis2_soap_body_disp_invoke(
+axis2_status_t AXIS2_CALL
+axis2_soap_body_disp_invoke(
     axis2_handler_t * handler,
     const axutil_env_t * env,
     struct axis2_msg_ctx *msg_ctx);
@@ -51,22 +50,19 @@
     axis2_handler_t *handler = NULL;
     axutil_string_t *name = NULL;
 
-    name = axutil_string_create_const(env,
-                                      (axis2_char_t **) &
-                                      AXIS2_SOAP_MESSAGE_BODY_DISP_NAME);
+    name = axutil_string_create_const(env, (axis2_char_t **)&AXIS2_SOAP_MESSAGE_BODY_DISP_NAME);
 
     disp = axis2_disp_create(env, name);
-    if (!disp)
+    if(!disp)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
     handler = axis2_disp_get_base(disp, env);
-    if (!handler)
+    if(!handler)
     {
-        AXIS2_ERROR_SET(env->error,
-                        AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HANDLER_STATE, AXIS2_FAILURE);
         return NULL;
     }
 
@@ -85,88 +81,68 @@
     axiom_soap_envelope_t *soap_envelope = NULL;
     axis2_svc_t *svc = NULL;
 
-    if (axis2_msg_ctx_get_doing_rest(msg_ctx, env))
+    if(axis2_msg_ctx_get_doing_rest(msg_ctx, env))
         return NULL;
 
     soap_envelope = axis2_msg_ctx_get_soap_envelope(msg_ctx, env);
-    if (soap_envelope)
+    if(soap_envelope)
     {
-        axiom_soap_body_t *soap_body =
-            axiom_soap_envelope_get_body(soap_envelope, env);
-        if (soap_body)
+        axiom_soap_body_t *soap_body = axiom_soap_envelope_get_body(soap_envelope, env);
+        if(soap_body)
         {
-            axiom_node_t *body_node =
-                axiom_soap_body_get_base_node(soap_body, env);
-            if (body_node)
+            axiom_node_t *body_node = axiom_soap_body_get_base_node(soap_body, env);
+            if(body_node)
             {
-                axiom_node_t *body_first_child_node =
-                    axiom_node_get_first_element(body_node, env);
+                axiom_node_t *body_first_child_node = axiom_node_get_first_element(body_node, env);
 
-                if (body_first_child_node)
+                if(body_first_child_node)
                 {
-                    if (axiom_node_get_node_type(body_first_child_node, env) ==
-                        AXIOM_ELEMENT)
+                    if(axiom_node_get_node_type(body_first_child_node, env) == AXIOM_ELEMENT)
                     {
                         axiom_element_t *element = NULL;
-                        element =
-                            (axiom_element_t *)
-                            axiom_node_get_data_element(body_first_child_node,
-                                                        env);
-                        if (element)
+                        element = (axiom_element_t *)axiom_node_get_data_element(
+                            body_first_child_node, env);
+                        if(element)
                         {
-                            axiom_namespace_t *ns =
-                                axiom_element_get_namespace(element, env,
-                                                            body_first_child_node);
-                            if (ns)
+                            axiom_namespace_t *ns = axiom_element_get_namespace(element, env,
+                                body_first_child_node);
+                            if(ns)
                             {
-                                axis2_char_t *uri =
-                                    axiom_namespace_get_uri(ns, env);
-                                if (uri)
+                                axis2_char_t *uri = axiom_namespace_get_uri(ns, env);
+                                if(uri)
                                 {
                                     axis2_char_t **url_tokens = NULL;
-                                    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
-                                                    "Checking for service "
-                                                    "using SOAP message body's "
-                                                    "first child's namespace "
-                                                    "URI : %s", uri);
-
-                                    url_tokens =
-                                        axutil_parse_request_url_for_svc_and_op
-                                        (env, uri);
+                                    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Checking for service "
+                                        "using SOAP message body's "
+                                        "first child's namespace "
+                                        "URI : %s", uri);
+
+                                    url_tokens = axutil_parse_request_url_for_svc_and_op(env, uri);
 
-                                    if (url_tokens)
+                                    if(url_tokens)
                                     {
-                                        if (url_tokens[0])
+                                        if(url_tokens[0])
                                         {
                                             axis2_conf_ctx_t *conf_ctx = NULL;
 
-                                            conf_ctx =
-                                                axis2_msg_ctx_get_conf_ctx
-                                                (msg_ctx, env);
-                                            if (conf_ctx)
+                                            conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
+                                            if(conf_ctx)
                                             {
                                                 axis2_conf_t *conf = NULL;
-                                                conf =
-                                                    axis2_conf_ctx_get_conf
-                                                    (conf_ctx, env);
-                                                if (conf)
+                                                conf = axis2_conf_ctx_get_conf(conf_ctx, env);
+                                                if(conf)
                                                 {
-                                                    svc =
-                                                        axis2_conf_get_svc(conf,
-                                                                           env,
-                                                                           url_tokens
-                                                                           [0]);
-                                                    if (svc)
-                                                        AXIS2_LOG_DEBUG(env->
-                                                            log, AXIS2_LOG_SI,
-                                                            "Service found "\
-                                                            "using SOAP message"\
-                                                            "body's first "\
-                                                            "child's namespace URI");
+                                                    svc = axis2_conf_get_svc(conf, env,
+                                                        url_tokens[0]);
+                                                    if(svc)
+                                                        AXIS2_LOG_DEBUG(env-> log, AXIS2_LOG_SI,
+                                                            "Service found "
+                                                                "using SOAP message"
+                                                                "body's first "
+                                                                "child's namespace URI");
                                                 }
                                             }
-                                            AXIS2_FREE(env->allocator,
-                                                       url_tokens[0]);
+                                            AXIS2_FREE(env->allocator, url_tokens[0]);
                                         }
 
                                         AXIS2_FREE(env->allocator, url_tokens);
@@ -195,51 +171,42 @@
 
     AXIS2_PARAM_CHECK(env->error, svc, NULL);
 
-    if (axis2_msg_ctx_get_doing_rest(msg_ctx, env))
+    if(axis2_msg_ctx_get_doing_rest(msg_ctx, env))
         return NULL;
 
     soap_envelope = axis2_msg_ctx_get_soap_envelope(msg_ctx, env);
-    if (soap_envelope)
+    if(soap_envelope)
     {
-        axiom_soap_body_t *soap_body =
-            axiom_soap_envelope_get_body(soap_envelope, env);
-        if (soap_body)
+        axiom_soap_body_t *soap_body = axiom_soap_envelope_get_body(soap_envelope, env);
+        if(soap_body)
         {
-            axiom_node_t *body_node =
-                axiom_soap_body_get_base_node(soap_body, env);
-            if (body_node)
+            axiom_node_t *body_node = axiom_soap_body_get_base_node(soap_body, env);
+            if(body_node)
             {
-                axiom_node_t *body_first_child_node =
-                    axiom_node_get_first_element(body_node, env);
+                axiom_node_t *body_first_child_node = axiom_node_get_first_element(body_node, env);
 
-                if (body_first_child_node)
+                if(body_first_child_node)
                 {
-                    if (axiom_node_get_node_type(body_first_child_node, env) ==
-                        AXIOM_ELEMENT)
+                    if(axiom_node_get_node_type(body_first_child_node, env) == AXIOM_ELEMENT)
                     {
                         axiom_element_t *element = NULL;
-                        element =
-                            (axiom_element_t *)
-                            axiom_node_get_data_element(body_first_child_node,
-                                                        env);
-                        if (element)
+                        element = (axiom_element_t *)axiom_node_get_data_element(
+                            body_first_child_node, env);
+                        if(element)
                         {
-                            axis2_char_t *element_name =
-                                axiom_element_get_localname(element, env);
-                            if (element_name)
+                            axis2_char_t *element_name = axiom_element_get_localname(element, env);
+                            if(element_name)
                             {
                                 AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
-                                    "Checking for operation using SOAP message"\
-                                    "body's first child's local name : %s", 
-                                    element_name);
+                                    "Checking for operation using SOAP message"
+                                        "body's first child's local name : %s", element_name);
 
-                                op = axis2_svc_get_op_with_name(svc, env,
-                                                                element_name);
+                                op = axis2_svc_get_op_with_name(svc, env, element_name);
 
-                                if (op)
+                                if(op)
                                     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
-                                        "Operation found using SOAP message "\
-                                        "body's first child's local name");
+                                        "Operation found using SOAP message "
+                                            "body's first child's local name");
 
                             }
                         }

Modified: webservices/axis2/trunk/c/src/core/phaseresolver/phase_holder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/phaseresolver/phase_holder.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/phaseresolver/phase_holder.c (original)
+++ webservices/axis2/trunk/c/src/core/phaseresolver/phase_holder.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -31,12 +30,10 @@
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    phase_holder = (axis2_phase_holder_t *) AXIS2_MALLOC(env->
-                                                         allocator,
-                                                         sizeof
-                                                         (axis2_phase_holder_t));
+    phase_holder = (axis2_phase_holder_t *)AXIS2_MALLOC(env-> allocator,
+        sizeof(axis2_phase_holder_t));
 
-    if (!phase_holder)
+    if(!phase_holder)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -56,12 +53,12 @@
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    if (!phases)
+    if(!phases)
     {
         return NULL;
     }
 
-    phase_holder = (axis2_phase_holder_t *) axis2_phase_holder_create(env);
+    phase_holder = (axis2_phase_holder_t *)axis2_phase_holder_create(env);
     phase_holder->phase_list = phases;
 
     return phase_holder;
@@ -74,7 +71,7 @@
 {
     AXIS2_ENV_CHECK(env, void);
 
-    if (phase_holder)
+    if(phase_holder)
     {
         AXIS2_FREE(env->allocator, phase_holder);
     }
@@ -97,14 +94,13 @@
 
     size = axutil_array_list_size(phase_holder->phase_list, env);
 
-    for (i = 0; i < size; i++)
+    for(i = 0; i < size; i++)
     {
         const axis2_char_t *phase_name_l = NULL;
 
-        phase = (axis2_phase_t *) axutil_array_list_get(phase_holder->
-                                                        phase_list, env, i);
+        phase = (axis2_phase_t *)axutil_array_list_get(phase_holder-> phase_list, env, i);
         phase_name_l = axis2_phase_get_name(phase, env);
-        if (0 == axutil_strcmp(phase_name_l, phase_name))
+        if(0 == axutil_strcmp(phase_name_l, phase_name))
         {
             return AXIS2_TRUE;
         }
@@ -121,34 +117,27 @@
     const axis2_char_t *phase_name = NULL;
     axis2_status_t status = AXIS2_FAILURE;
 
-    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
-                    "axis2_phase_holder_add_handler start");
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "axis2_phase_holder_add_handler start");
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, handler, AXIS2_FAILURE);
 
-    phase_name =
-        axis2_phase_rule_get_name(axis2_handler_desc_get_rules(handler, env),
-                                  env);
-    if (AXIS2_TRUE ==
-        axis2_phase_holder_is_phase_exist(phase_holder, env, phase_name))
+    phase_name = axis2_phase_rule_get_name(axis2_handler_desc_get_rules(handler, env), env);
+    if(AXIS2_TRUE == axis2_phase_holder_is_phase_exist(phase_holder, env, phase_name))
     {
         axis2_phase_t *phase = NULL;
 
         phase = axis2_phase_holder_get_phase(phase_holder, env, phase_name);
         status = axis2_phase_add_handler_desc(phase, env, handler);
         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Add handler %s to phase %s",
-                        axutil_string_get_buffer(axis2_handler_desc_get_name
-                                                 (handler, env), env),
-                        phase_name);
+            axutil_string_get_buffer(axis2_handler_desc_get_name(handler, env), env), phase_name);
     }
     else
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_PHASE, AXIS2_FAILURE);
         status = AXIS2_FAILURE;
     }
-    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
-                    "axis2_phase_holder_add_handler end status = %s",
-                    status ? "SUCCESS" : "FAILURE");
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "axis2_phase_holder_add_handler end status = %s",
+        status ? "SUCCESS" : "FAILURE");
     return status;
 }
 
@@ -161,35 +150,27 @@
     const axis2_char_t *phase_name = NULL;
     axis2_status_t status = AXIS2_FAILURE;
 
-    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
-                    "axis2_phase_holder_remove_handler start");
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "axis2_phase_holder_remove_handler start");
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, handler, AXIS2_FAILURE);
 
-    phase_name =
-        axis2_phase_rule_get_name(axis2_handler_desc_get_rules(handler, env),
-                                  env);
-    if (AXIS2_TRUE ==
-        axis2_phase_holder_is_phase_exist(phase_holder, env, phase_name))
+    phase_name = axis2_phase_rule_get_name(axis2_handler_desc_get_rules(handler, env), env);
+    if(AXIS2_TRUE == axis2_phase_holder_is_phase_exist(phase_holder, env, phase_name))
     {
         axis2_phase_t *phase = NULL;
 
         phase = axis2_phase_holder_get_phase(phase_holder, env, phase_name);
         status = axis2_phase_remove_handler_desc(phase, env, handler);
-        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
-                        "Remove handler %s from phase %s",
-                        axutil_string_get_buffer(axis2_handler_desc_get_name
-                                                 (handler, env), env),
-                        phase_name);
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Remove handler %s from phase %s",
+            axutil_string_get_buffer(axis2_handler_desc_get_name(handler, env), env), phase_name);
     }
     else
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_PHASE, AXIS2_FAILURE);
         status = AXIS2_FAILURE;
     }
-    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
-                    "axis2_phase_holder_remove_handler end status = %s",
-                    status ? "SUCCESS" : "FAILURE");
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "axis2_phase_holder_remove_handler end status = %s",
+        status ? "SUCCESS" : "FAILURE");
     return status;
 }
 
@@ -207,13 +188,12 @@
 
     size = axutil_array_list_size(phase_holder->phase_list, env);
 
-    for (i = 0; i < size; i++)
+    for(i = 0; i < size; i++)
     {
         const axis2_char_t *phase_name_l = NULL;
-        phase = (axis2_phase_t *) axutil_array_list_get(phase_holder->
-                                                        phase_list, env, i);
+        phase = (axis2_phase_t *)axutil_array_list_get(phase_holder-> phase_list, env, i);
         phase_name_l = axis2_phase_get_name(phase, env);
-        if (0 == axutil_strcmp(phase_name_l, phase_name))
+        if(0 == axutil_strcmp(phase_name_l, phase_name))
         {
             return phase;
         }
@@ -242,18 +222,17 @@
 
     size = axutil_array_list_size(handlers, env);
 
-    for (i = 0; i < size; i++)
+    for(i = 0; i < size; i++)
     {
-        handler_desc =
-            (axis2_handler_desc_t *) axutil_array_list_get(handlers, env, i);
+        handler_desc = (axis2_handler_desc_t *)axutil_array_list_get(handlers, env, i);
         status = axis2_handler_init(handler, env, handler_desc);
-        if (AXIS2_FAILURE == status)
+        if(AXIS2_FAILURE == status)
         {
             return status;
         }
 
         status = axis2_handler_desc_set_handler(handler_desc, env, handler);
-        if (AXIS2_FAILURE == status)
+        if(AXIS2_FAILURE == status)
         {
             return status;
         }