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 [3/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/qpid...

Modified: webservices/axis2/trunk/c/src/core/clientapi/svc_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/clientapi/svc_client.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/clientapi/svc_client.c (original)
+++ webservices/axis2/trunk/c/src/core/clientapi/svc_client.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
@@ -78,31 +77,36 @@
     axutil_array_list_t *http_headers;
 
     int http_status_code;
-    
+
     axis2_bool_t keep_externally_passed_ctx_and_svc;
 
 };
 
-static void axis2_svc_client_set_http_info(
+static void
+axis2_svc_client_set_http_info(
     axis2_svc_client_t * svc_client,
     const axutil_env_t * env,
     axis2_msg_ctx_t * msg_ctx);
 
-static axis2_svc_t *axis2_svc_client_create_annonymous_svc(
+static axis2_svc_t *
+axis2_svc_client_create_annonymous_svc(
     axis2_svc_client_t * svc_client,
     const axutil_env_t * env);
 
-static axis2_bool_t axis2_svc_client_init_transports_from_conf_ctx(
+static axis2_bool_t
+axis2_svc_client_init_transports_from_conf_ctx(
     const axutil_env_t * env,
     axis2_svc_client_t * svc_client,
     axis2_conf_ctx_t * conf_ctx,
     const axis2_char_t * client_home);
 
-static axis2_bool_t axis2_svc_client_init_data(
+static axis2_bool_t
+axis2_svc_client_init_data(
     const axutil_env_t * env,
     axis2_svc_client_t * svc_client);
 
-static axis2_bool_t axis2_svc_client_fill_soap_envelope(
+static axis2_bool_t
+axis2_svc_client_fill_soap_envelope(
     const axutil_env_t * env,
     axis2_svc_client_t * svc_client,
     axis2_msg_ctx_t * msg_ctx,
@@ -116,14 +120,11 @@
     axis2_svc_client_t *svc_client = NULL;
 
     AXIS2_ENV_CHECK(env, NULL);
-    svc_client = axis2_svc_client_create_with_conf_ctx_and_svc(env,
-                                                               client_home,
-                                                               NULL, NULL);
+    svc_client = axis2_svc_client_create_with_conf_ctx_and_svc(env, client_home, NULL, NULL);
 
     return svc_client;
 }
 
-
 AXIS2_EXTERN axis2_svc_client_t *AXIS2_CALL
 axis2_svc_client_create_with_conf_ctx_and_svc(
     const axutil_env_t * env,
@@ -137,13 +138,13 @@
     const axis2_char_t *svc_grp_name = NULL;
 
     svc_client = AXIS2_MALLOC(env->allocator, sizeof(axis2_svc_client_t));
-    if (!svc_client)
+    if(!svc_client)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create service client.");
         return NULL;
     }
-    
+
     svc_client->svc = NULL;
     svc_client->conf = NULL;
     svc_client->conf_ctx = NULL;
@@ -160,18 +161,17 @@
     svc_client->auth_failed = AXIS2_FALSE;
     svc_client->required_auth_is_http = AXIS2_FALSE;
     svc_client->auth_type = NULL;
-	svc_client->http_headers = NULL;
+    svc_client->http_headers = NULL;
     svc_client->keep_externally_passed_ctx_and_svc = AXIS2_FALSE;
 
-    if (!axis2_svc_client_init_data(env, svc_client))
+    if(!axis2_svc_client_init_data(env, svc_client))
     {
         axis2_svc_client_free(svc_client, env);
         return NULL;
     }
 
     /*create the default conf_ctx if it is NULL */
-    if (!axis2_svc_client_init_transports_from_conf_ctx(env, svc_client,
-                                                        conf_ctx, client_home))
+    if(!axis2_svc_client_init_transports_from_conf_ctx(env, svc_client, conf_ctx, client_home))
     {
         axis2_svc_client_free(svc_client, env);
         return NULL;
@@ -179,7 +179,7 @@
 
     svc_client->conf = axis2_conf_ctx_get_conf(svc_client->conf_ctx, env);
 
-    if (svc)
+    if(svc)
     {
         svc_client->keep_externally_passed_ctx_and_svc = AXIS2_TRUE;
         svc_client->svc = svc;
@@ -187,7 +187,7 @@
     else
     {
         svc_client->svc = axis2_svc_client_create_annonymous_svc(svc_client, env);
-        if (!svc_client->svc)
+        if(!svc_client->svc)
         {
             axis2_svc_client_free(svc_client, env);
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot create annonymous service.");
@@ -196,8 +196,7 @@
     }
 
     /** add the service to the config context if it isn't in there already */
-    if (!axis2_conf_get_svc(svc_client->conf, env,
-                            axis2_svc_get_name(svc_client->svc, env)))
+    if(!axis2_conf_get_svc(svc_client->conf, env, axis2_svc_get_name(svc_client->svc, env)))
     {
         axis2_conf_add_svc(svc_client->conf, env, svc_client->svc);
     }
@@ -206,33 +205,32 @@
      context and then get the service context for myself as I'll need that
      later for stuff that I gotta do */
     svc_grp = axis2_svc_get_parent(svc_client->svc, env);
-    if (!svc_grp)
+    if(!svc_grp)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot access service group of service client.");
         return NULL;
     }
 
-    svc_grp_ctx = axis2_svc_grp_get_svc_grp_ctx(svc_grp, env,
-                                                svc_client->conf_ctx);
-    if (!svc_grp_ctx)
+    svc_grp_ctx = axis2_svc_grp_get_svc_grp_ctx(svc_grp, env, svc_client->conf_ctx);
+    if(!svc_grp_ctx)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot access service group context of service client.");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Cannot access service group context of service client.");
         return NULL;
     }
 
     svc_grp_name = axis2_svc_grp_get_name(svc_grp, env);
-    if (!svc_grp_name)
+    if(!svc_grp_name)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot access service group name of service client.");
-        return NULL;            /* service group name is mandatory */
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Cannot access service group name of service client.");
+        return NULL; /* service group name is mandatory */
     }
 
-    axis2_conf_ctx_register_svc_grp_ctx(svc_client->conf_ctx, env,
-                                        svc_grp_name, svc_grp_ctx);
+    axis2_conf_ctx_register_svc_grp_ctx(svc_client->conf_ctx, env, svc_grp_name, svc_grp_ctx);
 
-    svc_client->svc_ctx = axis2_svc_grp_ctx_get_svc_ctx(svc_grp_ctx, env,
-                                                        axis2_svc_get_name
-                                                        (svc_client->svc, env));
+    svc_client->svc_ctx = axis2_svc_grp_ctx_get_svc_ctx(svc_grp_ctx, env, axis2_svc_get_name(
+        svc_client->svc, env));
 
     return svc_client;
 }
@@ -242,7 +240,7 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
-    AXIS2_PARAM_CHECK (env->error, svc_client, NULL);
+    AXIS2_PARAM_CHECK(env->error, svc_client, NULL);
     return svc_client->svc;
 }
 
@@ -251,7 +249,7 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
-    AXIS2_PARAM_CHECK (env->error, svc_client, NULL);
+    AXIS2_PARAM_CHECK(env->error, svc_client, NULL);
     return svc_client->conf_ctx;
 }
 
@@ -261,12 +259,12 @@
     const axutil_env_t * env,
     const axis2_options_t * options)
 {
-    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
-    if (svc_client->options)
+    AXIS2_PARAM_CHECK(env->error, svc_client, AXIS2_FAILURE);
+    if(svc_client->options)
     {
         axis2_options_free(svc_client->options, env);
     }
-    svc_client->options = (axis2_options_t *) options;
+    svc_client->options = (axis2_options_t *)options;
     return AXIS2_SUCCESS;
 }
 
@@ -275,7 +273,7 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
-    AXIS2_PARAM_CHECK (env->error, svc_client, NULL);
+    AXIS2_PARAM_CHECK(env->error, svc_client, NULL);
     return svc_client->options;
 }
 
@@ -285,13 +283,13 @@
     const axutil_env_t * env,
     const axis2_options_t * override_options)
 {
-    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
-    if (svc_client->override_options)
+    AXIS2_PARAM_CHECK(env->error, svc_client, AXIS2_FAILURE);
+    if(svc_client->override_options)
     {
         axis2_options_free(svc_client->override_options, env);
     }
 
-    svc_client->override_options = (axis2_options_t *) override_options;
+    svc_client->override_options = (axis2_options_t *)override_options;
 
     return AXIS2_SUCCESS;
 }
@@ -301,7 +299,7 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
-    AXIS2_PARAM_CHECK (env->error, svc_client, NULL);
+    AXIS2_PARAM_CHECK(env->error, svc_client, NULL);
     return svc_client->override_options;
 }
 
@@ -314,12 +312,12 @@
     axis2_module_desc_t *module = NULL;
     axutil_qname_t *mod_qname = NULL;
 
-    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, svc_client, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, module_name, AXIS2_FAILURE);
 
     mod_qname = axutil_qname_create(env, module_name, NULL, NULL);
 
-    if (!mod_qname)
+    if(!mod_qname)
     {
         return AXIS2_FAILURE;
     }
@@ -329,10 +327,9 @@
     axutil_qname_free(mod_qname, env);
     mod_qname = NULL;
 
-    if (module)
+    if(module)
     {
-        return axis2_svc_engage_module(svc_client->svc, env, module,
-                                       svc_client->conf);
+        return axis2_svc_engage_module(svc_client->svc, env, module, svc_client->conf);
     }
     return AXIS2_FAILURE;
 }
@@ -346,11 +343,11 @@
     axis2_module_desc_t *module = NULL;
     axutil_qname_t *mod_qname = NULL;
 
-    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, svc_client, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, module_name, AXIS2_FAILURE);
 
     mod_qname = axutil_qname_create(env, module_name, NULL, NULL);
-    if (!mod_qname)
+    if(!mod_qname)
     {
         return AXIS2_FAILURE;
     }
@@ -359,10 +356,9 @@
     axutil_qname_free(mod_qname, env);
     mod_qname = NULL;
 
-    if (module)
+    if(module)
     {
-        return axis2_svc_disengage_module(svc_client->svc, env, module,
-                                          svc_client->conf);
+        return axis2_svc_disengage_module(svc_client->svc, env, module, svc_client->conf);
     }
     return AXIS2_FAILURE;
 }
