axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r580276 [3/26] - in /webservices/axis2/trunk/c/src: core/addr/ core/clientapi/ core/context/ core/deployment/ core/description/ core/engine/ core/phaseresolver/ core/receivers/ core/transport/ core/transport/http/common/ core/transport/http...
Date Fri, 28 Sep 2007 09:53:04 GMT
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=580276&r1=580275&r2=580276&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/clientapi/svc_client.c (original)
+++ webservices/axis2/trunk/c/src/core/clientapi/svc_client.c Fri Sep 28 02:52:58 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -63,40 +64,42 @@
     axiom_soap_envelope_t *last_response_soap_envelope;
 
     axis2_bool_t last_response_has_fault;
-    
+
     axis2_bool_t reuse;
 
 };
 
-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(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(const axutil_env_t *env,
-    axis2_svc_client_t *svc_client);
+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(
+    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(
+    const axutil_env_t * env,
+    axis2_svc_client_t * svc_client);
+
+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,
+    const axiom_node_t * payload);
 
-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,
-    const axiom_node_t *payload);
-    
 AXIS2_EXTERN axis2_svc_client_t *AXIS2_CALL
-axis2_svc_client_create(const axutil_env_t *env,
-    const axis2_char_t *client_home)
+axis2_svc_client_create(
+    const axutil_env_t * env,
+    const axis2_char_t * client_home)
 {
     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);
 
     if (!svc_client)
     {
@@ -107,12 +110,13 @@
 }
 
 AXIS2_EXTERN axis2_svc_client_t *AXIS2_CALL
-axis2_svc_client_create_for_dynamic_invocation(const axutil_env_t *env,
-    axis2_conf_ctx_t *conf_ctx,
-    const axutil_uri_t *wsdl_uri,
-    const axutil_qname_t *wsdl_svc_qname,
-    const axis2_char_t *endpoint_name,
-    const axis2_char_t *client_home)
+axis2_svc_client_create_for_dynamic_invocation(
+    const axutil_env_t * env,
+    axis2_conf_ctx_t * conf_ctx,
+    const axutil_uri_t * wsdl_uri,
+    const axutil_qname_t * wsdl_svc_qname,
+    const axis2_char_t * endpoint_name,
+    const axis2_char_t * client_home)
 {
     axis2_svc_client_t *svc_client = NULL;
     axis2_svc_grp_t *svc_grp = NULL;
@@ -151,15 +155,16 @@
 
     /* the following method call will 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))
+                                                        conf_ctx, client_home))
     {
         axis2_svc_client_free(svc_client, env);
         return NULL;
     }
 
-    svc_client->conf =  axis2_conf_ctx_get_conf(svc_client->conf_ctx, env);
-    repos_path =  axis2_conf_get_repo(svc_client->conf, env);
-    wsdl_path = axutil_strcat(env, repos_path, AXIS2_PATH_SEP_STR, "woden", NULL);
+    svc_client->conf = axis2_conf_ctx_get_conf(svc_client->conf_ctx, env);
+    repos_path = axis2_conf_get_repo(svc_client->conf, env);
+    wsdl_path =
+        axutil_strcat(env, repos_path, AXIS2_PATH_SEP_STR, "woden", NULL);
 
     svc_client->options = axis2_options_create(env);
     if (svc_client->svc)
@@ -171,23 +176,23 @@
         ops = axis2_svc_get_all_ops(svc_client->svc, env);
         for (i = axutil_hash_first(ops, env); i; i = axutil_hash_next(env, i))
         {
-            axis2_phases_info_t * info = NULL;
+            axis2_phases_info_t *info = NULL;
             axutil_hash_this(i, NULL, NULL, &v);
             op = (axis2_op_t *) v;
 
             /* Setting operation phase */
-            info =  axis2_conf_get_phases_info(svc_client->conf, env);
+            info = axis2_conf_get_phases_info(svc_client->conf, env);
             axis2_phases_info_set_op_phases(info, env, op);
         }
     }
     else
-    return AXIS2_FAILURE;
+        return AXIS2_FAILURE;
 
     /** 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);
+        axis2_conf_add_svc(svc_client->conf, env, svc_client->svc);
     }
 
     /** create a service context for myself: create a new service group
@@ -199,33 +204,35 @@
         return NULL;
     }
 
-    svc_grp_ctx =  axis2_svc_grp_get_svc_grp_ctx(svc_grp, env,
-        svc_client->conf_ctx);
+    svc_grp_ctx = axis2_svc_grp_get_svc_grp_ctx(svc_grp, env,
+                                                svc_client->conf_ctx);
     if (!svc_grp_ctx)
     {
         return NULL;
     }
 
-    svc_grp_name =  axis2_svc_grp_get_name(svc_grp, env);
+    svc_grp_name = axis2_svc_grp_get_name(svc_grp, env);
     if (!svc_grp_name)
     {
-        return NULL; /* service group name is mandatory */
+        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);
+                                        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;
 }
 
 AXIS2_EXTERN axis2_svc_client_t *AXIS2_CALL
-axis2_svc_client_create_with_conf_ctx_and_svc(const axutil_env_t *env,
-    const axis2_char_t *client_home,
-    axis2_conf_ctx_t *conf_ctx,
-    axis2_svc_t *svc)
+axis2_svc_client_create_with_conf_ctx_and_svc(
+    const axutil_env_t * env,
+    const axis2_char_t * client_home,
+    axis2_conf_ctx_t * conf_ctx,
+    axis2_svc_t * svc)
 {
     axis2_svc_client_t *svc_client = NULL;
     axis2_svc_grp_t *svc_grp = NULL;
@@ -264,13 +271,13 @@
 
     /* the following method call will 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))
+                                                        conf_ctx, client_home))
     {
         axis2_svc_client_free(svc_client, env);
         return NULL;
     }
 
-    svc_client->conf =  axis2_conf_ctx_get_conf(svc_client->conf_ctx, env);
+    svc_client->conf = axis2_conf_ctx_get_conf(svc_client->conf_ctx, env);
 
     if (svc)
     {
@@ -278,8 +285,9 @@
     }
     else
     {
-        if (! (svc_client->svc = axis2_svc_client_create_annonymous_svc(
-            svc_client, env)))
+        if (!
+            (svc_client->svc =
+             axis2_svc_client_create_annonymous_svc(svc_client, env)))
         {
             axis2_svc_client_free(svc_client, env);
             return NULL;
@@ -287,10 +295,10 @@
     }
 
     /** 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);
+        axis2_conf_add_svc(svc_client->conf, env, svc_client->svc);
     }
 
     /** create a service context for myself: create a new service group
@@ -302,39 +310,42 @@
         return NULL;
     }
 
-    svc_grp_ctx =  axis2_svc_grp_get_svc_grp_ctx(svc_grp, env,
-        svc_client->conf_ctx);
+    svc_grp_ctx = axis2_svc_grp_get_svc_grp_ctx(svc_grp, env,
+                                                svc_client->conf_ctx);
     if (!svc_grp_ctx)
     {
         return NULL;
     }
 
-    svc_grp_name =  axis2_svc_grp_get_name(svc_grp, env);
+    svc_grp_name = axis2_svc_grp_get_name(svc_grp, env);
     if (!svc_grp_name)
     {
-        return NULL; /* service group name is mandatory */
+        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);
+                                        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;
 }
 
 AXIS2_EXTERN axis2_svc_t *AXIS2_CALL