@@ -374,11 +370,11 @@
     axiom_node_t * header)
 {
 
-    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
-    if (!svc_client->headers)
+    AXIS2_PARAM_CHECK(env->error, svc_client, AXIS2_FAILURE);
+    if(!svc_client->headers)
     {
         svc_client->headers = axutil_array_list_create(env, 0);
-        if (!svc_client->headers)
+        if(!svc_client->headers)
         {
             return AXIS2_FAILURE;
         }
@@ -396,16 +392,16 @@
     int i = 0;
     int size = 0;
 
-    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, svc_client, AXIS2_FAILURE);
 
-    if (!svc_client->headers)
+    if(!svc_client->headers)
     {
         return AXIS2_SUCCESS;
     }
 
     size = axutil_array_list_size(svc_client->headers, env);
 
-    for (i = size-1; i >-1; i--)
+    for(i = size - 1; i > -1; i--)
     {
         axutil_array_list_remove(svc_client->headers, env, i);
     }
@@ -423,59 +419,57 @@
     axis2_status_t status = AXIS2_FAILURE;
     axis2_bool_t qname_free_flag = AXIS2_FALSE;
 
-    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, svc_client, AXIS2_FAILURE);
 
-    if (!op_qname)
+    if(!op_qname)
     {
-        op_qname =
-            axutil_qname_create(env, AXIS2_ANON_ROBUST_OUT_ONLY_OP, NULL, NULL);
+        op_qname = axutil_qname_create(env, AXIS2_ANON_ROBUST_OUT_ONLY_OP, NULL, NULL);
         if(!op_qname)
         {
             return AXIS2_FAILURE;
         }
         qname_free_flag = AXIS2_TRUE;
     }
-	else
-	{
-		axis2_op_t *op = NULL;
-		axis2_char_t *mep = NULL;
-		axis2_svc_t *svc = NULL;
-		svc = axis2_svc_client_get_svc(svc_client, env);
-		if (!svc)
-		{
-			return AXIS2_FAILURE;
-		}
-		op = axis2_svc_get_op_with_qname(svc, env, op_qname);
-		if (!op)
-		{
-			return AXIS2_FAILURE;
-		}
-		mep = (axis2_char_t *)axis2_op_get_msg_exchange_pattern(op, env);
-		if (!mep || axutil_strcmp(AXIS2_MEP_URI_OUT_ONLY, mep) != 0)
-		{
-			AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s%s", "To use this method opeation uri should be",
-				AXIS2_MEP_URI_OUT_ONLY);
-			return AXIS2_FAILURE;
-		}
-	}
+    else
+    {
+        axis2_op_t *op = NULL;
+        axis2_char_t *mep = NULL;
+        axis2_svc_t *svc = NULL;
+        svc = axis2_svc_client_get_svc(svc_client, env);
+        if(!svc)
+        {
+            return AXIS2_FAILURE;
+        }
+        op = axis2_svc_get_op_with_qname(svc, env, op_qname);
+        if(!op)
+        {
+            return AXIS2_FAILURE;
+        }
+        mep = (axis2_char_t *)axis2_op_get_msg_exchange_pattern(op, env);
+        if(!mep || axutil_strcmp(AXIS2_MEP_URI_OUT_ONLY, mep) != 0)
+        {
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s%s",
+                "To use this method opeation uri should be", AXIS2_MEP_URI_OUT_ONLY);
+            return AXIS2_FAILURE;
+        }
+    }
 
     svc_client->auth_failed = AXIS2_FALSE;
     svc_client->required_auth_is_http = AXIS2_FALSE;
-    if (svc_client->auth_type)
+    if(svc_client->auth_type)
     {
         AXIS2_FREE(env->allocator, svc_client->auth_type);
     }
     svc_client->auth_type = NULL;
 
-    msg_ctx = axis2_msg_ctx_create(env,
-                                   axis2_svc_ctx_get_conf_ctx(svc_client->svc_ctx, env),
-                                   NULL, NULL);
-    if (!axis2_svc_client_fill_soap_envelope(env, svc_client, msg_ctx, payload))
+    msg_ctx = axis2_msg_ctx_create(env, axis2_svc_ctx_get_conf_ctx(svc_client->svc_ctx, env), NULL,
+        NULL);
+    if(!axis2_svc_client_fill_soap_envelope(env, svc_client, msg_ctx, payload))
     {
         return AXIS2_FAILURE;
     }
 
-    if (!axis2_svc_client_create_op_client(svc_client, env, op_qname))
+    if(!axis2_svc_client_create_op_client(svc_client, env, op_qname))
     {
         return AXIS2_FAILURE;
     }
@@ -484,17 +478,15 @@
     status = axis2_op_client_execute(svc_client->op_client, env, AXIS2_TRUE);
     axis2_svc_client_set_http_info(svc_client, env, msg_ctx);
     svc_client->auth_failed = axis2_msg_ctx_get_auth_failed(msg_ctx, env);
-    svc_client->required_auth_is_http =
-        axis2_msg_ctx_get_required_auth_is_http(msg_ctx, env);
-    if (axis2_msg_ctx_get_auth_type(msg_ctx, env))
+    svc_client->required_auth_is_http = axis2_msg_ctx_get_required_auth_is_http(msg_ctx, env);
+    if(axis2_msg_ctx_get_auth_type(msg_ctx, env))
     {
-        svc_client->auth_type =
-            axutil_strdup(env, axis2_msg_ctx_get_auth_type(msg_ctx, env));
+        svc_client->auth_type = axutil_strdup(env, axis2_msg_ctx_get_auth_type(msg_ctx, env));
     }
 
-    if (qname_free_flag)
+    if(qname_free_flag)
     {
-        axutil_qname_free((axutil_qname_t *) op_qname, env);
+        axutil_qname_free((axutil_qname_t *)op_qname, env);
     }
 
     return status;
@@ -506,8 +498,7 @@
     const axutil_env_t * env,
     const axiom_node_t * payload)
 {
-    return axis2_svc_client_send_robust_with_op_qname(svc_client, env, NULL,
-                                                      payload);
+    return axis2_svc_client_send_robust_with_op_qname(svc_client, env, NULL, payload);
 }
 
 AXIS2_EXTERN void AXIS2_CALL
@@ -522,7 +513,7 @@
 
     AXIS2_PARAM_CHECK_VOID(env->error, svc_client);
 
-    if (!op_qname)
+    if(!op_qname)
     {
         op_qname = axutil_qname_create(env, AXIS2_ANON_OUT_ONLY_OP, NULL, NULL);
         if(!op_qname)
@@ -534,21 +525,20 @@
 
     svc_client->auth_failed = AXIS2_FALSE;
     svc_client->required_auth_is_http = AXIS2_FALSE;
-    if (svc_client->auth_type)
+    if(svc_client->auth_type)
     {
         AXIS2_FREE(env->allocator, svc_client->auth_type);
     }
     svc_client->auth_type = NULL;
 
-    msg_ctx = axis2_msg_ctx_create(env,
-                                   axis2_svc_ctx_get_conf_ctx(svc_client->svc_ctx, env),
-                                   NULL, NULL);
-    if (!axis2_svc_client_fill_soap_envelope(env, svc_client, msg_ctx, payload))
+    msg_ctx = axis2_msg_ctx_create(env, axis2_svc_ctx_get_conf_ctx(svc_client->svc_ctx, env), NULL,
+        NULL);
+    if(!axis2_svc_client_fill_soap_envelope(env, svc_client, msg_ctx, payload))
     {
         return;
     }
 
-    if (!axis2_svc_client_create_op_client(svc_client, env, op_qname))
+    if(!axis2_svc_client_create_op_client(svc_client, env, op_qname))
     {
         return;
     }
@@ -557,17 +547,15 @@
     axis2_op_client_execute(svc_client->op_client, env, AXIS2_TRUE);
     axis2_svc_client_set_http_info(svc_client, env, msg_ctx);
     svc_client->auth_failed = axis2_msg_ctx_get_auth_failed(msg_ctx, env);
-    svc_client->required_auth_is_http =
-        axis2_msg_ctx_get_required_auth_is_http(msg_ctx, env);
-    if (axis2_msg_ctx_get_auth_type(msg_ctx, env))
+    svc_client->required_auth_is_http = axis2_msg_ctx_get_required_auth_is_http(msg_ctx, env);
+    if(axis2_msg_ctx_get_auth_type(msg_ctx, env))
     {
-        svc_client->auth_type =
-            axutil_strdup(env, axis2_msg_ctx_get_auth_type(msg_ctx, env));
+        svc_client->auth_type = axutil_strdup(env, axis2_msg_ctx_get_auth_type(msg_ctx, env));
     }
 
-    if (qname_free_flag)
+    if(qname_free_flag)
     {
-        axutil_qname_free((axutil_qname_t *) op_qname, env);
+        axutil_qname_free((axutil_qname_t *)op_qname, env);
     }
 }
 
@@ -577,8 +565,7 @@
     const axutil_env_t * env,
     const axiom_node_t * payload)
 {
-    axis2_svc_client_fire_and_forget_with_op_qname(svc_client, env, NULL,
-                                                   payload);
+    axis2_svc_client_fire_and_forget_with_op_qname(svc_client, env, NULL, payload);
 }
 
 AXIS2_EXTERN axiom_node_t *AXIS2_CALL
@@ -600,33 +587,31 @@
     axis2_msg_ctx_t *res_msg_ctx = NULL;
     axis2_msg_ctx_t *msg_ctx = NULL;
 
-    AXIS2_PARAM_CHECK (env->error, svc_client, NULL);
+    AXIS2_PARAM_CHECK(env->error, svc_client, NULL);
 
     svc_client->last_response_soap_envelope = NULL;
     svc_client->last_response_has_fault = AXIS2_FALSE;
     svc_client->auth_failed = AXIS2_FALSE;
     svc_client->required_auth_is_http = AXIS2_FALSE;
-    if (svc_client->auth_type)
+    if(svc_client->auth_type)
     {
         AXIS2_FREE(env->allocator, svc_client->auth_type);
     }
     svc_client->auth_type = NULL;
 
     op = axis2_svc_get_op_with_qname(svc_client->svc, env, op_qname);
-    if (op)
+    if(op)
     {
         param = axis2_op_get_param(op, env, AXIS2_SOAP_ACTION);
-        if (param)
+        if(param)
         {
-            action_uri = (axutil_uri_t *) axutil_param_get_value(param, env);
-            action_str =
-                axutil_uri_to_string(action_uri, env,
-                                     AXIS2_URI_UNP_OMITUSERINFO);
+            action_uri = (axutil_uri_t *)axutil_param_get_value(param, env);
+            action_str = axutil_uri_to_string(action_uri, env, AXIS2_URI_UNP_OMITUSERINFO);
             axis2_options_set_action(svc_client->options, env, action_str);
         }
     }
 
-    if (!op_qname)
+    if(!op_qname)
     {
         op_qname = axutil_qname_create(env, AXIS2_ANON_OUT_IN_OP, NULL, NULL);
         if(!op_qname)
@@ -639,19 +624,19 @@
      * a separate listener but don't provide a callback function to acted upon when
      * response is received in the listener thread. What we do here is we create a callback
      * and call axis2_svc_client_send_receive_non_blocking_with_op_qname with it. */
-    if (axis2_options_get_use_separate_listener(svc_client->options, env))
+    if(axis2_options_get_use_separate_listener(svc_client->options, env))
     {
         axis2_callback_t *callback = NULL;
         axis2_msg_ctx_t *msg_ctx = NULL;
         long index = 0;
 
         /* This means doing a Request-Response invocation using two channels.
-           If the transport is a two way transport (e.g. http), only one channel is used
-           (e.g. in http cases 202 OK is sent to say no response available).
-           Axis2 gets blocked and return when the response is available. */
+         If the transport is a two way transport (e.g. http), only one channel is used
+         (e.g. in http cases 202 OK is sent to say no response available).
+         Axis2 gets blocked and return when the response is available. */
 
         callback = axis2_callback_create(env);
-        if (!callback)
+        if(!callback)
         {
             return NULL;
         }
@@ -659,25 +644,20 @@
         /* Call two channel non blocking invoke to do the work and wait on the callback. We don't 
          * set a callback function for the callback. That functionality is handled here. 
          */
-        axis2_svc_client_send_receive_non_blocking_with_op_qname(svc_client,
-                                                                 env, op_qname,
-                                                                 payload,
-                                                                 callback);
-
-        index =
-            axis2_options_get_timeout_in_milli_seconds(svc_client->options,
-                                                       env) / 10;
+        axis2_svc_client_send_receive_non_blocking_with_op_qname(svc_client, env, op_qname,
+            payload, callback);
+
+        index = axis2_options_get_timeout_in_milli_seconds(svc_client->options, env) / 10;
 
         while(!axis2_callback_get_complete(callback, env))
         {
-            if (index-- >= 0)
+            if(index-- >= 0)
             {
                 AXIS2_USLEEP(10000);
             }
             else
             {
-                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_RESPONSE_TIMED_OUT,
-                                AXIS2_FAILURE);
+                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_RESPONSE_TIMED_OUT, AXIS2_FAILURE);
                 AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Response time out.");
                 return NULL;
             }
@@ -686,10 +666,8 @@
         soap_envelope = axis2_callback_get_envelope(callback, env);
 
         /* start of hack to get rid of memory leak */
-        msg_ctx = axis2_msg_ctx_create(env,
-                                       axis2_svc_ctx_get_conf_ctx(svc_client->
-                                                                  svc_ctx, env),
-                                       NULL, NULL);
+        msg_ctx = axis2_msg_ctx_create(env, axis2_svc_ctx_get_conf_ctx(svc_client-> svc_ctx, env),
+            NULL, NULL);
         if(!msg_ctx)
             return NULL;
 
@@ -699,31 +677,28 @@
         /* end of hack to get rid of memory leak */
 
         /* process the result of the invocation */
-        if (!soap_envelope)
+        if(!soap_envelope)
         {
-            if (axis2_callback_get_error(callback, env) != AXIS2_ERROR_NONE)
+            if(axis2_callback_get_error(callback, env) != AXIS2_ERROR_NONE)
             {
-                AXIS2_ERROR_SET(env->error,
-                                axis2_callback_get_error(callback, env),
-                                AXIS2_FAILURE);
+                AXIS2_ERROR_SET(env->error, axis2_callback_get_error(callback, env), AXIS2_FAILURE);
                 return NULL;
             }
         }
     }
     else
     {
-        msg_ctx = axis2_msg_ctx_create(env,
-                                       axis2_svc_ctx_get_conf_ctx(svc_client->svc_ctx, env),
-                                       NULL, NULL);
+        msg_ctx = axis2_msg_ctx_create(env, axis2_svc_ctx_get_conf_ctx(svc_client->svc_ctx, env),
+            NULL, NULL);
         if(!msg_ctx)
             return NULL;
 
-        if (!axis2_svc_client_fill_soap_envelope(env, svc_client, msg_ctx, payload))
+        if(!axis2_svc_client_fill_soap_envelope(env, svc_client, msg_ctx, payload))
         {
             return NULL;
         }
 
-        if (!axis2_svc_client_create_op_client(svc_client, env, op_qname))
+        if(!axis2_svc_client_create_op_client(svc_client, env, op_qname))
         {
             return NULL;
         }
@@ -732,35 +707,31 @@
         axis2_op_client_execute(svc_client->op_client, env, AXIS2_TRUE);
         axis2_svc_client_set_http_info(svc_client, env, msg_ctx);
         svc_client->auth_failed = axis2_msg_ctx_get_auth_failed(msg_ctx, env);
-        svc_client->required_auth_is_http =
-            axis2_msg_ctx_get_required_auth_is_http(msg_ctx, env);
-        if (axis2_msg_ctx_get_auth_type(msg_ctx, env))
-        {
-            svc_client->auth_type =
-                axutil_strdup(env, axis2_msg_ctx_get_auth_type(msg_ctx, env));
-        }
-        res_msg_ctx =
-            (axis2_msg_ctx_t *) axis2_op_client_get_msg_ctx(svc_client->
-                                                            op_client, env,
-                                                            AXIS2_WSDL_MESSAGE_LABEL_IN);
+        svc_client->required_auth_is_http = axis2_msg_ctx_get_required_auth_is_http(msg_ctx, env);
+        if(axis2_msg_ctx_get_auth_type(msg_ctx, env))
+        {
+            svc_client->auth_type = axutil_strdup(env, axis2_msg_ctx_get_auth_type(msg_ctx, env));
+        }
+        res_msg_ctx = (axis2_msg_ctx_t *)axis2_op_client_get_msg_ctx(svc_client-> op_client, env,
+            AXIS2_WSDL_MESSAGE_LABEL_IN);
 
-        if (res_msg_ctx)
+        if(res_msg_ctx)
         {
             soap_envelope = axis2_msg_ctx_get_soap_envelope(res_msg_ctx, env);
         }
         else
         {
-            axis2_op_client_add_msg_ctx(svc_client->op_client, env, res_msg_ctx);   
+            axis2_op_client_add_msg_ctx(svc_client->op_client, env, res_msg_ctx);
             /* set in msg_ctx to be NULL to reset */
         }
     }
 
-    if (qname_free_flag)
+    if(qname_free_flag)
     {
-        axutil_qname_free((axutil_qname_t *) op_qname, env);
+        axutil_qname_free((axutil_qname_t *)op_qname, env);
     }
 
-    if (!soap_envelope)
+    if(!soap_envelope)
     {
         return NULL;
     }
@@ -768,19 +739,16 @@
 
     soap_body = axiom_soap_envelope_get_body(soap_envelope, env);
 