-axis2_svc_client_get_svc(const axis2_svc_client_t *svc_client,
-    const axutil_env_t *env)
+axis2_svc_client_get_svc(
+    const axis2_svc_client_t * svc_client,
+    const axutil_env_t * env)
 {
     return svc_client->svc;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_svc_client_set_options(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    const axis2_options_t *options)
+axis2_svc_client_set_options(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    const axis2_options_t * options)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
@@ -342,21 +353,23 @@
     {
         axis2_options_free(svc_client->options, env);
     }
-    svc_client->options = (axis2_options_t *)options;
+    svc_client->options = (axis2_options_t *) options;
     return AXIS2_SUCCESS;
 }
 
 AXIS2_EXTERN const axis2_options_t *AXIS2_CALL
-axis2_svc_client_get_options(const axis2_svc_client_t *svc_client,
-    const axutil_env_t *env)
+axis2_svc_client_get_options(
+    const axis2_svc_client_t * svc_client,
+    const axutil_env_t * env)
 {
     return svc_client->options;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_svc_client_set_override_options(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    const axis2_options_t *override_options)
+axis2_svc_client_set_override_options(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    const axis2_options_t * override_options)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
@@ -365,22 +378,24 @@
         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;
 }
 
 AXIS2_EXTERN const axis2_options_t *AXIS2_CALL
-axis2_svc_client_get_override_options(const axis2_svc_client_t *svc_client,
-    const axutil_env_t *env)
+axis2_svc_client_get_override_options(
+    const axis2_svc_client_t * svc_client,
+    const axutil_env_t * env)
 {
     return svc_client->override_options;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_svc_client_engage_module(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    const axis2_char_t *module_name)
+axis2_svc_client_engage_module(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    const axis2_char_t * module_name)
 {
     axis2_module_desc_t *module = NULL;
     axutil_qname_t *mod_qname = NULL;
@@ -392,7 +407,7 @@
 
     if (mod_qname)
     {
-        module =  axis2_conf_get_module(svc_client->conf, env, mod_qname);
+        module = axis2_conf_get_module(svc_client->conf, env, mod_qname);
 
         axutil_qname_free(mod_qname, env);
         mod_qname = NULL;
@@ -405,15 +420,16 @@
     if (module)
     {
         return axis2_svc_engage_module(svc_client->svc, env, module,
-            svc_client->conf);
+                                       svc_client->conf);
     }
     return AXIS2_FAILURE;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_svc_client_disengage_module(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    const axis2_char_t *module_name)
+axis2_svc_client_disengage_module(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    const axis2_char_t * module_name)
 {
     axis2_module_desc_t *module = NULL;
     axutil_qname_t *mod_qname = NULL;
@@ -424,7 +440,7 @@
     mod_qname = axutil_qname_create(env, module_name, NULL, NULL);
     if (mod_qname)
     {
-        module =  axis2_conf_get_module(svc_client->conf, env, mod_qname);
+        module = axis2_conf_get_module(svc_client->conf, env, mod_qname);
         axutil_qname_free(mod_qname, env);
         mod_qname = NULL;
     }
@@ -436,15 +452,16 @@
     if (module)
     {
         return axis2_svc_disengage_module(svc_client->svc, env, module,
-            svc_client->conf);
+                                          svc_client->conf);
     }
     return AXIS2_FAILURE;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_svc_client_add_header(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    axiom_node_t *header)
+axis2_svc_client_add_header(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    axiom_node_t * header)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
@@ -463,10 +480,12 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_svc_client_remove_all_headers(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env)
+axis2_svc_client_remove_all_headers(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env)
 {
-    int i = 0, size = 0;
+    int i = 0,
+        size = 0;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
     if (!svc_client->headers)
@@ -479,23 +498,24 @@
     for (i = 0; i < size; i++)
     {
         /*axiom_node_t *node = NULL;
-        node = axutil_array_list_get(svc_client->headers, env, i);
+           node = axutil_array_list_get(svc_client->headers, env, i);
 
-        if (node)
-        {
-            axiom_node_free_tree(node, env);
-            node = NULL;
-        }*/
+           if (node)
+           {
+           axiom_node_free_tree(node, env);
+           node = NULL;
+           } */
         axutil_array_list_remove(svc_client->headers, env, i);
     }
     return AXIS2_SUCCESS;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_svc_client_send_robust_with_op_qname(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    const axutil_qname_t *op_qname,
-    const axiom_node_t *payload)
+axis2_svc_client_send_robust_with_op_qname(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    const axutil_qname_t * op_qname,
+    const axiom_node_t * payload)
 {
     axis2_msg_ctx_t *msg_ctx = NULL;
     axis2_status_t status = AXIS2_FAILURE;
@@ -505,25 +525,28 @@
 
     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);
         qname_free_flag = AXIS2_TRUE;
     }
 
     msg_ctx = axis2_msg_ctx_create(env,
-        axis2_svc_ctx_get_conf_ctx(svc_client->svc_ctx, env), NULL, NULL);
+                                   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;
     }
 
     axis2_op_client_add_out_msg_ctx(svc_client->op_client, env, msg_ctx);
     status = axis2_op_client_execute(svc_client->op_client, env, AXIS2_TRUE);
-    
+
     if (qname_free_flag)
     {
         axutil_qname_free((axutil_qname_t *) op_qname, env);
@@ -533,18 +556,21 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_svc_client_send_robust(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    const axiom_node_t *payload)
+axis2_svc_client_send_robust(
+    axis2_svc_client_t * svc_client,
+    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
-axis2_svc_client_fire_and_forget_with_op_qname(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    const axutil_qname_t *op_qname,
-    const axiom_node_t *payload)
+axis2_svc_client_fire_and_forget_with_op_qname(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    const axutil_qname_t * op_qname,
+    const axiom_node_t * payload)
 {
     axis2_msg_ctx_t *msg_ctx = NULL;
     axis2_bool_t qname_free_flag = AXIS2_FALSE;
@@ -561,20 +587,22 @@
     }
 
     msg_ctx = axis2_msg_ctx_create(env,
-       axis2_svc_ctx_get_conf_ctx(svc_client->svc_ctx, env), NULL, NULL);
+                                   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;
     }
 
     axis2_op_client_add_out_msg_ctx(svc_client->op_client, env, msg_ctx);
     axis2_op_client_execute(svc_client->op_client, env, AXIS2_FALSE);
-    
+
     if (qname_free_flag)
     {
         axutil_qname_free((axutil_qname_t *) op_qname, env);
@@ -584,19 +612,21 @@
 }
 
 AXIS2_EXTERN void AXIS2_CALL
-axis2_svc_client_fire_and_forget(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    const axiom_node_t *payload)
+axis2_svc_client_fire_and_forget(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    const axiom_node_t * payload)
 {
     axis2_svc_client_fire_and_forget_with_op_qname(svc_client, env, NULL,
-        payload);
+                                                   payload);
 }
 
-AXIS2_EXTERN axiom_node_t* AXIS2_CALL
-axis2_svc_client_send_receive_with_op_qname(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    const axutil_qname_t *op_qname,
-    const axiom_node_t *payload)
+AXIS2_EXTERN axiom_node_t *AXIS2_CALL
+axis2_svc_client_send_receive_with_op_qname(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    const axutil_qname_t * op_qname,
+    const axiom_node_t * payload)
 {
     axiom_soap_envelope_t *soap_envelope = NULL;
     axiom_soap_body_t *soap_body = NULL;
@@ -619,7 +649,9 @@
         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_str =
+                axutil_uri_to_string(action_uri, env,
+                                     AXIS2_URI_UNP_OMITUSERINFO);
             axis2_options_set_action(svc_client->options, env, action_str);
         }
     }