-    if (!soap_body)
+    if(!soap_body)
     {
-        axiom_node_t *node =
-            axiom_soap_envelope_get_base_node(soap_envelope, env);
-        if (node)
-        {
-            axiom_element_t *envelope_element =
-                (axiom_element_t *) axiom_node_get_data_element(node, env);
-            axiom_util_get_first_child_element_with_localname(envelope_element,
-                                                              env, node,
-                                                              AXIOM_SOAP_BODY_LOCAL_NAME,
-                                                              &soap_node);
-            if (soap_node)
+        axiom_node_t *node = axiom_soap_envelope_get_base_node(soap_envelope, env);
+        if(node)
+        {
+            axiom_element_t *envelope_element = (axiom_element_t *)axiom_node_get_data_element(
+                node, env);
+            axiom_util_get_first_child_element_with_localname(envelope_element, env, node,
+                AXIOM_SOAP_BODY_LOCAL_NAME, &soap_node);
+            if(soap_node)
             {
                 return axiom_node_get_first_element(soap_node, env);
             }
@@ -788,11 +756,10 @@
         return NULL;
     }
 
-    if (axis2_msg_ctx_get_doing_rest (res_msg_ctx, env))
+    if(axis2_msg_ctx_get_doing_rest(res_msg_ctx, env))
     {
         /* All HTTP 4xx and 5xx status codes are treated as errors */
-        if (axis2_msg_ctx_get_status_code (res_msg_ctx, env) >=
-            400)
+        if(axis2_msg_ctx_get_status_code(res_msg_ctx, env) >= 400)
         {
             svc_client->last_response_has_fault = AXIS2_TRUE;
         }
@@ -803,18 +770,16 @@
     }
     else
     {
-        svc_client->last_response_has_fault =
-            axiom_soap_body_has_fault(soap_body, env);
+        svc_client->last_response_has_fault = axiom_soap_body_has_fault(soap_body, env);
     }
 
-    if (AXIOM_SOAP11 ==
-        axiom_soap_envelope_get_soap_version(soap_envelope, env))
+    if(AXIOM_SOAP11 == axiom_soap_envelope_get_soap_version(soap_envelope, env))
     {
         axiom_soap_body_convert_fault_to_soap11(soap_body, env);
     }
 
     soap_node = axiom_soap_body_get_base_node(soap_body, env);
-    if (!soap_node)
+    if(!soap_node)
     {
         return NULL;
     }
@@ -827,8 +792,7 @@
     const axutil_env_t * env,
     const axiom_node_t * payload)
 {
-    return axis2_svc_client_send_receive_with_op_qname(svc_client, env, NULL,
-                                                       payload);
+    return axis2_svc_client_send_receive_with_op_qname(svc_client, env, NULL, payload);
 }
 
 AXIS2_EXTERN void AXIS2_CALL
@@ -842,10 +806,10 @@
     axis2_msg_ctx_t *msg_ctx = NULL;
     AXIS2_TRANSPORT_ENUMS transport_in_protocol;
     axis2_bool_t qname_free_flag = AXIS2_FALSE;
-    
+
     AXIS2_PARAM_CHECK_VOID(env->error, svc_client);
 
-    if (!op_qname)
+    if(!op_qname)
     {
         op_qname = axutil_qname_create(env, AXIS2_ANON_OUT_IN_OP, NULL, NULL);
         if(!op_qname)
@@ -855,25 +819,23 @@
 
     svc_client->auth_failed = AXIS2_FALSE;
     svc_client->required_auth_is_http = AXIS2_FALSE;
-    if (svc_client->auth_type)
+    if(svc_client->auth_type)
     {
         AXIS2_FREE(env->allocator, svc_client->auth_type);
     }
     svc_client->auth_type = NULL;
 
-    msg_ctx = axis2_msg_ctx_create(env,
-                                   axis2_svc_ctx_get_conf_ctx(svc_client->
-                                                              svc_ctx, env),
-                                   NULL, NULL);
+    msg_ctx = axis2_msg_ctx_create(env, axis2_svc_ctx_get_conf_ctx(svc_client-> svc_ctx, env),
+        NULL, NULL);
     if(!msg_ctx)
         return;
 
-    if (!axis2_svc_client_fill_soap_envelope(env, svc_client, msg_ctx, payload))
+    if(!axis2_svc_client_fill_soap_envelope(env, svc_client, msg_ctx, payload))
     {
         return;
     }
 
-    if (!axis2_svc_client_create_op_client(svc_client, env, op_qname))
+    if(!axis2_svc_client_create_op_client(svc_client, env, op_qname))
     {
         return;
     }
@@ -882,47 +844,42 @@
     axis2_op_client_add_out_msg_ctx(svc_client->op_client, env, msg_ctx);
 
     /* If dual channel */
-    if (axis2_options_get_use_separate_listener(svc_client->options, env))
+    if(axis2_options_get_use_separate_listener(svc_client->options, env))
     {
         axis2_op_t *op = NULL;
-		
-        transport_in_protocol =
-            axis2_options_get_transport_in_protocol(svc_client->options, env);
-		if (transport_in_protocol == AXIS2_TRANSPORT_ENUM_MAX)
-		{
-			axis2_options_set_transport_in_protocol(svc_client->options, env, AXIS2_TRANSPORT_ENUM_HTTP);
-			transport_in_protocol = AXIS2_TRANSPORT_ENUM_HTTP;
-		}
-        axis2_listener_manager_make_sure_started(svc_client->listener_manager,
-                                                 env, transport_in_protocol,
-                                                 svc_client->conf_ctx);
+
+        transport_in_protocol = axis2_options_get_transport_in_protocol(svc_client->options, env);
+        if(transport_in_protocol == AXIS2_TRANSPORT_ENUM_MAX)
+        {
+            axis2_options_set_transport_in_protocol(svc_client->options, env,
+                AXIS2_TRANSPORT_ENUM_HTTP);
+            transport_in_protocol = AXIS2_TRANSPORT_ENUM_HTTP;
+        }
+        axis2_listener_manager_make_sure_started(svc_client->listener_manager, env,
+            transport_in_protocol, svc_client->conf_ctx);
         /* Following sleep is required to ensure the listner is ready to receive response.
-           If it is missing, the response gets lost. - Samisa */
+         If it is missing, the response gets lost. - Samisa */
         AXIS2_USLEEP(1);
 
         op = axis2_svc_get_op_with_qname(svc_client->svc, env, op_qname);
         /* At the end of the incoming flow this message receiver will be hit */
         axis2_op_set_msg_recv(op, env,
-                              AXIS2_CALLBACK_RECV_GET_BASE(svc_client->
-                                                           callback_recv, env));
-        axis2_op_client_set_callback_recv(svc_client->op_client, env,
-                                          svc_client->callback_recv);
+            AXIS2_CALLBACK_RECV_GET_BASE(svc_client-> callback_recv, env));
+        axis2_op_client_set_callback_recv(svc_client->op_client, env, svc_client->callback_recv);
     }
 
     axis2_op_client_execute(svc_client->op_client, env, AXIS2_FALSE);
     axis2_svc_client_set_http_info(svc_client, env, msg_ctx);
     svc_client->auth_failed = axis2_msg_ctx_get_auth_failed(msg_ctx, env);
-    svc_client->required_auth_is_http =
-        axis2_msg_ctx_get_required_auth_is_http(msg_ctx, env);
-    if (axis2_msg_ctx_get_auth_type(msg_ctx, env))
+    svc_client->required_auth_is_http = axis2_msg_ctx_get_required_auth_is_http(msg_ctx, env);
+    if(axis2_msg_ctx_get_auth_type(msg_ctx, env))
     {
-        svc_client->auth_type =
-            axutil_strdup(env, axis2_msg_ctx_get_auth_type(msg_ctx, env));
+        svc_client->auth_type = axutil_strdup(env, axis2_msg_ctx_get_auth_type(msg_ctx, env));
     }
 
-    if (qname_free_flag)
+    if(qname_free_flag)
     {
-        axutil_qname_free((axutil_qname_t *) op_qname, env);
+        axutil_qname_free((axutil_qname_t *)op_qname, env);
         op_qname = NULL;
     }
 }
@@ -934,9 +891,8 @@
     const axiom_node_t * payload,
     axis2_callback_t * callback)
 {
-    axis2_svc_client_send_receive_non_blocking_with_op_qname(svc_client, env,
-                                                             NULL, payload,
-                                                             callback);
+    axis2_svc_client_send_receive_non_blocking_with_op_qname(svc_client, env, NULL, payload,
+        callback);
 }
 
 AXIS2_EXTERN axis2_op_client_t *AXIS2_CALL
@@ -947,37 +903,34 @@
 {
     axis2_op_t *op = NULL;
 
-    AXIS2_PARAM_CHECK (env->error, svc_client, NULL);
+    AXIS2_PARAM_CHECK(env->error, svc_client, NULL);
 
     op = axis2_svc_get_op_with_qname(svc_client->svc, env, op_qname);
 
-    if (!op)
+    if(!op)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot find operation to create op client.");
         return NULL;
     }
 
-    if (!(svc_client->op_client) || svc_client->reuse)
+    if(!(svc_client->op_client) || svc_client->reuse)
     {
-        if ((svc_client->reuse) && (svc_client->op_client))
+        if((svc_client->reuse) && (svc_client->op_client))
             axis2_op_client_free(svc_client->op_client, env);
-        svc_client->op_client =
-            axis2_op_client_create(env, op, svc_client->svc_ctx,
-                                   svc_client->options);
+        svc_client->op_client = axis2_op_client_create(env, op, svc_client->svc_ctx,
+            svc_client->options);
     }
 
     /**
-      If override options have been set, that means we need to make sure
-      those options override the options of even the operation client. So,
-      what we do is switch the parents around to make that work.
-    */
-    if (svc_client->override_options)
-    {
-        axis2_options_set_parent(svc_client->override_options, env,
-                                 axis2_op_client_get_options(svc_client->
-                                                             op_client, env));
-        axis2_op_client_set_options(svc_client->op_client, env,
-                                    svc_client->override_options);
+     If override options have been set, that means we need to make sure
+     those options override the options of even the operation client. So,
+     what we do is switch the parents around to make that work.
+     */
+    if(svc_client->override_options)
+    {
+        axis2_options_set_parent(svc_client->override_options, env, axis2_op_client_get_options(
+            svc_client-> op_client, env));
+        axis2_op_client_set_options(svc_client->op_client, env, svc_client->override_options);
     }
     svc_client->reuse = AXIS2_TRUE;
     axis2_op_client_set_reuse(svc_client->op_client, env, svc_client->reuse);
@@ -991,15 +944,13 @@
 {
     AXIS2_TRANSPORT_ENUMS transport_in_protocol;
 
-    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, svc_client, AXIS2_FAILURE);
 
-    transport_in_protocol =
-        axis2_options_get_transport_in_protocol(svc_client->options, env);
+    transport_in_protocol = axis2_options_get_transport_in_protocol(svc_client->options, env);
 
-    if (svc_client->listener_manager)
+    if(svc_client->listener_manager)
     {
-        return axis2_listener_manager_stop(svc_client->listener_manager,
-                                           env, transport_in_protocol);
+        return axis2_listener_manager_stop(svc_client->listener_manager, env, transport_in_protocol);
     }
 
     return AXIS2_SUCCESS;
@@ -1036,7 +987,7 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
-    AXIS2_PARAM_CHECK (env->error, svc_client, NULL);
+    AXIS2_PARAM_CHECK(env->error, svc_client, NULL);
     return svc_client->svc_ctx;
 }
 
@@ -1048,10 +999,10 @@
     const axis2_char_t * client_home)
 {
     svc_client->conf_ctx = conf_ctx;
-    if (!svc_client->conf_ctx)
+    if(!svc_client->conf_ctx)
     {
         svc_client->conf_ctx = axis2_build_client_conf_ctx(env, client_home);
-        if (!svc_client->conf_ctx)
+        if(!svc_client->conf_ctx)
         {
             return AXIS2_FALSE;
         }
@@ -1061,10 +1012,10 @@
         svc_client->keep_externally_passed_ctx_and_svc = AXIS2_TRUE;
     }
 
-    if (!svc_client->listener_manager)
+    if(!svc_client->listener_manager)
     {
         svc_client->listener_manager = axis2_listener_manager_create(env);
-        if (!svc_client->listener_manager)
+        if(!svc_client->listener_manager)
         {
             return AXIS2_FALSE;
         }
@@ -1083,7 +1034,7 @@
     svc_client->svc_ctx = NULL;
 
     svc_client->options = axis2_options_create(env);
-    if (!svc_client->options)
+    if(!svc_client->options)
     {
         return AXIS2_FALSE;
     }
@@ -1091,14 +1042,14 @@
     svc_client->override_options = NULL;
     svc_client->headers = NULL;
 
-    if (svc_client->callback_recv)
+    if(svc_client->callback_recv)
     {
         AXIS2_CALLBACK_RECV_FREE(svc_client->callback_recv, env);
         svc_client->callback_recv = NULL;
     }
 
     svc_client->callback_recv = axis2_callback_recv_create(env);
-    if (!svc_client->callback_recv)
+    if(!svc_client->callback_recv)
     {
         return AXIS2_FALSE;
     }
@@ -1117,30 +1068,27 @@
      shortcut client API. NOTE: We only add the ones we know we'll use
      later in the convenience API; if you use
      this constructor then you can't expect any magic!
-    */
+     */
     axutil_qname_t *tmp_qname;
     axis2_svc_t *svc;
-    axis2_op_t *op_out_in,
-    *op_out_only,
-    *op_robust_out_only;
+    axis2_op_t *op_out_in, *op_out_only, *op_robust_out_only;
     axis2_phases_info_t *info = NULL;
 
     tmp_qname = axutil_qname_create(env, AXIS2_ANON_SERVICE, NULL, NULL);
-    if (!tmp_qname)
+    if(!tmp_qname)
     {
         return NULL;
     }
 
     svc = axis2_svc_create_with_qname(env, tmp_qname);
     axutil_qname_free(tmp_qname, env);
-    if (!svc)
+    if(!svc)
     {
         return NULL;
     }
-    
 
     tmp_qname = axutil_qname_create(env, AXIS2_ANON_OUT_IN_OP, NULL, NULL);
-    if (!tmp_qname)
+    if(!tmp_qname)
     {
         return NULL;
     }
@@ -1148,7 +1096,7 @@
     axutil_qname_free(tmp_qname, env);
 
     tmp_qname = axutil_qname_create(env, AXIS2_ANON_OUT_ONLY_OP, NULL, NULL);
-    if (!tmp_qname)
+    if(!tmp_qname)
     {
         return NULL;
     }
@@ -1156,25 +1104,25 @@
     axutil_qname_free(tmp_qname, env);
 
     tmp_qname = axutil_qname_create(env, AXIS2_ANON_ROBUST_OUT_ONLY_OP, NULL, NULL);
-    if (!tmp_qname)
+    if(!tmp_qname)
     {
         return NULL;
     }
     op_robust_out_only = axis2_op_create_with_qname(env, tmp_qname);
     axutil_qname_free(tmp_qname, env);
 
-    if (!op_out_in || !op_out_only || !op_robust_out_only)
+    if(!op_out_in || !op_out_only || !op_robust_out_only)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        if (op_out_in)
+        if(op_out_in)
         {
             axis2_op_free(op_out_in, env);
         }
-        if (op_out_only)
+        if(op_out_only)
         {
             axis2_op_free(op_out_only, env);
         }
-        if (op_robust_out_only)
+        if(op_robust_out_only)
         {
             axis2_op_free(op_robust_out_only, env);
         }
@@ -1184,8 +1132,7 @@
 
     axis2_op_set_msg_exchange_pattern(op_out_in, env, AXIS2_MEP_URI_OUT_IN);
     axis2_op_set_msg_exchange_pattern(op_out_only, env, AXIS2_MEP_URI_OUT_ONLY);
-    axis2_op_set_msg_exchange_pattern(op_robust_out_only, env,
-                                      AXIS2_MEP_URI_ROBUST_OUT_ONLY);
+    axis2_op_set_msg_exchange_pattern(op_robust_out_only, env, AXIS2_MEP_URI_ROBUST_OUT_ONLY);
 
     /* Setting operation phase */
     info = axis2_conf_get_phases_info(svc_client->conf, env);
@@ -1203,55 +1150,55 @@
     axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
-    if (!svc_client)
+    if(!svc_client)
     {
         return;
     }
 
-    if (svc_client->headers)
+    if(svc_client->headers)
     {
         axis2_svc_client_remove_all_headers(svc_client, env);
         axutil_array_list_free(svc_client->headers, env);
-        svc_client->headers = NULL;        
+        svc_client->headers = NULL;
     }
 
-    if (svc_client->svc && !svc_client->keep_externally_passed_ctx_and_svc)
+    if(svc_client->svc && !svc_client->keep_externally_passed_ctx_and_svc)
     {
         axis2_svc_free(svc_client->svc, env);
     }
 
-    if (svc_client->callback_recv)
+    if(svc_client->callback_recv)
     {
         AXIS2_CALLBACK_RECV_FREE(svc_client->callback_recv, env);
     }
 
-    if (svc_client->op_client)
+    if(svc_client->op_client)
     {
         axis2_op_client_free(svc_client->op_client, env);
         svc_client->op_client = NULL;
     }
 
-    if (svc_client->options)
+    if(svc_client->options)
     {
         axis2_options_free(svc_client->options, env);
     }
 
-    if (svc_client->listener_manager)
+    if(svc_client->listener_manager)
     {
         axis2_listener_manager_free(svc_client->listener_manager, env);
     }
 
-    if (svc_client->conf_ctx && !svc_client->keep_externally_passed_ctx_and_svc)
+    if(svc_client->conf_ctx && !svc_client->keep_externally_passed_ctx_and_svc)
     {
         axis2_conf_ctx_free(svc_client->conf_ctx, env);
     }
 
-    if (svc_client->auth_type)
+    if(svc_client->auth_type)
     {
         AXIS2_FREE(env->allocator, svc_client->auth_type);
     }
 
-    if (svc_client->http_headers)
+    if(svc_client->http_headers)
     {
         axis2_svc_client_set_http_info(svc_client, env, NULL);
     }
@@ -1271,19 +1218,17 @@
     const axis2_char_t *soap_version_uri;
     int soap_version;
     axiom_soap_envelope_t *envelope = NULL;
-    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, svc_client, AXIS2_FAILURE);
 
-    soap_version_uri =
-        axis2_options_get_soap_version_uri(svc_client->options, env);
+    soap_version_uri = axis2_options_get_soap_version_uri(svc_client->options, env);
 
-    if (!soap_version_uri)
+    if(!soap_version_uri)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot find soap version uri.");
         return AXIS2_FALSE;
     }
 
-    if (axutil_strcmp
-        (soap_version_uri, AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI) == 0)
+    if(axutil_strcmp(soap_version_uri, AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI) == 0)
     {
         soap_version = AXIOM_SOAP11;
     }
@@ -1292,40 +1237,38 @@
         soap_version = AXIOM_SOAP12;
     }
 
-    envelope =
-        axiom_soap_envelope_create_default_soap_envelope(env, soap_version);
-    if (!envelope)
+    envelope = axiom_soap_envelope_create_default_soap_envelope(env, soap_version);
+    if(!envelope)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot create default soap envelope.");
         return AXIS2_FALSE;
     }
 
-    if (svc_client->headers)
+    if(svc_client->headers)
     {
         axiom_soap_header_t *soap_header = NULL;
         soap_header = axiom_soap_envelope_get_header(envelope, env);
 
-        if (soap_header)
+        if(soap_header)
         {
             axiom_node_t *header_node = NULL;
             header_node = axiom_soap_header_get_base_node(soap_header, env);
 
-            if (header_node)
+            if(header_node)
             {
                 int size = 0;
                 int i = 0;
                 size = axutil_array_list_size(svc_client->headers, env);
-                while (i < size)
+                while(i < size)
                 {
                     axiom_node_t *node = NULL;
-                    node = axutil_array_list_remove(svc_client->headers,
-                                                    env, 0);
+                    node = axutil_array_list_remove(svc_client->headers, env, 0);
                     /* This removes and retrieves data. The order of the 
                      * removal is chosen such that the headers are appended
                      * in the order they were added.
                      */
                     size--;
-                    if (node)
+                    if(node)
                     {
                         axiom_node_add_child(header_node, env, node);
                     }
@@ -1334,17 +1277,17 @@
         }
     }
 
-    if (payload)
+    if(payload)
     {
         axiom_soap_body_t *soap_body = NULL;
         soap_body = axiom_soap_envelope_get_body(envelope, env);
-        if (soap_body)
+        if(soap_body)
         {
             axiom_node_t *node = NULL;
             node = axiom_soap_body_get_base_node(soap_body, env);
-            if (node)
+            if(node)
             {
-                axiom_node_add_child(node, env, (axiom_node_t *) payload);
+                axiom_node_add_child(node, env, (axiom_node_t *)payload);
             }
         }
     }
@@ -1359,7 +1302,7 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
-    AXIS2_PARAM_CHECK (env->error, svc_client, NULL);
+    AXIS2_PARAM_CHECK(env->error, svc_client, NULL);
     return svc_client->op_client;
 }
 
@@ -1368,7 +1311,7 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
-    AXIS2_PARAM_CHECK (env->error, svc_client, NULL);
+    AXIS2_PARAM_CHECK(env->error, svc_client, NULL);
     return svc_client->last_response_soap_envelope;
 }
 
@@ -1377,7 +1320,7 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
-    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FALSE);
+    AXIS2_PARAM_CHECK(env->error, svc_client, AXIS2_FALSE);
     return svc_client->last_response_has_fault;
 }
 
@@ -1386,9 +1329,8 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
-    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FALSE);
-    if (svc_client->auth_failed &&
-        svc_client->required_auth_is_http)
+    AXIS2_PARAM_CHECK(env->error, svc_client, AXIS2_FALSE);
+    if(svc_client->auth_failed && svc_client->required_auth_is_http)
     {
         return AXIS2_TRUE;
     }
@@ -1400,9 +1342,8 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
-    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FALSE);
-    if (svc_client->auth_failed &&
-        !svc_client->required_auth_is_http)
+    AXIS2_PARAM_CHECK(env->error, svc_client, AXIS2_FALSE);
+    if(svc_client->auth_failed && !svc_client->required_auth_is_http)
     {
         return AXIS2_TRUE;
     }
@@ -1445,24 +1386,22 @@
     AXIS2_PARAM_CHECK(env->error, proxy_host, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, proxy_port, AXIS2_FAILURE);
 