@@ -637,9 +669,9 @@
         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)
@@ -648,39 +680,53 @@
         }
 
         /* call two channel non blocking invoke to do the work and wait on the callback */
-        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)))
         {
-            /*wait till the response arrives*/
+            /*wait till the response arrives */
             if (index-- >= 0)
             {
                 AXIS2_USLEEP(10000);
-                msg_ctx = (axis2_msg_ctx_t *)axis2_op_client_get_msg_ctx(
-                    svc_client->op_client, env,
-                    AXIS2_WSDL_MESSAGE_LABEL_OUT);
+                msg_ctx =
+                    (axis2_msg_ctx_t *) axis2_op_client_get_msg_ctx(svc_client->
+                                                                    op_client,
+                                                                    env,
+                                                                    AXIS2_WSDL_MESSAGE_LABEL_OUT);
                 if (msg_ctx)
                 {
-                    axis2_msg_ctx_t *res_msg_ctx = axis2_op_client_receive(env, msg_ctx);
+                    axis2_msg_ctx_t *res_msg_ctx =
+                        axis2_op_client_receive(env, msg_ctx);
                     if (res_msg_ctx)
                     {
-                        soap_envelope =  axis2_msg_ctx_get_soap_envelope(res_msg_ctx, env);
+                        soap_envelope =
+                            axis2_msg_ctx_get_soap_envelope(res_msg_ctx, env);
                         svc_client->last_response_soap_envelope = soap_envelope;
                         if (soap_envelope)
                         {
-                            soap_body = axiom_soap_envelope_get_body(soap_envelope, env);
+                            soap_body =
+                                axiom_soap_envelope_get_body(soap_envelope,
+                                                             env);
 
                             if (soap_body)
                             {
-                                svc_client->last_response_has_fault = 
+                                svc_client->last_response_has_fault =
                                     axiom_soap_body_has_fault(soap_body, env);
-                                soap_node = axiom_soap_body_get_base_node(soap_body, env);
+                                soap_node =
+                                    axiom_soap_body_get_base_node(soap_body,
+                                                                  env);
                                 if (soap_node)
                                 {
-                                    return axiom_node_get_first_element(soap_node, env);
+                                    return
+                                        axiom_node_get_first_element(soap_node,
+                                                                     env);
                                 }
                             }
                         }
@@ -690,7 +736,8 @@
             }
             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);
                 return NULL;
             }
         }
@@ -699,10 +746,12 @@
 
         /* 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);
+                                       axis2_svc_ctx_get_conf_ctx(svc_client->
+                                                                  svc_ctx, env),
+                                       NULL, NULL);
         axis2_op_client_add_msg_ctx(svc_client->op_client, env, msg_ctx);
 
-         axis2_msg_ctx_set_soap_envelope(msg_ctx, env, soap_envelope);
+        axis2_msg_ctx_set_soap_envelope(msg_ctx, env, soap_envelope);
         /* end of hack to get rid of memory leak */
 
         /* process the result of the invocation */
@@ -710,7 +759,9 @@
         {
             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;
             }
         }
@@ -721,32 +772,34 @@
         axis2_msg_ctx_t *msg_ctx = 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))
+                                       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 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;
         }
 
         axis2_op_client_add_msg_ctx(svc_client->op_client, env, msg_ctx);
         axis2_op_client_execute(svc_client->op_client, env, AXIS2_TRUE);
-        res_msg_ctx = (axis2_msg_ctx_t *)axis2_op_client_get_msg_ctx(
-            svc_client->op_client, env, AXIS2_WSDL_MESSAGE_LABEL_IN);
+        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)
         {
-            soap_envelope =  axis2_msg_ctx_get_soap_envelope(res_msg_ctx, env);
+            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); /* set in msg_ctx to be NULL to reset */
+            axis2_op_client_add_msg_ctx(svc_client->op_client, env, res_msg_ctx);   /* set in msg_ctx to be NULL to reset */
         }
     }
 
@@ -765,27 +818,32 @@
 
     if (!soap_body)
     {
-        axiom_node_t *node =  axiom_soap_envelope_get_base_node(soap_envelope, env);
+        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_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);
             }
         }
         return NULL;
     }
 