-    if (svc_client->conf)
+    if(svc_client->conf)
     {
         conf = svc_client->conf;
-        trans_desc =
-            axis2_conf_get_transport_out(conf, env, AXIS2_TRANSPORT_ENUM_HTTP);
-        if (!trans_desc)
+        trans_desc = axis2_conf_get_transport_out(conf, env, AXIS2_TRANSPORT_ENUM_HTTP);
+        if(!trans_desc)
         {
             return AXIS2_FAILURE;
         }
-        param_container =
-            axis2_transport_out_desc_param_container(trans_desc, env);
-        param = axutil_param_create(env, proxy, (void *) NULL);
+        param_container = axis2_transport_out_desc_param_container(trans_desc, env);
+        param = axutil_param_create(env, proxy, (void *)NULL);
 
-        if (!param)
+        if(!param)
         {
             return AXIS2_FAILURE;
         }
-        
+
         attribute = axutil_hash_make(env);
         host_obj = axutil_generic_obj_create(env);
         port_obj = axutil_generic_obj_create(env);
@@ -1473,24 +1412,22 @@
         axutil_generic_obj_set_value(port_obj, env, port_attr);
         axutil_generic_obj_set_free_func(port_obj, env, axiom_attribute_free_void_arg);
 
-        axutil_hash_set(attribute, AXIS2_HTTP_PROXY_HOST, AXIS2_HASH_KEY_STRING,
-                        host_obj);
-        axutil_hash_set(attribute, AXIS2_HTTP_PROXY_PORT, AXIS2_HASH_KEY_STRING,
-                        port_obj);
-        if (username && password)
-        {
-                username_obj = axutil_generic_obj_create(env);
-                password_obj = axutil_generic_obj_create(env);
-                username_attr = axiom_attribute_create(env, AXIS2_HTTP_PROXY_USERNAME, username, NULL);
-                password_attr = axiom_attribute_create(env, AXIS2_HTTP_PROXY_PASSWORD, password, NULL);
-                axutil_generic_obj_set_value(username_obj, env, username_attr);
-                axutil_generic_obj_set_value(password_obj, env, password_attr);
-                axutil_generic_obj_set_free_func(username_obj, env, axiom_attribute_free_void_arg);
-                axutil_generic_obj_set_free_func(password_obj, env, axiom_attribute_free_void_arg);
-                axutil_hash_set(attribute, AXIS2_HTTP_PROXY_USERNAME, AXIS2_HASH_KEY_STRING,
-                                username_obj);
-                axutil_hash_set(attribute, AXIS2_HTTP_PROXY_PASSWORD, AXIS2_HASH_KEY_STRING,
-                                password_obj);
+        axutil_hash_set(attribute, AXIS2_HTTP_PROXY_HOST, AXIS2_HASH_KEY_STRING, host_obj);
+        axutil_hash_set(attribute, AXIS2_HTTP_PROXY_PORT, AXIS2_HASH_KEY_STRING, port_obj);
+        if(username && password)
+        {
+            username_obj = axutil_generic_obj_create(env);
+            password_obj = axutil_generic_obj_create(env);
+            username_attr = axiom_attribute_create(env, AXIS2_HTTP_PROXY_USERNAME, username, NULL);
+            password_attr = axiom_attribute_create(env, AXIS2_HTTP_PROXY_PASSWORD, password, NULL);
+            axutil_generic_obj_set_value(username_obj, env, username_attr);
+            axutil_generic_obj_set_value(password_obj, env, password_attr);
+            axutil_generic_obj_set_free_func(username_obj, env, axiom_attribute_free_void_arg);
+            axutil_generic_obj_set_free_func(password_obj, env, axiom_attribute_free_void_arg);
+            axutil_hash_set(attribute, AXIS2_HTTP_PROXY_USERNAME, AXIS2_HASH_KEY_STRING,
+                username_obj);
+            axutil_hash_set(attribute, AXIS2_HTTP_PROXY_PASSWORD, AXIS2_HASH_KEY_STRING,
+                password_obj);
         }
         axutil_param_set_attributes(param, env, attribute);
         axutil_param_container_add_param(param_container, env, param);
@@ -1516,10 +1453,10 @@
 {
     neethi_policy_t *neethi_policy = NULL;
 
-    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, svc_client, AXIS2_FAILURE);
     neethi_policy = neethi_util_create_policy_from_om(env, root_node);
 
-    if (neethi_policy)
+    if(neethi_policy)
     {
         return axis2_svc_client_set_policy(svc_client, env, neethi_policy);
     }
@@ -1540,33 +1477,34 @@
     axis2_desc_t *desc = NULL;
     axis2_policy_include_t *policy_include = NULL;
 
-    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, svc_client, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, policy, AXIS2_FAILURE);
 
     svc = axis2_svc_client_get_svc(svc_client, env);
 
-    if (!svc)
+    if(!svc)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot find service of service client. Cannot set policy.");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Cannot find service of service client. Cannot set policy.");
         return AXIS2_FAILURE;
     }
 
     desc = axis2_svc_get_base(svc, env);
-    if (!desc)
+    if(!desc)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot find service description of service client. Cannot set policy.");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Cannot find service description of service client. Cannot set policy.");
         return AXIS2_FAILURE;
     }
 
     policy_include = axis2_desc_get_policy_include(desc, env);
-    if (!policy_include)
+    if(!policy_include)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot find policy include. Cannot set policy.");
         return AXIS2_FAILURE;
     }
 
-    axis2_policy_include_add_policy_element(policy_include, env,
-                                            AXIS2_SERVICE_POLICY, policy);
+    axis2_policy_include_add_policy_element(policy_include, env, AXIS2_SERVICE_POLICY, policy);
     return AXIS2_SUCCESS;
 }
 
@@ -1586,7 +1524,8 @@
     return svc_client->http_status_code;
 }
 
-void axis2_svc_client_set_http_info(
+void
+axis2_svc_client_set_http_info(
     axis2_svc_client_t * svc_client,
     const axutil_env_t * env,
     axis2_msg_ctx_t * msg_ctx)
@@ -1595,45 +1534,43 @@
     axutil_param_t *expose_headers_param = NULL;
     axis2_bool_t expose_headers = AXIS2_FALSE;
 
-    if (msg_ctx)
+    if(msg_ctx)
     {
         transport_in = axis2_msg_ctx_get_transport_in_desc(msg_ctx, env);
-        if (transport_in)
+        if(transport_in)
         {
-            expose_headers_param =
-                 axutil_param_container_get_param(
-                     axis2_transport_in_desc_param_container(transport_in, env), env,
-                     AXIS2_EXPOSE_HEADERS);
+            expose_headers_param = axutil_param_container_get_param(
+                axis2_transport_in_desc_param_container(transport_in, env), env,
+                AXIS2_EXPOSE_HEADERS);
         }
-        if (expose_headers_param)
+        if(expose_headers_param)
         {
             axis2_char_t *expose_headers_value = NULL;
             expose_headers_value = axutil_param_get_value(expose_headers_param, env);
-            if (expose_headers_value && 0 == axutil_strcasecmp (expose_headers_value, AXIS2_VALUE_TRUE))
+            if(expose_headers_value && 0 == axutil_strcasecmp(expose_headers_value,
+                AXIS2_VALUE_TRUE))
             {
                 expose_headers = AXIS2_TRUE;
             }
         }
     }
-    if (expose_headers)
+    if(expose_headers)
     {
-        if (svc_client->http_headers ==
-            axis2_msg_ctx_get_http_output_headers(msg_ctx, env))
+        if(svc_client->http_headers == axis2_msg_ctx_get_http_output_headers(msg_ctx, env))
         {
-            svc_client->http_status_code = 
-                axis2_msg_ctx_get_status_code(msg_ctx, env);
+            svc_client->http_status_code = axis2_msg_ctx_get_status_code(msg_ctx, env);
             return;
         }
     }
-    
-    if (svc_client->http_headers)
+
+    if(svc_client->http_headers)
     {
         axis2_http_header_t *header = NULL;
-        while (axutil_array_list_size(svc_client->http_headers, env))
+        while(axutil_array_list_size(svc_client->http_headers, env))
         {
-            header = (axis2_http_header_t *)
-                axutil_array_list_remove(svc_client->http_headers, env, 0);
-            if (header)
+            header = (axis2_http_header_t *)axutil_array_list_remove(svc_client->http_headers, env,
+                0);
+            if(header)
             {
                 axis2_http_header_free(header, env);
             }
@@ -1643,15 +1580,13 @@
     }
     svc_client->http_status_code = 0;
 
-    if (msg_ctx)
+    if(msg_ctx)
     {
-        if (expose_headers)
+        if(expose_headers)
         {
-            svc_client->http_headers =
-                axis2_msg_ctx_extract_http_output_headers(msg_ctx, env);
+            svc_client->http_headers = axis2_msg_ctx_extract_http_output_headers(msg_ctx, env);
         }
-        svc_client->http_status_code = 
-            axis2_msg_ctx_get_status_code(msg_ctx, env);
+        svc_client->http_status_code = axis2_msg_ctx_get_status_code(msg_ctx, env);
     }
 }
 

Modified: webservices/axis2/trunk/c/src/core/context/conf_ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/context/conf_ctx.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/context/conf_ctx.c (original)
+++ webservices/axis2/trunk/c/src/core/context/conf_ctx.c Tue Aug 18 10:15:49 2009
@@ -20,6 +20,7 @@
 #include <axis2_const.h>
 #include <axutil_uuid_gen.h>
 
+
 struct axis2_conf_ctx
 {
 
@@ -55,7 +56,7 @@
     axis2_conf_ctx_t *conf_ctx = NULL;
 
     conf_ctx = AXIS2_MALLOC(env->allocator, sizeof(axis2_conf_ctx_t));
-    if (!conf_ctx)
+    if(!conf_ctx)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
@@ -68,20 +69,19 @@
     conf_ctx->op_ctx_map = NULL;
     conf_ctx->svc_ctx_map = NULL;
     conf_ctx->svc_grp_ctx_map = NULL;
-    conf_ctx->mutex = axutil_thread_mutex_create(env->allocator,
-                                                 AXIS2_THREAD_MUTEX_DEFAULT);
-    if (!conf_ctx->mutex)
+    conf_ctx->mutex = axutil_thread_mutex_create(env->allocator, AXIS2_THREAD_MUTEX_DEFAULT);
+    if(!conf_ctx->mutex)
     {
         axis2_conf_ctx_free(conf_ctx, env);
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Could not create thread mutex");
         return NULL;
     }
 
-    if (conf)
+    if(conf)
         conf_ctx->conf = conf;
 
     conf_ctx->base = axis2_ctx_create(env);
-    if (!(conf_ctx->base))
+    if(!(conf_ctx->base))
     {
         axis2_conf_ctx_free(conf_ctx, env);
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Could not create base context");
@@ -89,29 +89,26 @@
     }
 
     conf_ctx->op_ctx_map = axutil_hash_make(env);
-    if (!(conf_ctx->op_ctx_map))
+    if(!(conf_ctx->op_ctx_map))
     {
         axis2_conf_ctx_free(conf_ctx, env);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Could not create operation context map");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Could not create operation context map");
         return NULL;
     }
 
     conf_ctx->svc_ctx_map = axutil_hash_make(env);
-    if (!(conf_ctx->svc_ctx_map))
+    if(!(conf_ctx->svc_ctx_map))
     {
         axis2_conf_ctx_free(conf_ctx, env);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Could not create service context map");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Could not create service context map");
         return NULL;
     }
 
     conf_ctx->svc_grp_ctx_map = axutil_hash_make(env);
-    if (!(conf_ctx->svc_grp_ctx_map))
+    if(!(conf_ctx->svc_grp_ctx_map))
     {
         axis2_conf_ctx_free(conf_ctx, env);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Could not create service group context map");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Could not create service group context map");
         return NULL;
     }
 
@@ -124,7 +121,7 @@
     const axutil_env_t * env,
     axis2_conf_t * conf)
 {
-    conf_ctx->conf = conf;      /* We just maintain a shallow copy here */
+    conf_ctx->conf = conf; /* We just maintain a shallow copy here */
     return AXIS2_SUCCESS;
 }
 