-    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))
-	{
-            axiom_soap_body_convert_fault_to_soap11(soap_body, 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)
@@ -796,20 +854,22 @@
 }
 
 AXIS2_EXTERN axiom_node_t *AXIS2_CALL
-axis2_svc_client_send_receive(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    const axiom_node_t *payload)
+axis2_svc_client_send_receive(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    const axiom_node_t * payload)
 {
     return axis2_svc_client_send_receive_with_op_qname(svc_client, env, NULL,
-        payload);
+                                                       payload);
 }
 
 AXIS2_EXTERN void AXIS2_CALL
-axis2_svc_client_send_receive_non_blocking_with_op_qname(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    const axutil_qname_t *op_qname,
-    const axiom_node_t *payload,
-    axis2_callback_t *callback)
+axis2_svc_client_send_receive_non_blocking_with_op_qname(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    const axutil_qname_t * op_qname,
+    const axiom_node_t * payload,
+    axis2_callback_t * callback)
 {
     axis2_msg_ctx_t *msg_ctx = NULL;
     AXIS2_TRANSPORT_ENUMS transport_in_protocol;
@@ -822,14 +882,15 @@
     }
 
     msg_ctx = axis2_msg_ctx_create(env,
-        axis2_svc_ctx_get_conf_ctx(svc_client->svc_ctx, env), NULL, NULL);
+                                   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;
     }
@@ -841,23 +902,25 @@
     {
         axis2_op_t *op = NULL;
 
-        transport_in_protocol = axis2_options_get_transport_in_protocol(
-           svc_client->options, env);
-        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);
+        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 */
         AXIS2_USLEEP(1);
 
         op = axis2_svc_get_op_with_qname(svc_client->svc, env, op_qname);
         axis2_op_set_msg_recv(op, env,
-            AXIS2_CALLBACK_RECV_GET_BASE(svc_client->callback_recv, 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);
+                                          svc_client->callback_recv);
     }
 
     axis2_op_client_execute(svc_client->op_client, env, AXIS2_FALSE);
-    
+
     if (qname_free_flag)
     {
         axutil_qname_free((axutil_qname_t *) op_qname, env);
@@ -868,19 +931,22 @@
 }
 
 AXIS2_EXTERN void AXIS2_CALL
-axis2_svc_client_send_receive_non_blocking(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    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(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    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_EXTERN axis2_op_client_t *AXIS2_CALL
-axis2_svc_client_create_op_client(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    const axutil_qname_t *op_qname)
+axis2_svc_client_create_op_client(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    const axutil_qname_t * op_qname)
 {
     axis2_op_t *op = NULL;
 
@@ -895,10 +961,11 @@
 
     if (!(svc_client->op_client) || svc_client->reuse)
     {
-        if(svc_client->reuse)
+        if (svc_client->reuse)
             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);
     }
 
     /**
@@ -909,9 +976,10 @@
     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_get_options(svc_client->
+                                                             op_client, env));
         axis2_op_client_set_options(svc_client->op_client, env,
-            svc_client->override_options);
+                                    svc_client->override_options);
     }
     svc_client->reuse = AXIS2_TRUE;
     axis2_op_client_set_reuse(svc_client->op_client, env, svc_client->reuse);
@@ -919,29 +987,31 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_svc_client_finalize_invoke(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env)
+axis2_svc_client_finalize_invoke(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env)
 {
     AXIS2_TRANSPORT_ENUMS transport_in_protocol;
 
     AXIS2_ENV_CHECK(env, 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)
     {
         return axis2_listener_manager_stop(svc_client->listener_manager,
-            env, transport_in_protocol);
+                                           env, transport_in_protocol);
     }
 
     return AXIS2_SUCCESS;
 }
 
 AXIS2_EXTERN const axis2_endpoint_ref_t *AXIS2_CALL
-axis2_svc_client_get_own_endpoint_ref(const axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    const axis2_char_t *transport)
+axis2_svc_client_get_own_endpoint_ref(
+    const axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    const axis2_char_t * transport)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
@@ -949,8 +1019,9 @@
 }
 
 AXIS2_EXTERN const axis2_endpoint_ref_t *AXIS2_CALL
-axis2_svc_client_get_target_endpoint_ref(const axis2_svc_client_t *svc_client,
-    const axutil_env_t *env)
+axis2_svc_client_get_target_endpoint_ref(
+    const axis2_svc_client_t * svc_client,
+    const axutil_env_t * env)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
@@ -958,9 +1029,10 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_svc_client_set_target_endpoint_ref(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    axis2_endpoint_ref_t *target_endpoint_ref)
+axis2_svc_client_set_target_endpoint_ref(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    axis2_endpoint_ref_t * target_endpoint_ref)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
@@ -968,8 +1040,9 @@
 }
 
 AXIS2_EXTERN axis2_svc_ctx_t *AXIS2_CALL
-axis2_svc_client_get_svc_ctx(const axis2_svc_client_t *svc_client,
-    const axutil_env_t *env)
+axis2_svc_client_get_svc_ctx(
+    const axis2_svc_client_t * svc_client,
+    const axutil_env_t * env)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
@@ -977,10 +1050,11 @@
 }
 
 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)
+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)
 {
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -1009,8 +1083,9 @@
 }
 
 static axis2_bool_t
-axis2_svc_client_init_data(const axutil_env_t *env,
-    axis2_svc_client_t *svc_client)
+axis2_svc_client_init_data(
+    const axutil_env_t * env,
+    axis2_svc_client_t * svc_client)
 {
     svc_client->svc = NULL;
 
@@ -1046,9 +1121,11 @@
 }
 
 static axis2_svc_t *
-axis2_svc_client_create_annonymous_svc(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env)
+axis2_svc_client_create_annonymous_svc(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env)
 {
+
     /**
      now add anonymous operations to the axis2 service for use with the
      shortcut client API. NOTE: We only add the ones we know we'll use
@@ -1057,7 +1134,9 @@
     */
     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);
@@ -1087,7 +1166,6 @@
     op_out_in = axis2_op_create_with_qname(env, tmp_qname);
     axutil_qname_free(tmp_qname, env);
 
-
     tmp_qname = axutil_qname_create(env, AXIS2_ANON_OUT_ONLY_OP, NULL, NULL);
 
     if (!tmp_qname)
@@ -1098,7 +1176,8 @@
     op_out_only = axis2_op_create_with_qname(env, tmp_qname);
     axutil_qname_free(tmp_qname, env);
 
-    tmp_qname = axutil_qname_create(env, AXIS2_ANON_ROBUST_OUT_ONLY_OP, NULL, NULL);
+    tmp_qname =
+        axutil_qname_create(env, AXIS2_ANON_ROBUST_OUT_ONLY_OP, NULL, NULL);
 
     if (!tmp_qname)
     {
@@ -1129,10 +1208,11 @@
 
     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);
+    info = axis2_conf_get_phases_info(svc_client->conf, env);
     axis2_phases_info_set_op_phases(info, env, op_out_in);
     axis2_phases_info_set_op_phases(info, env, op_out_only);
     axis2_phases_info_set_op_phases(info, env, op_robust_out_only);
@@ -1143,8 +1223,9 @@
 }
 
 AXIS2_EXTERN void AXIS2_CALL
-axis2_svc_client_free(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env)
+axis2_svc_client_free(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env)
 {
     AXIS2_ENV_CHECK(env, void);
 
@@ -1184,23 +1265,26 @@
 }
 
 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,
-    const axiom_node_t *payload)
+axis2_svc_client_fill_soap_envelope(
+    const axutil_env_t * env,
+    axis2_svc_client_t * svc_client,
+    axis2_msg_ctx_t * msg_ctx,
+    const axiom_node_t * payload)
 {
     const axis2_char_t *soap_version_uri;
     int soap_version;
     axiom_soap_envelope_t *envelope = NULL;
 
-    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)
     {
         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;
     }
@@ -1209,8 +1293,8 @@
         soap_version = AXIOM_SOAP12;
     }
 
-
-    envelope = axiom_soap_envelope_create_default_soap_envelope(env, soap_version);
+    envelope =
+        axiom_soap_envelope_create_default_soap_envelope(env, soap_version);
     if (!envelope)
     {
         return AXIS2_FALSE;
@@ -1254,43 +1338,46 @@
             node = axiom_soap_body_get_base_node(soap_body, env);
             if (node)
             {
-                axiom_node_add_child(node, env, (axiom_node_t *)payload);
+                axiom_node_add_child(node, env, (axiom_node_t *) payload);
             }
         }
     }
 
-     axis2_msg_ctx_set_soap_envelope(msg_ctx, env, envelope);
+    axis2_msg_ctx_set_soap_envelope(msg_ctx, env, envelope);
 
     return AXIS2_TRUE;
 }
 
-
 AXIS2_EXTERN axis2_op_client_t *AXIS2_CALL
-axis2_svc_client_get_op_client(const axis2_svc_client_t *svc_client,
-    const axutil_env_t *env)
+axis2_svc_client_get_op_client(
+    const axis2_svc_client_t * svc_client,
+    const axutil_env_t * env)
 {
     return svc_client->op_client;
 }
 
 AXIS2_EXTERN axiom_soap_envelope_t *AXIS2_CALL
-axis2_svc_client_get_last_response_soap_envelope(const axis2_svc_client_t *svc_client,
-    const axutil_env_t *env)
+axis2_svc_client_get_last_response_soap_envelope(
+    const axis2_svc_client_t * svc_client,
+    const axutil_env_t * env)
 {
     return svc_client->last_response_soap_envelope;
 }
 
 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
-axis2_svc_client_get_last_response_has_fault(const axis2_svc_client_t *svc_client,
-    const axutil_env_t *env)
+axis2_svc_client_get_last_response_has_fault(
+    const axis2_svc_client_t * svc_client,
+    const axutil_env_t * env)
 {
     return svc_client->last_response_has_fault;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_svc_client_set_proxy(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    axis2_char_t *proxy_host,
-    axis2_char_t *proxy_port)
+axis2_svc_client_set_proxy(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    axis2_char_t * proxy_host,
+    axis2_char_t * proxy_port)
 {
     axis2_transport_out_desc_t *trans_desc = NULL;
     axis2_conf_t *conf = NULL;
@@ -1305,51 +1392,56 @@
 
     AXIS2_PARAM_CHECK(env->error, proxy_host, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, proxy_port, AXIS2_FAILURE);
-    
+
     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)
         {
             return AXIS2_FAILURE;
         }
 
-        attribute = axutil_hash_make (env);
+        attribute = axutil_hash_make(env);
         host_obj = axutil_generic_obj_create(env);
-        port_obj  = axutil_generic_obj_create(env);
+        port_obj = axutil_generic_obj_create(env);
         host_attr = axiom_attribute_create(env, proxy_host, NULL, NULL);
-        port_attr = axiom_attribute_create(env, proxy_port, NULL,  NULL); 
+        port_attr = axiom_attribute_create(env, proxy_port, NULL, NULL);
         axutil_generic_obj_set_value(host_obj, env, host_attr);
         axutil_generic_obj_set_value(port_obj, env, port_attr);
 
-        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);
-        axutil_param_set_attributes (param, env, attribute);
-        axutil_param_container_add_param (param_container, env, param);
+        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);
+        axutil_param_set_attributes(param, env, attribute);
+        axutil_param_container_add_param(param_container, env, param);
 
     }
     return AXIS2_SUCCESS;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_svc_client_set_policy_from_om(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    axiom_node_t *root_node)
+axis2_svc_client_set_policy_from_om(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    axiom_node_t * root_node)
 {
 
     neethi_policy_t *neethi_policy = NULL;
 
     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);
     }
@@ -1359,11 +1451,11 @@
     }
 }
 