@@ -176,10 +173,9 @@
     axis2_op_ctx_t * op_ctx)
 {
     axutil_thread_mutex_lock(conf_ctx->mutex);
-    if (conf_ctx->op_ctx_map)
+    if(conf_ctx->op_ctx_map)
     {
-        axutil_hash_set(conf_ctx->op_ctx_map,
-                        message_id, AXIS2_HASH_KEY_STRING, op_ctx);
+        axutil_hash_set(conf_ctx->op_ctx_map, message_id, AXIS2_HASH_KEY_STRING, op_ctx);
     }
     axutil_thread_mutex_unlock(conf_ctx->mutex);
     return AXIS2_SUCCESS;
@@ -196,11 +192,10 @@
     AXIS2_PARAM_CHECK(env->error, message_id, NULL);
 
     axutil_thread_mutex_lock(conf_ctx->mutex);
-    if (conf_ctx->op_ctx_map)
+    if(conf_ctx->op_ctx_map)
     {
-        rv = (axis2_op_ctx_t *) axutil_hash_get(conf_ctx->op_ctx_map,
-                                                message_id,
-                                                AXIS2_HASH_KEY_STRING);
+        rv = (axis2_op_ctx_t *)axutil_hash_get(conf_ctx->op_ctx_map, message_id,
+            AXIS2_HASH_KEY_STRING);
     }
     axutil_thread_mutex_unlock(conf_ctx->mutex);
     return rv;
@@ -214,10 +209,9 @@
     axis2_svc_ctx_t * svc_ctx)
 {
     axutil_thread_mutex_lock(conf_ctx->mutex);
-    if (conf_ctx->svc_ctx_map)
+    if(conf_ctx->svc_ctx_map)
     {
-        axutil_hash_set(conf_ctx->svc_ctx_map,
-                        svc_id, AXIS2_HASH_KEY_STRING, svc_ctx);
+        axutil_hash_set(conf_ctx->svc_ctx_map, svc_id, AXIS2_HASH_KEY_STRING, svc_ctx);
     }
     axutil_thread_mutex_unlock(conf_ctx->mutex);
     return AXIS2_SUCCESS;
@@ -232,10 +226,10 @@
     axis2_svc_ctx_t *rv = NULL;
 
     axutil_thread_mutex_lock(conf_ctx->mutex);
-    if (conf_ctx->svc_ctx_map)
+    if(conf_ctx->svc_ctx_map)
     {
-        rv = (axis2_svc_ctx_t *) axutil_hash_get(conf_ctx->svc_ctx_map,
-                                                 svc_id, AXIS2_HASH_KEY_STRING);
+        rv = (axis2_svc_ctx_t *)axutil_hash_get(conf_ctx->svc_ctx_map, svc_id,
+            AXIS2_HASH_KEY_STRING);
     }
     axutil_thread_mutex_unlock(conf_ctx->mutex);
     return rv;
@@ -249,10 +243,9 @@
     axis2_svc_grp_ctx_t * svc_grp_ctx)
 {
     axutil_thread_mutex_lock(conf_ctx->mutex);
-    if (conf_ctx->svc_grp_ctx_map)
+    if(conf_ctx->svc_grp_ctx_map)
     {
-        axutil_hash_set(conf_ctx->svc_grp_ctx_map,
-                        svc_grp_id, AXIS2_HASH_KEY_STRING, svc_grp_ctx);
+        axutil_hash_set(conf_ctx->svc_grp_ctx_map, svc_grp_id, AXIS2_HASH_KEY_STRING, svc_grp_ctx);
     }
     axutil_thread_mutex_unlock(conf_ctx->mutex);
     return AXIS2_SUCCESS;
@@ -266,11 +259,10 @@
 {
     axis2_svc_grp_ctx_t *rv = NULL;
     axutil_thread_mutex_lock(conf_ctx->mutex);
-    if (conf_ctx->svc_grp_ctx_map)
+    if(conf_ctx->svc_grp_ctx_map)
     {
-        rv = (axis2_svc_grp_ctx_t *) axutil_hash_get(conf_ctx->svc_grp_ctx_map,
-                                                     svc_grp_id,
-                                                     AXIS2_HASH_KEY_STRING);
+        rv = (axis2_svc_grp_ctx_t *)axutil_hash_get(conf_ctx->svc_grp_ctx_map, svc_grp_id,
+            AXIS2_HASH_KEY_STRING);
     }
     axutil_thread_mutex_unlock(conf_ctx->mutex);
     return rv;
@@ -295,16 +287,16 @@
     const axis2_char_t * path)
 {
     axutil_thread_mutex_lock(conf_ctx->mutex);
-    if (conf_ctx->root_dir)
+    if(conf_ctx->root_dir)
     {
         AXIS2_FREE(env->allocator, conf_ctx->root_dir);
         conf_ctx->root_dir = NULL;
     }
 
-    if (path)
+    if(path)
     {
         conf_ctx->root_dir = axutil_strdup(env, path);
-        if (!(conf_ctx->root_dir))
+        if(!(conf_ctx->root_dir))
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
             axutil_thread_mutex_unlock(conf_ctx->mutex);
@@ -328,35 +320,32 @@
     axutil_thread_mutex_lock(conf_ctx->mutex);
     conf_ctx->conf = conf;
 
-    for (hi = axutil_hash_first(conf_ctx->op_ctx_map, env);
-         hi; hi = axutil_hash_next(env, hi))
+    for(hi = axutil_hash_first(conf_ctx->op_ctx_map, env); hi; hi = axutil_hash_next(env, hi))
     {
         axutil_hash_this(hi, NULL, NULL, &ctx);
-        if (ctx)
+        if(ctx)
         {
-            axis2_op_ctx_t *op_ctx = (axis2_op_ctx_t *) ctx;
+            axis2_op_ctx_t *op_ctx = (axis2_op_ctx_t *)ctx;
             axis2_op_ctx_init(op_ctx, env, conf);
         }
     }
 
-    for (hi = axutil_hash_first(conf_ctx->svc_ctx_map, env);
-         hi; hi = axutil_hash_next(env, hi))
+    for(hi = axutil_hash_first(conf_ctx->svc_ctx_map, env); hi; hi = axutil_hash_next(env, hi))
     {
         axutil_hash_this(hi, NULL, NULL, &ctx);
-        if (ctx)
+        if(ctx)
         {
-            axis2_svc_ctx_t *svc_ctx = (axis2_svc_ctx_t *) ctx;
+            axis2_svc_ctx_t *svc_ctx = (axis2_svc_ctx_t *)ctx;
             axis2_svc_ctx_init(svc_ctx, env, conf);
         }
     }
 
-    for (hi = axutil_hash_first(conf_ctx->svc_grp_ctx_map, env);
-         hi; hi = axutil_hash_next(env, hi))
+    for(hi = axutil_hash_first(conf_ctx->svc_grp_ctx_map, env); hi; hi = axutil_hash_next(env, hi))
     {
         axutil_hash_this(hi, NULL, NULL, &ctx);
-        if (ctx)
+        if(ctx)
         {
-            axis2_svc_grp_ctx_t *svc_grp_ctx = (axis2_svc_grp_ctx_t *) ctx;
+            axis2_svc_grp_ctx_t *svc_grp_ctx = (axis2_svc_grp_ctx_t *)ctx;
             axis2_svc_grp_ctx_init(svc_grp_ctx, env, conf);
         }
     }
@@ -369,22 +358,21 @@
     axis2_conf_ctx_t * conf_ctx,
     const axutil_env_t * env)
 {
-    if (conf_ctx->base)
+    if(conf_ctx->base)
     {
         axis2_ctx_free(conf_ctx->base, env);
     }
 
-    if (conf_ctx->op_ctx_map)
+    if(conf_ctx->op_ctx_map)
     {
         axutil_hash_index_t *hi = NULL;
         void *val = NULL;
-        for (hi = axutil_hash_first(conf_ctx->op_ctx_map, env); hi;
-             hi = axutil_hash_next(env, hi))
+        for(hi = axutil_hash_first(conf_ctx->op_ctx_map, env); hi; hi = axutil_hash_next(env, hi))
         {
             axis2_op_ctx_t *op_ctx = NULL;
             axutil_hash_this(hi, NULL, NULL, &val);
-            op_ctx = (axis2_op_ctx_t *) val;
-            if (op_ctx)
+            op_ctx = (axis2_op_ctx_t *)val;
+            if(op_ctx)
                 axis2_op_ctx_free(op_ctx, env);
             val = NULL;
             op_ctx = NULL;
@@ -393,17 +381,16 @@
         axutil_hash_free(conf_ctx->op_ctx_map, env);
     }
 
-    if (conf_ctx->svc_ctx_map)
+    if(conf_ctx->svc_ctx_map)
     {
         axutil_hash_index_t *hi = NULL;
         void *val = NULL;
-        for (hi = axutil_hash_first(conf_ctx->svc_ctx_map, env); hi;
-             hi = axutil_hash_next(env, hi))
+        for(hi = axutil_hash_first(conf_ctx->svc_ctx_map, env); hi; hi = axutil_hash_next(env, hi))
         {
             axis2_svc_ctx_t *svc_ctx = NULL;
             axutil_hash_this(hi, NULL, NULL, &val);
-            svc_ctx = (axis2_svc_ctx_t *) val;
-            if (svc_ctx)
+            svc_ctx = (axis2_svc_ctx_t *)val;
+            if(svc_ctx)
                 axis2_svc_ctx_free(svc_ctx, env);
 
             val = NULL;
@@ -413,17 +400,17 @@
         axutil_hash_free(conf_ctx->svc_ctx_map, env);
     }
 
-    if (conf_ctx->svc_grp_ctx_map)
+    if(conf_ctx->svc_grp_ctx_map)
     {
         axutil_hash_index_t *hi = NULL;
         void *val = NULL;
-        for (hi = axutil_hash_first(conf_ctx->svc_grp_ctx_map, env); hi;
-             hi = axutil_hash_next(env, hi))
+        for(hi = axutil_hash_first(conf_ctx->svc_grp_ctx_map, env); hi; hi = axutil_hash_next(env,
+            hi))
         {
             axis2_svc_grp_ctx_t *svc_grp_ctx = NULL;
             axutil_hash_this(hi, NULL, NULL, &val);
-            svc_grp_ctx = (axis2_svc_grp_ctx_t *) val;
-            if (svc_grp_ctx)
+            svc_grp_ctx = (axis2_svc_grp_ctx_t *)val;
+            if(svc_grp_ctx)
                 axis2_svc_grp_ctx_free(svc_grp_ctx, env);
 
             val = NULL;
@@ -432,11 +419,11 @@
         }
         axutil_hash_free(conf_ctx->svc_grp_ctx_map, env);
     }
-    if (conf_ctx->conf)
+    if(conf_ctx->conf)
     {
         axis2_conf_free(conf_ctx->conf, env);
     }
-    if (conf_ctx->mutex)
+    if(conf_ctx->mutex)
     {
         axutil_thread_mutex_destroy(conf_ctx->mutex);
     }
@@ -464,17 +451,17 @@
     AXIS2_PARAM_CHECK(env->error, msg_ctx, NULL);
 
     svc = axis2_msg_ctx_get_svc(msg_ctx, env);
-    if (!svc)
+    if(!svc)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SERVICE_NOT_YET_FOUND, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                "Service not yet found in message context. Cannot proceed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Service not yet found in message context. Cannot proceed");
 
         return NULL;
     }
 
     qname = axis2_svc_get_qname(svc, env);
-    if (!qname)
+    if(!qname)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_SVC, AXIS2_FAILURE);
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Service found in message context has no name.");
@@ -482,7 +469,7 @@
     }
 
     svc_id = axutil_qname_get_localpart(qname, env);
-    if (!svc_id)
+    if(!svc_id)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_SVC, AXIS2_FAILURE);
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Service found in message context has no name.");
@@ -490,62 +477,62 @@
     }
 
     svc_grp = axis2_svc_get_parent(svc, env);