-
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_svc_client_set_policy(axis2_svc_client_t *svc_client,
-    const axutil_env_t *env,
-    neethi_policy_t *policy)
+axis2_svc_client_set_policy(
+    axis2_svc_client_t * svc_client,
+    const axutil_env_t * env,
+    neethi_policy_t * policy)
 {
 
     axis2_svc_t *svc = NULL;
@@ -1374,24 +1466,24 @@
 
     svc = axis2_svc_client_get_svc(svc_client, env);
 
-    if(!svc)
+    if (!svc)
     {
         return AXIS2_FAILURE;
     }
 
     desc = axis2_svc_get_base(svc, env);
-    if(!desc)
+    if (!desc)
     {
         return AXIS2_FAILURE;
     }
 
     policy_include = axis2_desc_get_policy_include(desc, env);
-    if(!policy_include)
+    if (!policy_include)
     {
         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;
 }
-

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=580276&r1=580275&r2=580276&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/context/conf_ctx.c (original)
+++ webservices/axis2/trunk/c/src/core/context/conf_ctx.c Fri Sep 28 02:52:58 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -22,13 +23,17 @@
 
 struct axis2_conf_ctx
 {
+
     /** base context struct */
     axis2_ctx_t *base;
+
     /** engine configuration */
     axis2_conf_t *conf;
+
     /** root directory */
     /* should be handled as a URL string ? */
     axis2_char_t *root_dir;
+
     /**
      * axutil_hash_t *containing message ID to
      * operation context mapping.
@@ -45,8 +50,8 @@
 
 AXIS2_EXTERN axis2_conf_ctx_t *AXIS2_CALL
 axis2_conf_ctx_create(
-    const axutil_env_t *env,
-    axis2_conf_t *conf)
+    const axutil_env_t * env,
+    axis2_conf_t * conf)
 {
     axis2_conf_ctx_t *conf_ctx = NULL;
 
@@ -66,7 +71,7 @@
     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);
+                                                 AXIS2_THREAD_MUTEX_DEFAULT);
     if (!conf_ctx->mutex)
     {
         axis2_conf_ctx_free(conf_ctx, env);
@@ -109,66 +114,66 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_conf_ctx_set_conf(
-    axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env,
-    axis2_conf_t *conf)
+    axis2_conf_ctx_t * conf_ctx,
+    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;
 }
 
 AXIS2_EXTERN axis2_ctx_t *AXIS2_CALL
 axis2_conf_ctx_get_base(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env)
+    const axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env)
 {
     return conf_ctx->base;
 }
 
 AXIS2_EXTERN axis2_conf_t *AXIS2_CALL
 axis2_conf_ctx_get_conf(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env)
+    const axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env)
 {
     return conf_ctx->conf;
 }
 
 AXIS2_EXTERN axutil_hash_t *AXIS2_CALL
 axis2_conf_ctx_get_op_ctx_map(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env)
+    const axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env)
 {
     return conf_ctx->op_ctx_map;
 }
 
 AXIS2_EXTERN axutil_hash_t *AXIS2_CALL
 axis2_conf_ctx_get_svc_ctx_map(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env)
+    const axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env)
 {
     return conf_ctx->svc_ctx_map;
 }
 
 AXIS2_EXTERN axutil_hash_t *AXIS2_CALL
 axis2_conf_ctx_get_svc_grp_ctx_map(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env)
+    const axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env)
 {
     return conf_ctx->svc_grp_ctx_map;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_conf_ctx_register_op_ctx(
-    axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env,
-    const axis2_char_t *message_id,
-    axis2_op_ctx_t *op_ctx)
+    axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env,
+    const axis2_char_t * message_id,
+    axis2_op_ctx_t * op_ctx)
 {
     axutil_thread_mutex_lock(conf_ctx->mutex);
     if (conf_ctx->op_ctx_map)
     {
         axutil_hash_set(conf_ctx->op_ctx_map,
-                message_id, AXIS2_HASH_KEY_STRING, op_ctx);
+                        message_id, AXIS2_HASH_KEY_STRING, op_ctx);
     }
     axutil_thread_mutex_unlock(conf_ctx->mutex);
     return AXIS2_SUCCESS;
@@ -176,9 +181,9 @@
 
 AXIS2_EXTERN axis2_op_ctx_t *AXIS2_CALL
 axis2_conf_ctx_get_op_ctx(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env,
-    const axis2_char_t *message_id)
+    const axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env,
+    const axis2_char_t * message_id)
 {
     axis2_op_ctx_t *rv = NULL;
 
@@ -188,8 +193,9 @@
     axutil_thread_mutex_lock(conf_ctx->mutex);
     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;
@@ -197,16 +203,16 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_conf_ctx_register_svc_ctx(
-    axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env,
-    const axis2_char_t *svc_id,
-    axis2_svc_ctx_t *svc_ctx)
+    axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env,
+    const axis2_char_t * svc_id,
+    axis2_svc_ctx_t * svc_ctx)
 {
     axutil_thread_mutex_lock(conf_ctx->mutex);
     if (conf_ctx->svc_ctx_map)
     {
         axutil_hash_set(conf_ctx->svc_ctx_map,
-                svc_id, AXIS2_HASH_KEY_STRING, svc_ctx);
+                        svc_id, AXIS2_HASH_KEY_STRING, svc_ctx);
     }
     axutil_thread_mutex_unlock(conf_ctx->mutex);
     return AXIS2_SUCCESS;
@@ -214,17 +220,17 @@
 
 AXIS2_EXTERN axis2_svc_ctx_t *AXIS2_CALL
 axis2_conf_ctx_get_svc_ctx(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env,
-    const axis2_char_t *svc_id)
+    const axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env,
+    const axis2_char_t * svc_id)
 {
     axis2_svc_ctx_t *rv = NULL;
 
     axutil_thread_mutex_lock(conf_ctx->mutex);
     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;
@@ -232,16 +238,16 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_conf_ctx_register_svc_grp_ctx(
-    axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env,
-    const axis2_char_t *svc_grp_id,
-    axis2_svc_grp_ctx_t *svc_grp_ctx)
+    axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env,
+    const axis2_char_t * svc_grp_id,
+    axis2_svc_grp_ctx_t * svc_grp_ctx)
 {
     axutil_thread_mutex_lock(conf_ctx->mutex);
     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);
+                        svc_grp_id, AXIS2_HASH_KEY_STRING, svc_grp_ctx);
     }
     axutil_thread_mutex_unlock(conf_ctx->mutex);
     return AXIS2_SUCCESS;
@@ -249,16 +255,17 @@
 
 AXIS2_EXTERN axis2_svc_grp_ctx_t *AXIS2_CALL
 axis2_conf_ctx_get_svc_grp_ctx(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env,
-    const axis2_char_t *svc_grp_id)
+    const axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env,
+    const axis2_char_t * svc_grp_id)
 {
     axis2_svc_grp_ctx_t *rv = NULL;
     axutil_thread_mutex_lock(conf_ctx->mutex);
     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;
@@ -266,8 +273,8 @@
 
 AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
 axis2_conf_ctx_get_root_dir(
-    const axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env)
+    const axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env)
 {
     axis2_char_t *rv = NULL;
     axutil_thread_mutex_lock(conf_ctx->mutex);
@@ -278,9 +285,9 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_conf_ctx_set_root_dir(
-    axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env,
-    const axis2_char_t *path)
+    axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env,
+    const axis2_char_t * path)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
@@ -307,9 +314,9 @@
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_conf_ctx_init(
-    axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env,
-    axis2_conf_t *conf)
+    axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env,
+    axis2_conf_t * conf)
 {
     axutil_hash_index_t *hi = NULL;
     void *ctx = NULL;
@@ -320,35 +327,35 @@
     conf_ctx->conf = conf;
 
     for (hi = axutil_hash_first(conf_ctx->op_ctx_map, env);
-            hi; hi = axutil_hash_next(env, hi))
+         hi; hi = axutil_hash_next(env, hi))
     {
         axutil_hash_this(hi, NULL, NULL, &ctx);
         if (ctx)
         {
-            axis2_op_ctx_t *op_ctx = (axis2_op_ctx_t*) ctx;
-             axis2_op_ctx_init(op_ctx, env, conf);
+            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))
+         hi; hi = axutil_hash_next(env, hi))
     {
         axutil_hash_this(hi, NULL, NULL, &ctx);
         if (ctx)
         {
-            axis2_svc_ctx_t *svc_ctx = (axis2_svc_ctx_t*) ctx;
-             axis2_svc_ctx_init(svc_ctx, env, conf);
+            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))
+         hi; hi = axutil_hash_next(env, hi))
     {
         axutil_hash_this(hi, NULL, NULL, &ctx);
         if (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);
+            axis2_svc_grp_ctx_t *svc_grp_ctx = (axis2_svc_grp_ctx_t *) ctx;
+            axis2_svc_grp_ctx_init(svc_grp_ctx, env, conf);
         }
     }
     axutil_thread_mutex_unlock(conf_ctx->mutex);
@@ -357,14 +364,14 @@
 
 AXIS2_EXTERN void AXIS2_CALL
 axis2_conf_ctx_free(
-    axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env)
+    axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env)
 {
     AXIS2_ENV_CHECK(env, void);
 
     if (conf_ctx->base)
     {
-         axis2_ctx_free(conf_ctx->base, env);
+        axis2_ctx_free(conf_ctx->base, env);
     }
 
     if (conf_ctx->op_ctx_map)
@@ -372,13 +379,13 @@
         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))
+             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)
-                 axis2_op_ctx_free(op_ctx, env);
+                axis2_op_ctx_free(op_ctx, env);
             val = NULL;
             op_ctx = NULL;
 
@@ -391,13 +398,13 @@
         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))
+             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)
-                 axis2_svc_ctx_free(svc_ctx, env);
+                axis2_svc_ctx_free(svc_ctx, env);
 
             val = NULL;
             svc_ctx = NULL;
@@ -411,13 +418,13 @@
         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))
+             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)
-                 axis2_svc_grp_ctx_free(svc_grp_ctx, env);
+                axis2_svc_grp_ctx_free(svc_grp_ctx, env);
 
             val = NULL;
             svc_grp_ctx = NULL;
@@ -427,7 +434,7 @@
     }
     if (conf_ctx->conf)
     {
-         axis2_conf_free(conf_ctx->conf, env);
+        axis2_conf_free(conf_ctx->conf, env);
     }
     if (conf_ctx->mutex)
     {
@@ -441,9 +448,9 @@
 
 AXIS2_EXTERN axis2_svc_grp_ctx_t *AXIS2_CALL
 axis2_conf_ctx_fill_ctxs(
-    axis2_conf_ctx_t *conf_ctx,
-    const axutil_env_t *env,
-    axis2_msg_ctx_t *msg_ctx)
+    axis2_conf_ctx_t * conf_ctx,
+    const axutil_env_t * env,
+    axis2_msg_ctx_t * msg_ctx)
 {
     axis2_char_t *svc_grp_ctx_id = NULL;
     axis2_svc_grp_ctx_t *svc_grp_ctx = NULL;
@@ -454,16 +461,15 @@
     axis2_char_t *svc_id = NULL;
     axis2_op_ctx_t *op_ctx = NULL;
 
-
     AXIS2_ENV_CHECK(env, NULL);
 
     AXIS2_PARAM_CHECK(env->error, msg_ctx, NULL);
 
-    svc =  axis2_msg_ctx_get_svc(msg_ctx, env);
+    svc = axis2_msg_ctx_get_svc(msg_ctx, env);
     if (!svc)
     {
         AXIS2_ERROR_SET(env->error,
-                AXIS2_ERROR_SERVICE_NOT_YET_FOUND, AXIS2_FAILURE);
+                        AXIS2_ERROR_SERVICE_NOT_YET_FOUND, AXIS2_FAILURE);
         return NULL;
     }
 
@@ -471,7 +477,7 @@
     if (!qname)
     {
         AXIS2_ERROR_SET(env->error,
-                AXIS2_ERROR_INVALID_STATE_SVC, AXIS2_FAILURE);
+                        AXIS2_ERROR_INVALID_STATE_SVC, AXIS2_FAILURE);
         return NULL;
     }
 
@@ -479,36 +485,39 @@
     if (!svc_id)
     {
         AXIS2_ERROR_SET(env->error,
-                AXIS2_ERROR_INVALID_STATE_SVC, AXIS2_FAILURE);
+                        AXIS2_ERROR_INVALID_STATE_SVC, AXIS2_FAILURE);
         return NULL;
     }
 
     svc_grp = axis2_svc_get_parent(svc, env);
     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)
     {
-        svc_grp_ctx_id = (axis2_char_t*)axutil_string_get_buffer(
-             axis2_msg_ctx_get_svc_grp_ctx_id(msg_ctx, env), env);
+        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)
     {
-        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);
+        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)
         {
-            svc_ctx =  axis2_svc_grp_ctx_get_svc_ctx(svc_grp_ctx, env, svc_id);
+            svc_ctx = axis2_svc_grp_ctx_get_svc_ctx(svc_grp_ctx, env, svc_id);
             if (!svc_ctx)
             {
                 AXIS2_ERROR_SET(env->error,
-                        AXIS2_ERROR_INVALID_STATE_SVC_GRP, AXIS2_FAILURE);
+                                AXIS2_ERROR_INVALID_STATE_SVC_GRP,
+                                AXIS2_FAILURE);
                 return NULL;
             }
         }
@@ -519,9 +528,9 @@
         svc_grp_ctx_id = axutil_uuid_gen(env);
         if (svc_grp_ctx_id)
         {
-            axutil_string_t *svc_grp_ctx_id_str = 
+            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);
+            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);
         }
     }
@@ -530,28 +539,31 @@
     {
         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);
+        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)
         {
-            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_SVC_GRP, AXIS2_FAILURE);
+            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_SVC_GRP,
+                            AXIS2_FAILURE);
             return NULL;
         }
-         axis2_svc_grp_ctx_set_id(svc_grp_ctx, env, svc_grp_ctx_id);
-        axis2_conf_ctx_register_svc_grp_ctx(conf_ctx, env, svc_grp_ctx_id, svc_grp_ctx);
+        axis2_svc_grp_ctx_set_id(svc_grp_ctx, env, svc_grp_ctx_id);
+        axis2_conf_ctx_register_svc_grp_ctx(conf_ctx, env, svc_grp_ctx_id,
+                                            svc_grp_ctx);
     }
 
     /* when you come here operation context MUST already been assigned
        to the message context */
-    op_ctx =  axis2_msg_ctx_get_op_ctx(msg_ctx, env);
+    op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
     if (!op_ctx)
     {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_MSG_CTX, AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_MSG_CTX,
+                        AXIS2_FAILURE);
         return NULL;
     }
 
-     axis2_op_ctx_set_parent(op_ctx, env, svc_ctx);
-     axis2_msg_ctx_set_svc_ctx(msg_ctx, env, svc_ctx);
-     axis2_msg_ctx_set_svc_grp_ctx(msg_ctx, env, svc_grp_ctx);
+    axis2_op_ctx_set_parent(op_ctx, env, svc_ctx);
+    axis2_msg_ctx_set_svc_ctx(msg_ctx, env, svc_ctx);
+    axis2_msg_ctx_set_svc_grp_ctx(msg_ctx, env, svc_grp_ctx);
     return svc_grp_ctx;
 }

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=580276&r1=580275&r2=580276&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/context/ctx.c (original)
+++ webservices/axis2/trunk/c/src/core/context/ctx.c Fri Sep 28 02:52:58 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -21,14 +22,17 @@
 
 struct axis2_ctx
 {
+
     /** non persistent map */
     axutil_hash_t *property_map;
+
     /** non persistent map is a deep copy */
     axis2_bool_t property_map_deep_copy;
 };
 
 AXIS2_EXTERN axis2_ctx_t *AXIS2_CALL
-axis2_ctx_create(const axutil_env_t *env)
+axis2_ctx_create(
+    const axutil_env_t * env)
 {
     axis2_ctx_t *ctx = NULL;
 
@@ -55,10 +59,11 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_ctx_set_property(struct axis2_ctx *ctx,
-    const axutil_env_t *env,
-    const axis2_char_t *key,
-    axutil_property_t *value)
+axis2_ctx_set_property(
+    struct axis2_ctx * ctx,
+    const axutil_env_t * env,
+    const axis2_char_t * key,
+    axutil_property_t * value)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
@@ -66,40 +71,40 @@
     {
         /* 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)
-		{
-			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)
-			{
-				axutil_property_free(temp_value, env);
-			}
-		}
+        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)
+            {
+                axutil_property_free(temp_value, env);
+            }
+        }
     }
     if (ctx->property_map)
     {
-        axutil_hash_set(ctx->property_map, key,
-            AXIS2_HASH_KEY_STRING, value);
+        axutil_hash_set(ctx->property_map, key, AXIS2_HASH_KEY_STRING, value);
     }
 
     return AXIS2_SUCCESS;
 }
 
 AXIS2_EXTERN axutil_property_t *AXIS2_CALL
-axis2_ctx_get_property(const axis2_ctx_t *ctx,
-    const axutil_env_t *env,
-    const axis2_char_t *key)
+axis2_ctx_get_property(
+    const axis2_ctx_t * ctx,
+    const axutil_env_t * env,
+    const axis2_char_t * key)
 {
     axutil_property_t *ret = NULL;
 
     if (ctx->property_map)
     {
-        ret = axutil_hash_get(ctx->property_map, key, 
-            AXIS2_HASH_KEY_STRING);
+        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 
@@ -109,23 +114,25 @@
 }
 
 AXIS2_EXTERN axutil_hash_t *AXIS2_CALL
-axis2_ctx_get_all_properties(const axis2_ctx_t *ctx,
-    const axutil_env_t *env)
+axis2_ctx_get_all_properties(
+    const axis2_ctx_t * ctx,
+    const axutil_env_t * env)
 {
     return ctx->property_map;
 }
 
-
 AXIS2_EXTERN axutil_hash_t *AXIS2_CALL
-axis2_ctx_get_property_map(const axis2_ctx_t *ctx,
-    const axutil_env_t *env)
+axis2_ctx_get_property_map(
+    const axis2_ctx_t * ctx,
+    const axutil_env_t * env)
 {
     return ctx->property_map;
 }
 
 AXIS2_EXTERN void AXIS2_CALL
-axis2_ctx_free(struct axis2_ctx *ctx,
-    const axutil_env_t *env)
+axis2_ctx_free(
+    struct axis2_ctx *ctx,
+    const axutil_env_t * env)
 {
     AXIS2_ENV_CHECK(env, void);
 
@@ -135,7 +142,7 @@
         void *val = NULL;
         const void *key = NULL;
         for (hi = axutil_hash_first(ctx->property_map, env);
-            hi; hi = axutil_hash_next(env, hi))
+             hi; hi = axutil_hash_next(env, hi))
         {
             axutil_property_t *property = NULL;
 
@@ -156,9 +163,10 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axis2_ctx_set_property_map(struct axis2_ctx *ctx,
-    const axutil_env_t *env,
-    axutil_hash_t *map)
+axis2_ctx_set_property_map(
+    struct axis2_ctx * ctx,
+    const axutil_env_t * env,
+    axutil_hash_t * map)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
@@ -168,7 +176,7 @@
         void *val = NULL;
         const void *key = NULL;
         for (hi = axutil_hash_first(ctx->property_map, env);
-            hi; hi = axutil_hash_next(env, hi))
+             hi; hi = axutil_hash_next(env, hi))
         {
             axutil_property_t *property = NULL;
 
@@ -180,7 +188,7 @@
                 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);
         }
@@ -191,4 +199,3 @@
 
     return AXIS2_SUCCESS;
 }
-



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


Mime
View raw message