-    if (svc_grp)
+    if(svc_grp)
     {
-        svc_grp_ctx_id = (axis2_char_t *) axis2_svc_grp_get_name(svc_grp, env);
+        svc_grp_ctx_id = (axis2_char_t *)axis2_svc_grp_get_name(svc_grp, env);
     }
 
-    if (!svc_grp_ctx_id)
+    if(!svc_grp_ctx_id)
     {
-        svc_grp_ctx_id = (axis2_char_t *) axutil_string_get_buffer(axis2_msg_ctx_get_svc_grp_ctx_id(
+        svc_grp_ctx_id = (axis2_char_t *)axutil_string_get_buffer(axis2_msg_ctx_get_svc_grp_ctx_id(
             msg_ctx, env), env);
     }
 
     /* By this time service group context id must have a value, either from transport or from 
      * addressing 
      */
-    if (svc_grp_ctx_id)
+    if(svc_grp_ctx_id)
     {
-        svc_grp_ctx = (axis2_svc_grp_ctx_t *) axutil_hash_get(conf_ctx->svc_grp_ctx_map, 
+        svc_grp_ctx = (axis2_svc_grp_ctx_t *)axutil_hash_get(conf_ctx->svc_grp_ctx_map,
             svc_grp_ctx_id, AXIS2_HASH_KEY_STRING);
 
-        if (svc_grp_ctx)
+        if(svc_grp_ctx)
         {
             svc_ctx = axis2_svc_grp_ctx_get_svc_ctx(svc_grp_ctx, env, svc_id);
-            if (!svc_ctx)
+            if(!svc_ctx)
             {
                 AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_SVC_GRP, AXIS2_FAILURE);
-                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                        "Service group context has no servie context set for service %s", svc_id);
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                    "Service group context has no servie context set for service %s", svc_id);
 
                 return NULL;
             }
         }
     }
 
-    if (!svc_grp_ctx_id)
+    if(!svc_grp_ctx_id)
     {
         svc_grp_ctx_id = axutil_uuid_gen(env);
-        if (svc_grp_ctx_id)
+        if(svc_grp_ctx_id)
         {
-            axutil_string_t *svc_grp_ctx_id_str = axutil_string_create_assume_ownership(env, 
-                    &svc_grp_ctx_id);
+            axutil_string_t *svc_grp_ctx_id_str = axutil_string_create_assume_ownership(env,
+                &svc_grp_ctx_id);
 
             axis2_msg_ctx_set_svc_grp_ctx_id(msg_ctx, env, svc_grp_ctx_id_str);
             axutil_string_free(svc_grp_ctx_id_str, env);
         }
     }
 
-    if (!svc_grp_ctx)
+    if(!svc_grp_ctx)
     {
         axis2_svc_grp_t *svc_grp = NULL;
         svc_grp = axis2_svc_get_parent(svc, env);
         svc_grp_ctx = axis2_svc_grp_get_svc_grp_ctx(svc_grp, env, conf_ctx);
         svc_ctx = axis2_svc_grp_ctx_get_svc_ctx(svc_grp_ctx, env, svc_id);
-        if (!svc_ctx)
+        if(!svc_ctx)
         {
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_SVC_GRP, AXIS2_FAILURE);
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                 "Service group context has no servie context set for service %s", svc_id);
 
             return NULL;
@@ -556,9 +543,9 @@
     }
 
     /* When you come here operation context MUST have already been assigned
-       to the message context */
+     to the message context */
     op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
-    if (!op_ctx)
+    if(!op_ctx)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_MSG_CTX, AXIS2_FAILURE);
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Operation context not set for message context");
@@ -573,36 +560,36 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_conf_ctx_set_property(
-	axis2_conf_ctx_t *conf_ctx,
-	const axutil_env_t * env,
-	const axis2_char_t * key,
-	axutil_property_t * value)
+    axis2_conf_ctx_t *conf_ctx,
+    const axutil_env_t * env,
+    const axis2_char_t * key,
+    axutil_property_t * value)
 {
     axis2_status_t status = AXIS2_FAILURE;
     AXIS2_PARAM_CHECK(env->error, conf_ctx, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, key, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE);
-	
-	axutil_thread_mutex_lock(conf_ctx->mutex);
-	status = axis2_ctx_set_property(conf_ctx->base, env, key, value);
-	axutil_thread_mutex_unlock(conf_ctx->mutex);
 
-	return status;
+    axutil_thread_mutex_lock(conf_ctx->mutex);
+    status = axis2_ctx_set_property(conf_ctx->base, env, key, value);
+    axutil_thread_mutex_unlock(conf_ctx->mutex);
+
+    return status;
 }
 
 AXIS2_EXTERN axutil_property_t *AXIS2_CALL
 axis2_conf_ctx_get_property(
-	const axis2_conf_ctx_t * conf_ctx,
-	const axutil_env_t * env,
-	const axis2_char_t * key)
+    const axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env,
+    const axis2_char_t * key)
 {
     axutil_property_t* property = NULL;
     AXIS2_PARAM_CHECK(env->error, conf_ctx, NULL);
     AXIS2_PARAM_CHECK(env->error, key, NULL);
-	
-	axutil_thread_mutex_lock(conf_ctx->mutex);
-	property = axis2_ctx_get_property(conf_ctx->base, env, key);
-	axutil_thread_mutex_unlock(conf_ctx->mutex);
 
-	return property;
+    axutil_thread_mutex_lock(conf_ctx->mutex);
+    property = axis2_ctx_get_property(conf_ctx->base, env, key);
+    axutil_thread_mutex_unlock(conf_ctx->mutex);
+
+    return property;
 }

Modified: webservices/axis2/trunk/c/src/core/context/ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/context/ctx.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/context/ctx.c (original)
+++ webservices/axis2/trunk/c/src/core/context/ctx.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
@@ -39,7 +38,7 @@
     AXIS2_ENV_CHECK(env, NULL);
 
     ctx = AXIS2_MALLOC(env->allocator, sizeof(axis2_ctx_t));
-    if (!ctx)
+    if(!ctx)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -49,7 +48,7 @@
 
     ctx->property_map = axutil_hash_make(env);
     ctx->property_map_deep_copy = AXIS2_TRUE;
-    if (!(ctx->property_map))
+    if(!(ctx->property_map))
     {
         axis2_ctx_free(ctx, env);
         return NULL;
@@ -67,24 +66,23 @@
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    if (value)
+    if(value)
     {
         /* handle the case where we are setting a new value with the 
-           same key, we would have to free the existing value */
-        axutil_property_t *temp_value = axutil_hash_get(ctx->property_map,
-                                                        key,
-                                                        AXIS2_HASH_KEY_STRING);
-        if (temp_value)
+         same key, we would have to free the existing value */
+        axutil_property_t *temp_value = axutil_hash_get(ctx->property_map, key,
+            AXIS2_HASH_KEY_STRING);
+        if(temp_value)
         {
             void *temp_value_value = axutil_property_get_value(temp_value, env);
             void *value_value = axutil_property_get_value(value, env);
-            if (temp_value_value != value_value)
+            if(temp_value_value != value_value)
             {
                 axutil_property_free(temp_value, env);
             }
         }
     }
-    if (ctx->property_map)
+    if(ctx->property_map)
     {
         axutil_hash_set(ctx->property_map, key, AXIS2_HASH_KEY_STRING, value);
     }
@@ -100,15 +98,15 @@
 {
     axutil_property_t *ret = NULL;
 
-    if (ctx->property_map)
+    if(ctx->property_map)
     {
         ret = axutil_hash_get(ctx->property_map, key, AXIS2_HASH_KEY_STRING);
     }
 
     /** it is the responsibility of the caller to look-up parent if key is not found here
-        Note that in C implementation it is the responsibility of the deriving struct to 
-        handle the parent as we do not have the inheritance facility. In case of 
-        context it is not worth trying to mimic inheritance. */
+     Note that in C implementation it is the responsibility of the deriving struct to
+     handle the parent as we do not have the inheritance facility. In case of
+     context it is not worth trying to mimic inheritance. */
 
     return ret;
 }
@@ -136,20 +134,19 @@
 {
     AXIS2_ENV_CHECK(env, void);
 
-    if (ctx->property_map && ctx->property_map_deep_copy)
+    if(ctx->property_map && ctx->property_map_deep_copy)
     {
         axutil_hash_index_t *hi = NULL;
         void *val = NULL;
         const void *key = NULL;
-        for (hi = axutil_hash_first(ctx->property_map, env);
-             hi; hi = axutil_hash_next(env, hi))
+        for(hi = axutil_hash_first(ctx->property_map, env); hi; hi = axutil_hash_next(env, hi))
         {
             axutil_property_t *property = NULL;
 
             axutil_hash_this(hi, &key, NULL, &val);
-            property = (axutil_property_t *) val;
+            property = (axutil_property_t *)val;
 
-            if (property)
+            if(property)
             {
                 axutil_property_free(property, env);
             }
@@ -170,25 +167,24 @@
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    if (ctx->property_map && ctx->property_map_deep_copy)
+    if(ctx->property_map && ctx->property_map_deep_copy)
     {
         axutil_hash_index_t *hi = NULL;
         void *val = NULL;
         const void *key = NULL;
-        for (hi = axutil_hash_first(ctx->property_map, env);
-             hi; hi = axutil_hash_next(env, hi))
+        for(hi = axutil_hash_first(ctx->property_map, env); hi; hi = axutil_hash_next(env, hi))
         {
             axutil_property_t *property = NULL;
 
             axutil_hash_this(hi, &key, NULL, &val);
-            property = (axutil_property_t *) val;
+            property = (axutil_property_t *)val;
 
-            if (property)
+            if(property)
             {
                 axutil_property_free(property, env);
             }
         }
-        if (ctx->property_map != map)   /* handle repeated invocation case */
+        if(ctx->property_map != map) /* handle repeated invocation case */
         {
             axutil_hash_free(ctx->property_map, env);
         }