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 ma...@apache.org on 2008/07/04 13:13:54 UTC

svn commit: r674007 [3/4] - in /webservices/axis2/branches/c/post_1_4_mtom/c: ./ axiom/ axiom/src/om/ build/win32/ guththila/ include/ neethi/ samples/ src/core/clientapi/ src/core/context/ src/core/deployment/ src/core/description/ src/core/engine/ sr...

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/deployment/desc_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/deployment/desc_builder.c?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/deployment/desc_builder.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/deployment/desc_builder.c Fri Jul  4 04:13:51 2008
@@ -946,8 +946,7 @@
 
     AXIS2_PARAM_CHECK(env->error, op, AXIS2_FAILURE);
 
-    while (module_refs &&
-           axiom_children_qname_iterator_has_next(module_refs, env))
+    while (module_refs && axiom_children_qname_iterator_has_next(module_refs, env))
     {
         axiom_node_t *moduleref_node = axiom_children_qname_iterator_next(module_refs, env);
         moduleref = (axiom_element_t *)axiom_node_get_data_element(moduleref_node, env);
@@ -963,34 +962,33 @@
 
             ref_name = axiom_attribute_get_value(module_ref_attrib, env);
             ref_qname = axutil_qname_create(env, ref_name, NULL, NULL);
-            module_desc = axis2_dep_engine_get_module(desc_builder->engine, env,
-                                                      ref_qname);
+            module_desc = axis2_dep_engine_get_module(desc_builder->engine, env, ref_qname);
             if (!module_desc)
             {
                 axutil_qname_free(ref_qname, env);
-                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_MODULE_NOT_FOUND,
-                                AXIS2_FAILURE);
-                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                    "Module %s not found in the deployment engine", ref_name);
+                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_MODULE_NOT_FOUND, AXIS2_FAILURE);
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Module %s not found in the deployment engine", 
+                        ref_name);
+
                 return AXIS2_FAILURE;
             }
             else
             {
                 status = axis2_op_add_module_qname(op, env, ref_qname);
                 axutil_qname_free(ref_qname, env);
-                if (!status)
+                if (AXIS2_SUCCESS != status)
                 {
-                    AXIS2_ERROR_SET(env->error, AXIS2_ERROR_MODULE_NOT_FOUND,
-                                    AXIS2_FAILURE);
+                    AXIS2_ERROR_SET(env->error, AXIS2_ERROR_MODULE_NOT_FOUND, AXIS2_FAILURE);
                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                        "Adding module ref %s to operation %s failed", ref_name, 
-                        axutil_qname_get_localpart(axis2_op_get_qname(op, env), 
-                            env));
+                            "Adding module ref %s to operation %s failed", ref_name, 
+                            axutil_qname_get_localpart(axis2_op_get_qname(op, env), env));
+
                     return AXIS2_FAILURE;
                 }
             }
         }
     }
+
     return AXIS2_SUCCESS;
 }
 

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/deployment/phases_info.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/deployment/phases_info.c?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/deployment/phases_info.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/deployment/phases_info.c Fri Jul  4 04:13:51 2008
@@ -217,6 +217,9 @@
     return phases_info->out_faultphases;
 }
 
+/* Here we create the operation inflow as an array list and create phases for phases defined in
+ * inflow of axis2.xml and add them into the array list.
+ */
 AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
 axis2_phases_info_get_op_in_phases(
     const axis2_phases_info_t * phases_info,
@@ -242,17 +245,19 @@
     {
         return op_in_phases;
     }
+
+    /* For each inflow phase name create a phase instance and add into the inflow. */
     size = axutil_array_list_size(phases_info->in_phases, env);
     for (i = 0; i < size; i++)
     {
-        phase_name = (axis2_char_t *)
-            axutil_array_list_get(phases_info->in_phases, env, i);
+        phase_name = (axis2_char_t *) axutil_array_list_get(phases_info->in_phases, env, i);
+
         if (!axutil_strcmp(AXIS2_PHASE_TRANSPORT_IN, phase_name) ||
             !axutil_strcmp(AXIS2_PHASE_PRE_DISPATCH, phase_name) ||
             !axutil_strcmp(AXIS2_PHASE_DISPATCH, phase_name) ||
             !axutil_strcmp(AXIS2_PHASE_POST_DISPATCH, phase_name))
         {
-            /* Do nothing */
+            /* We are not concerned here with system phases. */
         }
         else
         {
@@ -293,6 +298,9 @@
     return op_in_phases;
 }
 
+/* Here we create the operation outflow as an array list and create phases for phases defined in
+ * outflow of axis2.xml and add them into the array list.
+ */
 AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
 axis2_phases_info_get_op_out_phases(
     const axis2_phases_info_t * phases_info,
@@ -311,24 +319,18 @@
     {
         size = axutil_array_list_size(phases_info->out_phases, env);
     }
+
     op_out_phases = axutil_array_list_create(env, 0);
     if (!op_out_phases)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
+
     for (i = 0; i < size; i++)
     {
-        phase_name = (axis2_char_t *) axutil_array_list_get(phases_info->
-                                                            out_phases, env, i);
-        /*phase = axutil_hash_get(phases_info->op_out_phases, phase_name, 
-           AXIS2_HASH_KEY_STRING);
-           if(!phase)
-           {
-           phase = axis2_phase_create(env, phase_name);
-           axutil_hash_set(phases_info->op_out_phases, phase_name,
-           AXIS2_HASH_KEY_STRING, phase);
-           } */
+        phase_name = (axis2_char_t *) axutil_array_list_get(phases_info->out_phases, env, i);
+
         phase = axis2_phase_create(env, phase_name);
         status = axutil_array_list_add(op_out_phases, env, phase);
         if (AXIS2_SUCCESS != status)
@@ -345,11 +347,13 @@
                 axis2_phase_free(phase, env);
                 phase = NULL;
             }
+
             axutil_array_list_free(op_out_phases, env);
             op_out_phases = NULL;
             return NULL;
         }
     }
+
     return op_out_phases;
 }
 
@@ -371,11 +375,13 @@
     {
         return NULL;
     }
+
     size = axutil_array_list_size(phases_info->in_faultphases, env);
     if (0 == size)
     {
         return NULL;
     }
+
     op_in_faultphases = axutil_array_list_create(env, 0);
     if (!op_in_faultphases)
     {
@@ -384,16 +390,8 @@
     }
     for (i = 0; i < size; i++)
     {
-        phase_name = (axis2_char_t *)
-            axutil_array_list_get(phases_info->in_faultphases, env, i);
-        /*phase = axutil_hash_get(phases_info->op_in_faultphases, phase_name, 
-           AXIS2_HASH_KEY_STRING);
-           if(!phase)
-           {
-           phase = axis2_phase_create(env, phase_name);
-           axutil_hash_set(phases_info->op_in_faultphases, 
-           phase_name, AXIS2_HASH_KEY_STRING, phase);
-           } */
+        phase_name = (axis2_char_t *) axutil_array_list_get(phases_info->in_faultphases, env, i);
+
         phase = axis2_phase_create(env, phase_name);
         status = axutil_array_list_add(op_in_faultphases, env, phase);
         if (AXIS2_SUCCESS != status)
@@ -416,6 +414,7 @@
 
         }
     }
+
     return op_in_faultphases;
 }
 
@@ -443,24 +442,17 @@
     {
         return NULL;
     }
+
     op_out_faultphases = axutil_array_list_create(env, 0);
     if (!op_out_faultphases)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
+
     for (i = 0; i < size; i++)
     {
-        phase_name = (axis2_char_t *)
-            axutil_array_list_get(phases_info->out_faultphases, env, i);
-        /*phase = axutil_hash_get(phases_info->op_out_faultphases, phase_name, 
-           AXIS2_HASH_KEY_STRING);
-           if(!phase)
-           {
-           phase = axis2_phase_create(env, phase_name);
-           axutil_hash_set(phases_info->op_out_faultphases, 
-           phase_name, AXIS2_HASH_KEY_STRING, phase);
-           } */
+        phase_name = (axis2_char_t *) axutil_array_list_get(phases_info->out_faultphases, env, i);
         phase = axis2_phase_create(env, phase_name);
         status = axutil_array_list_add(op_out_faultphases, env, phase);
         if (AXIS2_SUCCESS != status)
@@ -483,9 +475,15 @@
 
         }
     }
+
     return op_out_faultphases;
 }
 
+/* 
+ * Get user defined phase instances for each flow defined in axis2.xml in an array list and add it 
+ * into operation. This is called service builder, module builder and service client to add phases
+ * into operations.
+ */
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_phases_info_set_op_phases(
     axis2_phases_info_t * phases_info,
@@ -517,10 +515,8 @@
         return status;
     }
 
-    op_in_faultphases =
-        axis2_phases_info_get_op_in_faultphases(phases_info, env);
-    op_out_faultphases =
-        axis2_phases_info_get_op_out_faultphases(phases_info, env);
+    op_in_faultphases = axis2_phases_info_get_op_in_faultphases(phases_info, env);
+    op_out_faultphases = axis2_phases_info_get_op_out_faultphases(phases_info, env);
 
     status = axis2_op_set_in_flow(op_desc, env, op_in_phases);
     status = axis2_op_set_out_flow(op_desc, env, op_out_phases);
@@ -533,6 +529,7 @@
     {
         status = axis2_op_set_fault_out_flow(op_desc, env, op_out_faultphases);
     }
+
     return status;
 }
 
@@ -543,12 +540,14 @@
 {
     int size = 0,
         i = 0;
+
     axutil_array_list_t *new_flow = NULL;
     if (flow_to_copy)
     {
         size =
             axutil_array_list_size((axutil_array_list_t *) flow_to_copy, env);
     }
+
     if (size > 0)
     {
         new_flow = axutil_array_list_create(env, 0);
@@ -558,13 +557,14 @@
             return NULL;
         }
     }
+
     for (i = 0; i < size; i++)
     {
-        void *item = axutil_array_list_get((axutil_array_list_t *) flow_to_copy,
-                                           env, i);
+        void *item = axutil_array_list_get((axutil_array_list_t *) flow_to_copy, env, i);
         axis2_phase_increment_ref((axis2_phase_t *) item, env);
         axutil_array_list_add(new_flow, env, item);
     }
+
     return new_flow;
 }
 

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/deployment/repos_listener.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/deployment/repos_listener.c?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/deployment/repos_listener.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/deployment/repos_listener.c Fri Jul  4 04:13:51 2008
@@ -87,8 +87,7 @@
     axis2_conf_t *conf;
     axis2_bool_t file_flag;
 
-    repos_listener =
-        (axis2_repos_listener_t *) axis2_repos_listener_create(env);
+    repos_listener = (axis2_repos_listener_t *) axis2_repos_listener_create(env);
 
     if (!repos_listener)
     {
@@ -107,8 +106,7 @@
         }
     }
 
-    repos_listener->info_list =
-        axis2_ws_info_list_create_with_dep_engine(env, dep_engine);
+    repos_listener->info_list = axis2_ws_info_list_create_with_dep_engine(env, dep_engine);
     if (!repos_listener->info_list)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating ws info list failed");
@@ -123,7 +121,8 @@
     if (!conf)
     {
         AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
-                    "Deployment engines axis2 configuration not available");
+                "Deployment engines axis2 configuration not available");
+
         return NULL;
     }
     axis2_repos_listener_set_conf (repos_listener, env, conf);
@@ -131,10 +130,9 @@
     status = axis2_repos_listener_init(repos_listener, env);
     if (AXIS2_SUCCESS != status)
     {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_REPOS_LISTENER_INIT_FAILED,
-                        AXIS2_FAILURE);
-        AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
-            "Repository listener initialization failed");
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_REPOS_LISTENER_INIT_FAILED, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "Repository listener initialization failed");
+
         return NULL;
     }
     return repos_listener;
@@ -182,7 +180,7 @@
 
     conf = axis2_repos_listener_get_conf (repos_listener, env);
 
-    /* conf is needed only to decide we are using axis2.xml. Other
+    /* Configuration  is needed only to decide we are using axis2.xml. Other
      * case we don't need. Hence even if conf is NULL we can continue.
      */
 
@@ -194,8 +192,7 @@
     if (!axis2_flag)
     {
 
-        temp_path =
-            axutil_stracat(env, repos_listener->folder_name, AXIS2_PATH_SEP_STR);
+        temp_path = axutil_stracat(env, repos_listener->folder_name, AXIS2_PATH_SEP_STR);
         module_path = axutil_stracat(env, temp_path, AXIS2_MODULE_PATH);
         AXIS2_FREE(env->allocator, temp_path);
     }
@@ -209,16 +206,16 @@
         }
         else
         {
-            AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
-                "While creating axis2 configuration using axis2.xml, modulesDir"\
-                " parameter not available.");
+            AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "While creating axis2 configuration using "\
+                    "axis2.xml, modulesDir  parameter not available.");
         }
 
     }
-    status =
-        axis2_repos_listener_search(repos_listener, env, module_path,
-                                    AXIS2_MODULE);
+
+    status = axis2_repos_listener_search(repos_listener, env, module_path, AXIS2_MODULE);
+
     AXIS2_FREE(env->allocator, module_path);
+
     return status;
 }
 

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/description/op.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/description/op.c?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/description/op.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/description/op.c Fri Jul  4 04:13:51 2008
@@ -651,6 +651,7 @@
         {
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                 "Module %s already engaged to operation %s", modname, opname);
+
             need_to_add = AXIS2_FALSE;
             return AXIS2_FAILURE;
         }
@@ -662,15 +663,13 @@
         axis2_module_t *module = NULL;
         axis2_status_t status = AXIS2_FAILURE;
 
-        status = axis2_phase_resolver_engage_module_to_op(pr, env,
-                                                          op, moduleref);
+        status = axis2_phase_resolver_engage_module_to_op(pr, env, op, moduleref);
         if (AXIS2_SUCCESS != status)
         {
             /* Ignore the status */
             AXIS2_ERROR_SET_STATUS_CODE(env->error, AXIS2_SUCCESS);
             AXIS2_LOG_INFO(env->log, AXIS2_LOG_SI, 
-                "Engaging module %s to operaion %s failed. But ignore this.", 
-                    modname, opname);
+                "Engaging module %s to operaion %s failed. But ignore this.", modname, opname);
         }
         module = axis2_module_desc_get_module(moduleref, env);
 

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/description/svc.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/description/svc.c?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/description/svc.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/description/svc.c Fri Jul  4 04:13:51 2008
@@ -969,18 +969,21 @@
     const axis2_char_t *svcname = NULL;
 
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Entry:axis2_svc_engage_module");
+
     AXIS2_PARAM_CHECK(env->error, module_desc, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, conf, AXIS2_FAILURE);
+
     svcname = axis2_svc_get_name(svc, env);
     phase_resolver = axis2_phase_resolver_create_with_config(env, conf);
     if (!phase_resolver)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
             "Creating phase resolver failed for service %s", svcname);
+
         return AXIS2_FAILURE;
     }
-    status = axis2_phase_resolver_engage_module_to_svc(phase_resolver, env, svc,
-                                                       module_desc);
+
+    status = axis2_phase_resolver_engage_module_to_svc(phase_resolver, env, svc, module_desc);
     if (status)
     {
         const axutil_qname_t *qname = NULL;
@@ -988,12 +991,14 @@
         qname = axis2_module_desc_get_qname(module_desc, env);
         axis2_svc_add_module_qname(svc, env, qname);
     }
+
     if (phase_resolver)
     {
         axis2_phase_resolver_free(phase_resolver, env);
     }
 
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_svc_engage_module");
+
     return status;
 }
 

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/description/svc_grp.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/description/svc_grp.c?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/description/svc_grp.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/description/svc_grp.c Fri Jul  4 04:13:51 2008
@@ -213,7 +213,6 @@
     const axutil_env_t * env,
     axis2_svc_t * svc)
 {
-    axis2_phase_resolver_t *handler_resolver = NULL;
     axis2_status_t status = AXIS2_FAILURE;
     const axutil_qname_t *svc_qname = NULL;
     axis2_char_t *svc_name = NULL;
@@ -225,49 +224,24 @@
         svc_grp->svcs = axutil_hash_make(env);
         if (!svc_grp->svcs)
         {
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                "Creating services list failed");
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating services list failed");
             return AXIS2_FAILURE;
         }
     }
+
     svc_qname = axis2_svc_get_qname(svc, env);
     svc_name = axutil_qname_to_string((axutil_qname_t *) svc_qname, env);
     axutil_hash_set(svc_grp->svcs, svc_name, AXIS2_HASH_KEY_STRING, svc);
 
-    handler_resolver = axis2_phase_resolver_create_with_config_and_svc(env,
-                                                                       svc_grp->
-                                                                       parent,
-                                                                       svc);
-
-    if (!handler_resolver)
-    {
-        /* remove the previously added service */
-        axutil_hash_set(svc_grp->svcs, svc_name, AXIS2_HASH_KEY_STRING, NULL);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating phase resolver failed for service %s", svc_name);
-        return AXIS2_FAILURE;
-    }
+    status = axis2_svc_set_last_update(svc, env);
 
-    status = axis2_phase_resolver_build_execution_chains_for_svc(handler_resolver, env);
     if (AXIS2_SUCCESS != status)
     {
         /* remove the previously added service */
         axutil_hash_set(svc_grp->svcs, svc_name, AXIS2_HASH_KEY_STRING, NULL);
-        axis2_phase_resolver_free(handler_resolver, env);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Building chains failed within phase resolver for service %s", 
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Setting last update failed for service %s", 
                 svc_name);
-        return status;
-    }
 
-    status = axis2_svc_set_last_update(svc, env);
-    if (AXIS2_SUCCESS != status)
-    {
-        /* remove the previously added service */
-        axutil_hash_set(svc_grp->svcs, svc_name, AXIS2_HASH_KEY_STRING, NULL);
-        axis2_phase_resolver_free(handler_resolver, env);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Setting last update failed for service %s", svc_name);
         return status;
     }
 
@@ -276,13 +250,11 @@
     {
         /* remove the previously added service */
         axutil_hash_set(svc_grp->svcs, svc_name, AXIS2_HASH_KEY_STRING, NULL);
-        axis2_phase_resolver_free(handler_resolver, env);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Setting parent failed for service %s", svc_name);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Setting parent failed for service %s", svc_name);
+
         return status;
     }
 
-    axis2_phase_resolver_free(handler_resolver, env);
     return status;
 }
 

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/engine/conf.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/engine/conf.c?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/engine/conf.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/engine/conf.c Fri Jul  4 04:13:51 2008
@@ -32,18 +32,22 @@
     axis2_transport_out_desc_t *transports_out[AXIS2_TRANSPORT_ENUM_MAX];
 
     /**
-     * Field modules
+     * All the modules already engaged can be found here.
      */
     axutil_array_list_t *engaged_module_list;
+
     /*To store all the available modules (including version) */
     axutil_hash_t *all_modules;
+
     /*To store mapping between default version to module name */
     axutil_hash_t *name_to_version_map;
     axutil_array_list_t *out_phases;
     axutil_array_list_t *in_fault_phases;
     axutil_array_list_t *out_fault_phases;
 
+    /* All the system specific phases are stored here */
     axutil_array_list_t *in_phases_upto_and_including_post_dispatch;
+
     axis2_phases_info_t *phases_info;
     axutil_hash_t *all_svcs;
     axutil_hash_t *all_init_svcs;
@@ -90,20 +94,19 @@
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
         return NULL;
     }
+
 	memset ((void *)conf, 0, sizeof (axis2_conf_t));
 
     conf->enable_mtom = AXIS2_FALSE;
     conf->enable_security = AXIS2_FALSE;
 	conf->axis2_flag = AXIS2_FALSE;
 
-    conf->param_container = (axutil_param_container_t *)
-        axutil_param_container_create(env);
+    conf->param_container = (axutil_param_container_t *) axutil_param_container_create(env);
     if (!conf->param_container)
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating parameter container failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating parameter container failed");
         return NULL;
     }
 
@@ -112,8 +115,7 @@
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating service group map failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating service group map failed");
         return NULL;
     }
 
@@ -132,8 +134,7 @@
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating engaged module list failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating engaged module list failed");
         return NULL;
     }
 
@@ -142,8 +143,7 @@
     {
         axis2_conf_free(conf, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating handler list failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating handler list failed");
         return NULL;
     }
 
@@ -154,7 +154,7 @@
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
 
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating in phases list upto and including post dispatch failed");
+                "Creating in phases list upto and including post dispatch failed");
 
         return NULL;
     }
@@ -168,13 +168,13 @@
         {
             axis2_conf_free(conf, env);
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase %s failed", 
-                AXIS2_PHASE_TRANSPORT_IN);
+                    AXIS2_PHASE_TRANSPORT_IN);
+
             return NULL;
         }
 
-        /* Incase of using security we need to find the service/operation
-         * parameters before the dispatch phase.
-         * This is required to give parameters to the security inflow.*/
+        /* In case of using security we need to find the service/operation parameters before the 
+         * dispatch phase. This is required to give parameters to the security inflow.*/
 
         uri_dispatch = axis2_req_uri_disp_create(env);
         if (uri_dispatch)
@@ -210,6 +210,7 @@
             return NULL;
 
         }
+
         phase = axis2_phase_create(env, AXIS2_PHASE_PRE_DISPATCH);
         if (!phase)
         {
@@ -588,11 +589,11 @@
         conf->all_svcs = axutil_hash_make(env);
         if (!conf->all_svcs)
         {
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                "Creating all services map failed");
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating all services map failed");
             return AXIS2_FAILURE;
         }
     }
+
     k = axutil_hash_count(svcs);
     index_i = axutil_hash_first(svcs, env);
     while (index_i)
@@ -607,24 +608,25 @@
         svc_qname = axis2_svc_get_qname(desc, env);
         svc_name = axutil_qname_get_localpart(svc_qname, env);
 
-        temp_svc = axutil_hash_get(conf->all_svcs, svc_name,
-                                    AXIS2_HASH_KEY_STRING);
+        temp_svc = axutil_hash_get(conf->all_svcs, svc_name, AXIS2_HASH_KEY_STRING);
+
         /* No two service names deployed in the engine can be same */
         if (temp_svc)
         {
-            AXIS2_ERROR_SET(env->error,
-                            AXIS2_ERROR_TWO_SVCS_CANNOT_HAVE_SAME_NAME,
-                            AXIS2_FAILURE);
+            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_TWO_SVCS_CANNOT_HAVE_SAME_NAME, AXIS2_FAILURE);
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                "There is already a service called %s in the all services "\
-                "list of axis2 configuration.", svc_name);
+                "There is already a service called %s in the all services list of axis2 configuration.", 
+                svc_name);
+
             return AXIS2_FAILURE;
         }
+
         index_i = axutil_hash_next(env, index_i);
     }
 
     svcs = axis2_svc_grp_get_all_svcs(svc_grp, env);
     index_i = axutil_hash_first(svcs, env);
+
     while (index_i)
     {
         void *value = NULL;
@@ -632,8 +634,7 @@
 
         axutil_hash_this(index_i, NULL, NULL, &value);
         desc = (axis2_svc_t *) value;
-        svc_name =
-            axutil_qname_get_localpart(axis2_svc_get_qname(desc, env), env);
+        svc_name = axutil_qname_get_localpart(axis2_svc_get_qname(desc, env), env);
         axutil_hash_set(conf->all_svcs, svc_name, AXIS2_HASH_KEY_STRING, desc);
         index_i = axutil_hash_next(env, index_i);
     }
@@ -644,13 +645,12 @@
         conf->svc_grps = axutil_hash_make(env);
         if (!conf->svc_grps)
         {
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                "Creating service group map failed");
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating service group map failed");
             return AXIS2_FAILURE;
         }
     }
-    axutil_hash_set(conf->svc_grps, svc_grp_name,
-                    AXIS2_HASH_KEY_STRING, svc_grp);
+
+    axutil_hash_set(conf->svc_grps, svc_grp_name, AXIS2_HASH_KEY_STRING, svc_grp);
 
     return AXIS2_SUCCESS;
 }
@@ -690,9 +690,11 @@
     const axutil_env_t * env,
     axis2_svc_t * svc)
 {
+    axis2_phase_resolver_t *phase_resolver = NULL;
     axis2_svc_grp_t *svc_grp = NULL;
     const axis2_char_t *svc_grp_name = NULL;
     axis2_status_t status = AXIS2_FAILURE;
+
     AXIS2_PARAM_CHECK(env->error, svc, AXIS2_FAILURE);
 
     /* We need to first create a service group with the same name as the 
@@ -700,41 +702,68 @@
     svc_grp_name = axis2_svc_get_name(svc, env);
     if (!svc_grp_name)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Service has no name set");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Service has no name set");
+
         return AXIS2_FAILURE;
     }
+
     svc_grp = axis2_svc_grp_create(env);
     if (!svc_grp)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Creating service group as parent of service %s failed", 
-            svc_grp_name);
+            "Creating service group as parent of service %s failed", svc_grp_name);
+
             return AXIS2_FAILURE;
     }
+
     status = axis2_svc_grp_set_name(svc_grp, env, svc_grp_name);
-    if (AXIS2_FAILURE == status)
+    if (AXIS2_SUCCESS != status)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
             "Setting name to service group failed");
         return status;
     }
+
     status = axis2_svc_grp_set_parent(svc_grp, env, conf);
-    if (AXIS2_FAILURE == status)
+    if (AXIS2_SUCCESS != status)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
             "Setting parent to service group %s failed", svc_grp_name);
+
+        return status;
+    }
+
+    phase_resolver = axis2_phase_resolver_create_with_config_and_svc(env, conf, svc);
+
+    if (!phase_resolver)
+    {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase resolver failed for service %s", 
+                axis2_svc_get_name(svc, env));
+
+        return AXIS2_FAILURE;
+    }
+
+    status = axis2_phase_resolver_build_execution_chains_for_svc(phase_resolver, env);
+    axis2_phase_resolver_free(phase_resolver, env);
+    if (AXIS2_SUCCESS != status)
+    {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Building chains failed within phase resolver for service %s", axis2_svc_get_name(svc, env));
+
         return status;
     }
+
     status = axis2_svc_grp_add_svc(svc_grp, env, svc);
-    if (AXIS2_FAILURE == status)
+
+    if (AXIS2_SUCCESS != status)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Adding service %s to service group %s failed", svc_grp_name, 
-            svc_grp_name);
+            "Adding service %s to service group %s failed", svc_grp_name, svc_grp_name);
+
         return status;
     }
+
     status = axis2_conf_add_svc_grp(conf, env, svc_grp);
 
     return status;
@@ -1093,24 +1122,22 @@
     axis2_module_desc_t *def_mod = NULL;
     int i = 0;
     int size = 0;
+
     AXIS2_PARAM_CHECK(env->error, module_name, AXIS2_FALSE);
 
-    def_mod = axis2_conf_get_default_module(conf, env,
-                                            axutil_qname_get_localpart
-                                            (module_name, env));
+    def_mod = axis2_conf_get_default_module(conf, env, axutil_qname_get_localpart(module_name, env));
     if (def_mod)
     {
         def_mod_qname = axis2_module_desc_get_qname(def_mod, env);
     }
+
     size = axutil_array_list_size(conf->engaged_module_list, env);
 
     for (i = 0; i < size; i++)
     {
         axutil_qname_t *qname = NULL;
 
-        qname = (axutil_qname_t *) axutil_array_list_get(conf->
-                                                         engaged_module_list, env,
-                                                         i);
+        qname = (axutil_qname_t *) axutil_array_list_get(conf->engaged_module_list, env, i);
 
         if (axutil_qname_equals(module_name, env, qname) ||
             (def_mod_qname &&
@@ -1119,6 +1146,7 @@
             return AXIS2_TRUE;
         }
     }
+
     return AXIS2_FALSE;
 }
 

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/engine/ctx_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/engine/ctx_handler.c?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/engine/ctx_handler.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/engine/ctx_handler.c Fri Jul  4 04:13:51 2008
@@ -57,9 +57,7 @@
     {
         /* create default string */
         handler_string =
-            axutil_string_create_const(env,
-                                       (axis2_char_t **) &
-                                       AXIS2_CTX_HANDLER_NAME);
+            axutil_string_create_const(env, (axis2_char_t **) & AXIS2_CTX_HANDLER_NAME);
         if (!handler_string)
         {
             return NULL;
@@ -123,7 +121,9 @@
 
     op = axis2_msg_ctx_get_op(msg_ctx, env);
     if (op)
+    {
         op_ctx = axis2_op_find_existing_op_ctx(op, env, msg_ctx);
+    }
 
     if (op_ctx)
     {
@@ -143,18 +143,18 @@
             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);
         }
+
         return AXIS2_SUCCESS;
     }
     else if (op)                /*  2. if no op_ctx, create new op_ctx */
     {
         axis2_conf_ctx_t *conf_ctx = NULL;
         axis2_bool_t use_pools = AXIS2_FALSE;
-        axutil_param_t *param = axis2_msg_ctx_get_parameter(msg_ctx, env,
-                                                            AXIS2_PERSIST_OP_CTX);
+        axutil_param_t *param = axis2_msg_ctx_get_parameter(msg_ctx, env, AXIS2_PERSIST_OP_CTX);
+
+        use_pools = (param && 0 == axutil_strcmp(AXIS2_VALUE_TRUE, axutil_param_get_value(param, 
+                        env)));
 
-        use_pools = (param && 0 == axutil_strcmp(AXIS2_VALUE_TRUE,
-                                                 axutil_param_get_value(param,
-                                                                        env)));
         if (use_pools)
         {
             axutil_allocator_switch_to_global_pool(env->allocator);
@@ -162,10 +162,10 @@
         op_ctx = axis2_op_ctx_create(env, op, NULL);
         if (!op_ctx)
         {
-            axis2_char_t *op_name = 
-                axutil_qname_get_localpart(axis2_op_get_qname(op, env), env);
+            axis2_char_t *op_name = axutil_qname_get_localpart(axis2_op_get_qname(op, env), env);
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                "Could not create Operation context for operatoin %s", op_name);
+                    "Could not create Operation context for operatoin %s", op_name);
+
             return AXIS2_FAILURE;
         }
 
@@ -197,11 +197,12 @@
 
     if (!svc_grp_ctx && (axis2_msg_ctx_get_server_side(msg_ctx, env)))
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Service group context not found"); 
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Service group context not found"); 
         return AXIS2_FAILURE;
     }
+
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_ctx_handler_invoke"); 
+
     return AXIS2_SUCCESS;
 }
 

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/phaseresolver/phase_resolver.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/phaseresolver/phase_resolver.c?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/phaseresolver/phase_resolver.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/phaseresolver/phase_resolver.c Fri Jul  4 04:13:51 2008
@@ -49,16 +49,6 @@
     const axutil_env_t * env,
     axis2_module_desc_t * module_desc);
 
-/*
- * Engages the given global module to the given service. This means 
- * the given module would be engaged to all operations of the given 
- * service.
- * @param phase_resolver pointer to phase resolver
- * @param env pointer to environment struct
- * @param svc pointer to service
- * @param module_desc pointer to module description
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
 static axis2_status_t
 axis2_phase_resolver_add_module_handlers_to_user_defined_phases(
     axis2_phase_resolver_t * phase_resolver,
@@ -92,9 +82,8 @@
 {
     axis2_phase_resolver_t *phase_resolver = NULL;
 
-    phase_resolver = (axis2_phase_resolver_t *) AXIS2_MALLOC(env->allocator,
-                                                             sizeof
-                                                             (axis2_phase_resolver_t));
+    phase_resolver = (axis2_phase_resolver_t *) AXIS2_MALLOC(env->allocator, 
+            sizeof(axis2_phase_resolver_t));
 
     if (!phase_resolver)
     {
@@ -167,14 +156,14 @@
 }
 
 /**
- * This is in general called to engage a module to the axis2 engine. In other
- * words modules handlers are added into all global and operation specific
- * phases appropriately. Where these handlers should go is determined by the
- * module handler specific descriptions in module.xml file. Also module 
- * operations are added to service and built exeuction chains.
- * First add all the handlers in the module into the global chains. Then
- * retrieve all services from axis2 configuration and add module handlers 
- * into each services operation phases.
+ * This is in general called to engage a module to the axis2 engine. In other words modules handlers 
+ * are added into all global and operation specific phases appropriately. Where these handlers 
+ * should go is determined by the module handler specific descriptions in module.xml file. Also 
+ * module operations are added to service and built exeuction chains for those operations as well.
+ * First add all the handlers defined for system phases are added into system phases. Then module
+ * operations are added into each service. At the same time execution chains for these module
+ * operations are built as well. Then handlers defined for user phases are added into user defined
+ * pahses.
  */
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -354,16 +343,16 @@
 }
 
 /**
- * This function is called to engage a module to a service specifically. In
- * other words all module handlers are added into service operation's execution
- * chains appropriately. Where each module handler should go is determined by
- * module handler descriptions in module.xml file.
- * First we add the operations defined in the module into the service and built
- * execution chains for them.
- * Then for all the operations of the service we check whether the module 
- * already engaged to operation. If not engage it to service operation.
- * Also if the module is newly engaged to operation add the module qnname to
- * the engaged module list of the operation.
+ * This function is called to engage a module to a service specifically. In other words all module 
+ * handlers defined for user phases are added into user defined phases and all module handlers 
+ * defined for system defined phases are added into system defined phases. Note that user defined
+ * phases are in the flows taken from operation and system defined phases are in the flows taken
+ * from conf. Where each module handler should go is determined by module handler descriptions in 
+ * module.xml file.
+ * First we add the operations defined in the module into the service and built execution chains for 
+ * them. Then for all the operations of the service we check whether the module 
+ * already engaged to operation. If not engage it to service operation. Also if the module is newly 
+ * engaged to operation add the module qnname to the engaged module list of the operation.
  */
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_phase_resolver_engage_module_to_svc(
@@ -379,34 +368,34 @@
     axis2_char_t *modname_d = NULL;
     const axis2_char_t *svcname = NULL;
 
-    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
-        "Entry:axis2_phase_resolver_engage_module_to_svc");
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Entry:axis2_phase_resolver_engage_module_to_svc");
+
     module_d_qname = axis2_module_desc_get_qname(module_desc, env);
     modname_d = axutil_qname_get_localpart(module_d_qname, env); 
     svcname = axis2_svc_get_name(svc, env);
 
-    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
-        "Module %s will be engaged to %s", modname_d, svcname);
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Module %s will be engaged to %s", modname_d, svcname);
+
     ops = axis2_svc_get_all_ops(svc, env);
     if (!ops)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Service %s has no operation", svcname);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Service %s has no operation", svcname);
+
         return AXIS2_FAILURE;
     }
+
     /* Module operations are added to service and built execution chains */
-    status = axis2_svc_add_module_ops(svc, env, module_desc,
-                                      phase_resolver->axis2_config);
+    status = axis2_svc_add_module_ops(svc, env, module_desc, phase_resolver->axis2_config);
 
     if (AXIS2_SUCCESS != status)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "Adding module operations from module %s into service %s failed",
-                modname_d, svcname);
+            "Adding module operations from module %s into service %s failed", modname_d, svcname);
+
         return status;
     }
-    for (index_i = axutil_hash_first(ops, env); index_i; index_i =
-         axutil_hash_next(env, index_i))
+
+    for (index_i = axutil_hash_first(ops, env); index_i; index_i = axutil_hash_next(env, index_i))
     {
         axutil_array_list_t *modules = NULL;
         axis2_op_t *op_desc = NULL;
@@ -418,13 +407,15 @@
 
         axutil_hash_this(index_i, NULL, NULL, &v);
         op_desc = (axis2_op_t *) v;
-        opname = axutil_qname_get_localpart(axis2_op_get_qname(op_desc, env), 
-            env),
+
+        opname = axutil_qname_get_localpart(axis2_op_get_qname(op_desc, env), env);
+
         modules = axis2_op_get_all_modules(op_desc, env);
         if (modules)
         {
             size = axutil_array_list_size(modules, env);
         }
+
         for (j = 0; j < size; j++)
         {
             axis2_module_desc_t *module_desc_l = NULL;
@@ -432,45 +423,45 @@
 
             module_desc_l = axutil_array_list_get(modules, env, j);
             module_d_qname_l = axis2_module_desc_get_qname(module_desc_l, env);
-            if (axutil_qname_equals(module_d_qname, env,
-                                                  module_d_qname_l))
+            if (axutil_qname_equals(module_d_qname, env, module_d_qname_l))
             {
                 engaged = AXIS2_TRUE;
                 status = AXIS2_SUCCESS;
                 AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
-                    "Module %s already engaged to operation %s of service %s", 
-                    modname_d, opname, svcname);
+                    "Module %s already engaged to operation %s of service %s", modname_d, opname, 
+                    svcname);
+
                 break;
             }
         }
 
         if (!engaged)
         {
-            status =
-                axis2_phase_resolver_engage_module_to_op(phase_resolver, env,
-                                                         op_desc, module_desc);
+            status = axis2_phase_resolver_engage_module_to_op(phase_resolver, env, op_desc, 
+                    module_desc);
+
             if (AXIS2_SUCCESS != status)
             {
                 AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                    "Engaging module %s to operation %s failed.", modname_d, 
-                    opname);
+                    "Engaging module %s to operation %s failed.", modname_d, opname);
+
                 return status;
             }
 
-            status = axis2_op_add_to_engaged_module_list(op_desc, env,
-                                                         module_desc);
+            status = axis2_op_add_to_engaged_module_list(op_desc, env, module_desc);
         }
 
     }
 
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_phase_resolver_engage_module_to_svc");
+
     return status;
 }
 
 /**
- * In this function all the handlers in each flow of the module description 
- * are added to the phases of the operation. First handlers of global phases
- * are added. Then handlers of operation specific phases are added.
+ * In this function all the handlers in each flow of the module description are added to the phases 
+ * of the operation(user define phases) and phases of the conf(system defined phases). First handlers 
+ * for system defined phases are added. Then handlers for operation specific phases are added.
  */
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_phase_resolver_engage_module_to_op(
@@ -571,12 +562,13 @@
                 handlername = axutil_string_get_buffer(handlersname, env);
                 phase_rule = axis2_handler_desc_get_rules(metadata, env);
                 phase_name = axis2_phase_rule_get_name(phase_rule, env);
+                
+                /* For user/operation specific phases */
                 if ((axutil_strcmp(AXIS2_PHASE_TRANSPORT_IN, phase_name))
                     && (axutil_strcmp(AXIS2_PHASE_DISPATCH, phase_name)) &&
                     (axutil_strcmp(AXIS2_PHASE_POST_DISPATCH, phase_name))
                     && (axutil_strcmp(AXIS2_PHASE_PRE_DISPATCH, phase_name)))
                 {
-                    /* For operation specific phases */
                     status = axis2_phase_holder_add_handler(phase_holder, env, metadata);
                     if (AXIS2_SUCCESS != status)
                     {
@@ -591,12 +583,13 @@
                     }
 
                 }
+
+                /* For System defined phases */
                 if ((!axutil_strcmp(AXIS2_PHASE_TRANSPORT_IN, phase_name))
                     || (!axutil_strcmp(AXIS2_PHASE_DISPATCH, phase_name)) ||
                     (!axutil_strcmp(AXIS2_PHASE_POST_DISPATCH, phase_name))
                     || (!axutil_strcmp(AXIS2_PHASE_PRE_DISPATCH, phase_name)))
                 {
-                    /* For global phases */
                     axutil_array_list_t *phase_list = NULL;
                     axis2_phase_holder_t *phase_holder = NULL;
 
@@ -618,8 +611,9 @@
                     if (AXIS2_SUCCESS != status)
                     {
                         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                            "Adding handler %s to phase %s within flow %s failed", 
-                            handlername, phase_name, flowname);
+                            "Adding handler %s to phase %s within flow %s failed", handlername, 
+                            phase_name, flowname);
+
                         return status;
                     }
                 }
@@ -632,8 +626,9 @@
             phase_holder = NULL;
         }
     }
-    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
-        "Exit:axis2_phase_resolver_engage_module_to_op");
+
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_phase_resolver_engage_module_to_op");
+
     return AXIS2_SUCCESS;
 }
 
@@ -661,30 +656,29 @@
 
     ops = axis2_svc_get_all_ops(phase_resolver->svc, env);
 
-    for (index_i = axutil_hash_first(ops, env); index_i; index_i =
-         axutil_hash_next(env, index_i))
+    for (index_i = axutil_hash_first(ops, env); index_i; index_i = axutil_hash_next(env, index_i))
     {
         void *v = NULL;
         int j = 0;
+
         axutil_hash_this(index_i, NULL, NULL, &v);
         op = (axis2_op_t *) v;
         for (j = 1; j < 5; j++)
         {
-            status = axis2_phase_resolver_build_execution_chains_for_op(phase_resolver,
-                                                                 env, j, op);
+            status = axis2_phase_resolver_build_execution_chains_for_op(phase_resolver, env, j, op);
         }
     }
+
     return status;
 }
 
 /**
  * For operation passed as parameter, build execution chains. To do this get all engaged modules
- * from the axis2 configuration and for each module get the all handlers to be 
- * add to the operation specific phases. Then for each operation specific phases 
- * add those handlers. It should be noted that by the time this function is called
- * the module handlers are already added to global chains. 
- * This function is called from axis2_phase_resolver_build_execution_chains_for_svc() function and 
- * axis2_phase_resolver_build_execution_chains_for_module_op() function.
+ * from the axis2 configuration and for each module get the all handlers to be add to the operation 
+ * specific phases. Then for each operation specific phases add those handlers. It should be noted 
+ * that by the time this function is called the module handlers are already added to system specific 
+ * phases. This function is called from axis2_phase_resolver_build_execution_chains_for_svc() 
+ * function and axis2_phase_resolver_build_execution_chains_for_module_op() function.
  */
 static axis2_status_t
 axis2_phase_resolver_build_execution_chains_for_op(
@@ -913,11 +907,10 @@
 }
 
 /**
- * Take the phases for each flow from the axis2 configuration, take all the
- * handlers of each flow from the module description and then each handler
- * is added into the corresponding global phase. This function is called
- * from  function axis2_phase_resolver_engage_module_globally() to add module
- * handlers into global phases.
+ * Take the phases for each flow from the axis2 configuration, take all the handlers of each flow 
+ * from the module description and then each handler is added into the corresponding global phase. 
+ * This function is called from  function axis2_phase_resolver_engage_module_globally() to add 
+ * module handlers into global phases.
  */
 static axis2_status_t
 axis2_phase_resolver_add_module_handlers_to_system_defined_phases(
@@ -930,6 +923,7 @@
     axis2_phase_holder_t *phase_holder = NULL;
     const axutil_qname_t *modqname = NULL;
     axis2_char_t *modname = NULL;
+
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
         "Entry:axis2_phase_resolver_add_module_handlers_to_system_defined_phases");
 
@@ -1077,11 +1071,10 @@
 }
 
 /**
- * For each operation of the service first check whether module is already 
- * engaged to operation. If not take each operations flows and add the module
- * handlers into them appropriately. This function is called from function
- * axis2_phase_resolver_engage_module_globally() to add handlers from module
- * into each services all operations.
+ * For each operation of the service first check whether module is already engaged to operation. 
+ * If not take each operations flows and add the module handlers into them appropriately. This 
+ * function is called from function axis2_phase_resolver_engage_module_globally() to add handlers 
+ * from module into each services all operations.
  */
 static axis2_status_t
 axis2_phase_resolver_add_module_handlers_to_user_defined_phases(

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/receivers/raw_xml_in_out_msg_recv.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/receivers/raw_xml_in_out_msg_recv.c?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/receivers/raw_xml_in_out_msg_recv.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/receivers/raw_xml_in_out_msg_recv.c Fri Jul  4 04:13:51 2008
@@ -39,7 +39,6 @@
     axis2_msg_recv_t *msg_recv = NULL;
     axis2_status_t status = AXIS2_FAILURE;
 
-    AXIS2_ENV_CHECK(env, NULL);
     msg_recv = axis2_msg_recv_create(env);
     if (!msg_recv)
     {
@@ -47,15 +46,15 @@
         return NULL;
     }
     status = axis2_msg_recv_set_scope(msg_recv, env, AXIS2_APPLICATION_SCOPE);
-    if (AXIS2_TRUE != status)
+    if (!status)
     {
         axis2_msg_recv_free(msg_recv, env);
         return NULL;
     }
 
-    axis2_msg_recv_set_invoke_business_logic(
-        msg_recv, env,
+    axis2_msg_recv_set_invoke_business_logic(msg_recv, env,
         axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync);
+
     return msg_recv;
 }
 
@@ -88,10 +87,11 @@
     axiom_namespace_t *env_ns = NULL;
     axiom_node_t *fault_node = NULL;
     axiom_soap_fault_detail_t *fault_detail;
+	axis2_bool_t is_fault = AXIS2_FALSE;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, new_msg_ctx, AXIS2_FAILURE);
+
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
         "[axis2]Entry:axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync");
 
@@ -112,11 +112,10 @@
             svc_name = "unknown";
         }
 
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
-                        "Impl object for service '%s' not set in message receiver. %d :: %s",
-                        svc_name,
-                        env->error->error_number,
-                        AXIS2_ERROR_GET_MESSAGE(env->error));
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+            "Impl object for service '%s' not set in message receiver. %d :: %s", svc_name, 
+            env->error->error_number, AXIS2_ERROR_GET_MESSAGE(env->error));
+
         status = AXIS2_FAILURE;
     }
     else
@@ -167,57 +166,47 @@
                     {
                         axis2_char_t *function_name = NULL;
 
-                        function_name =
-                            (axis2_char_t *) axutil_array_list_get(function_arr,
-                                                                   env, i);
-                        if (0 == axutil_strcmp(function_name, local_name))
+                        function_name = (axis2_char_t *) axutil_array_list_get(function_arr, env, i);
+                        if (!axutil_strcmp(function_name, local_name))
                         {
                             matches = AXIS2_TRUE;
 
                         }
                     }
 
-                    if (AXIS2_TRUE == matches)
+                    if (matches)
                     {
                         om_node = axiom_node_get_first_child(op_node, env);
                         om_element = axiom_node_get_data_element(om_node, env);
                     }
                     else
                     {
-                        AXIS2_ERROR_SET(env->error,
-                                        AXIS2_ERROR_OM_ELEMENT_MISMATCH,
-                                        AXIS2_FAILURE);
+                        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_OM_ELEMENT_MISMATCH, AXIS2_FAILURE);
                         status = AXIS2_FAILURE;
                     }
                 }
                 else
                 {
-                    AXIS2_ERROR_SET(env->error,
-                                    AXIS2_ERROR_OM_ELEMENT_INVALID_STATE,
-                                    AXIS2_FAILURE);
+                    AXIS2_ERROR_SET(env->error, AXIS2_ERROR_OM_ELEMENT_INVALID_STATE, AXIS2_FAILURE);
                     status = AXIS2_FAILURE;
                 }
             }
             else
             {
-                AXIS2_ERROR_SET(env->error,
-                                AXIS2_ERROR_RPC_NEED_MATCHING_CHILD,
-                                AXIS2_FAILURE);
+                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_RPC_NEED_MATCHING_CHILD, AXIS2_FAILURE);
                 status = AXIS2_FAILURE;
             }
         }
         else
         {
-            AXIS2_ERROR_SET(env->error,
-                            AXIS2_ERROR_UNKNOWN_STYLE, AXIS2_FAILURE);
+            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_UNKNOWN_STYLE, AXIS2_FAILURE);
             status = AXIS2_FAILURE;
         }
 
         if (status == AXIS2_SUCCESS)
         {
             skel_invoked = AXIS2_TRUE;
-            result_node =
-                AXIS2_SVC_SKELETON_INVOKE(svc_obj, env, om_node, new_msg_ctx);
+            result_node = AXIS2_SVC_SKELETON_INVOKE(svc_obj, env, om_node, new_msg_ctx);
         }
 
         if (result_node)
@@ -236,8 +225,7 @@
                 else
                 {
                     body_content_element =
-                        axiom_element_create(env, NULL, res_name, ns,
-                                             &body_content_node);
+                        axiom_element_create(env, NULL, res_name, ns, &body_content_node);
                     axiom_node_add_child(body_content_node, env, result_node);
                 }
             }
@@ -248,21 +236,58 @@
         }
         else
         {
-            status = AXIS2_ERROR_GET_STATUS_CODE(env->error);
-            if (status == AXIS2_SUCCESS)
-            {
-                axis2_msg_ctx_set_no_content(new_msg_ctx, env, AXIS2_TRUE);
-            }
-            else
-            {
-                axis2_msg_ctx_set_status_code(msg_ctx, env,
-                    axis2_msg_ctx_get_status_code(new_msg_ctx, env));
-            }
-            /* The new_msg_ctx is passed to the service. The status code must
-             * be taken from here and set to the old message context which is
-             * used by the worker when the request processing fails.
-             */
-            fault_node = AXIS2_SVC_SKELETON_ON_FAULT(svc_obj, env, om_node);
+			axis2_char_t *mep = (axis2_char_t *)axis2_op_get_msg_exchange_pattern(op_desc, env);
+			if (axutil_strcmp(mep, AXIS2_MEP_URI_IN_ONLY) && 
+				axutil_strcmp(mep, AXIS2_MEP_URI_ROBUST_IN_ONLY))
+			{
+				status = AXIS2_ERROR_GET_STATUS_CODE(env->error);
+				if (status == AXIS2_SUCCESS)
+				{
+					axis2_msg_ctx_set_no_content(new_msg_ctx, env, AXIS2_TRUE);
+				}
+				else
+				{
+					axis2_msg_ctx_set_status_code(msg_ctx, env,	
+						axis2_msg_ctx_get_status_code(new_msg_ctx, env));
+				}
+				/* The new_msg_ctx is passed to the service. The status code must
+				 * be taken from here and set to the old message context which is
+				 * used by the worker when the request processing fails.
+				 */
+				if (svc_obj->ops->on_fault)
+				{
+					fault_node = AXIS2_SVC_SKELETON_ON_FAULT(svc_obj, env, om_node);
+				}
+				is_fault = AXIS2_TRUE;
+			}
+			else
+			{	
+				/* If we have a in only message result node is NULL. We create fault only if 
+				 * an error is set 
+				 */
+				status = AXIS2_ERROR_GET_STATUS_CODE(env->error);
+				if (status == AXIS2_SUCCESS)
+				{
+					axis2_msg_ctx_set_no_content(new_msg_ctx, env, AXIS2_TRUE);
+				}
+				else
+				{
+					axis2_msg_ctx_set_status_code(msg_ctx, env,
+						axis2_msg_ctx_get_status_code(new_msg_ctx, env));
+					if (!axutil_strcmp(mep, AXIS2_MEP_URI_ROBUST_IN_ONLY))
+					{
+						/* The new_msg_ctx is passed to the service. The status code must
+						 * be taken from here and set to the old message context which is
+						 * used by the worker when the request processing fails.
+						 */
+						if (svc_obj->ops->on_fault)
+						{
+							fault_node = AXIS2_SVC_SKELETON_ON_FAULT(svc_obj, env, om_node);
+						}
+						is_fault = AXIS2_TRUE;
+					}
+				}
+			}
         }
     }
 
@@ -312,7 +337,7 @@
         return AXIS2_FAILURE;
     }
 
-    if (status != AXIS2_SUCCESS)
+    if (status != AXIS2_SUCCESS || is_fault)
     {
         /* something went wrong. set a SOAP Fault */
         const axis2_char_t *fault_value_str = "soapenv:Sender";
@@ -342,28 +367,29 @@
         }
         else
         {
-            fault_reason_str = "Something went wrong";
+            fault_reason_str = "An error has occured, but could not determine exact details";
         }
 
-        soap_fault = axiom_soap_fault_create_default_fault(env, out_body,
-                                                           fault_value_str,
-                                                           fault_reason_str,
-                                                           soap_version);
+        soap_fault = axiom_soap_fault_create_default_fault(env, out_body, fault_value_str, 
+            fault_reason_str, soap_version);
+
         if (fault_node)
         {
-            fault_detail =
-                axiom_soap_fault_detail_create_with_parent(env, soap_fault);
-            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "fault_detail:%s", fault_detail);
-            axiom_soap_fault_detail_add_detail_entry(fault_detail, env,
-                                                     fault_node);
+            axiom_node_t *fault_detail_node = NULL;
+
+            fault_detail = axiom_soap_fault_detail_create_with_parent(env, soap_fault);
+            fault_detail_node = axiom_soap_fault_detail_get_base_node(fault_detail, env);
+            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "fault_detail:%s", axiom_node_to_string(
+                fault_detail_node, env));
+
+            axiom_soap_fault_detail_add_detail_entry(fault_detail, env, fault_node);
         }
     }
 
     if (body_content_node)
     {
         axiom_node_add_child(out_node, env, body_content_node);
-        status =
-            axis2_msg_ctx_set_soap_envelope(new_msg_ctx, env, default_envelope);
+        status = axis2_msg_ctx_set_soap_envelope(new_msg_ctx, env, default_envelope);
     }
     else if (soap_fault)
     {
@@ -376,8 +402,10 @@
         axiom_soap_envelope_free(default_envelope, env);
         default_envelope = NULL;
     }
+
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
         "[axis2]Exit:axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync");
+
     return status;
 }
 

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/Makefile.am?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/Makefile.am (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/Makefile.am Fri Jul  4 04:13:51 2008
@@ -1,2 +1,3 @@
 SUBDIRS=http $(TCP_DIR) $(AMQP_DIR)
-EXTRA_DIST=Makefile.am
+DIST_SUBDIRS=tcp amqp
+EXTRA_DIST=Makefile.am 

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/sender/http_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/sender/http_client.c?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/sender/http_client.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/sender/http_client.c Fri Jul  4 04:13:51 2008
@@ -169,9 +169,8 @@
 
     if (!client->req_body && !(client->doing_mtom))
     {
-        client->req_body_size =
-            axis2_http_simple_request_get_body_bytes(request, env,
-                                                     &client->req_body);
+        client->req_body_size = axis2_http_simple_request_get_body_bytes(request, env, 
+                &client->req_body);
     }
 
     if (client->dump_input_msg == AXIS2_TRUE)
@@ -190,23 +189,22 @@
     port = axutil_url_get_port(client->url, env);
 
 
-    if (AXIS2_TRUE == client->proxy_enabled)
+    if (client->proxy_enabled)
     {
         if (!client->proxy_host || client->proxy_port <= 0)
         {
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Proxy port or Host not set");
             return AXIS2_FAILURE;
         }
-        client->sockfd = (int)axutil_network_handler_open_socket(env,
-                                                            client->proxy_host,
-                                                            client->proxy_port);
+
+        client->sockfd = (int)axutil_network_handler_open_socket(env, client->proxy_host, 
+            client->proxy_port);
     }
     else
     {
         /*Proxy is not enabled*/
 
-        client->sockfd = 
-            (int)axutil_network_handler_open_socket(env, host, port);
+        client->sockfd = (int)axutil_network_handler_open_socket(env, host, port);
     }
 
     if (client->sockfd < 0)
@@ -219,39 +217,31 @@
     if (client->timeout > 0)
     {
         /*Set the receiving time out*/
-        axutil_network_handler_set_sock_option(env, client->sockfd,
-                                               SO_RCVTIMEO, client->timeout);
+        axutil_network_handler_set_sock_option(env, client->sockfd, SO_RCVTIMEO, client->timeout);
         /*Set the sending time out*/
 
-        axutil_network_handler_set_sock_option(env, client->sockfd,
-                                               SO_SNDTIMEO, client->timeout);
+        axutil_network_handler_set_sock_option(env, client->sockfd, SO_SNDTIMEO, client->timeout);
     }
 
-    if (0 == axutil_strcasecmp(axutil_url_get_protocol(client->url, env),
-                               AXIS2_TRANSPORT_URL_HTTPS))
+    if (0 == axutil_strcasecmp(axutil_url_get_protocol(client->url, env), AXIS2_TRANSPORT_URL_HTTPS))
     {
 #ifdef AXIS2_SSL_ENABLED
-        if (AXIS2_TRUE == client->proxy_enabled)
+        if (client->proxy_enabled)
         {
-            if (AXIS2_SUCCESS !=
-                axis2_http_client_connect_ssl_host(client, env, host, port));
+            if (AXIS2_SUCCESS != axis2_http_client_connect_ssl_host(client, env, host, port));
             {
                 AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "HTTPS connection creation failed");
                 return AXIS2_FAILURE;
             }
         }
         client->data_stream =
-            axutil_stream_create_ssl(env,
-                                     client->sockfd,
-                                     axis2_http_client_get_server_cert
-                                     (client, env),
-                                     axis2_http_client_get_key_file
-                                     (client, env), ssl_pp);
+            axutil_stream_create_ssl(env, client->sockfd, axis2_http_client_get_server_cert(client, 
+                        env), axis2_http_client_get_key_file(client, env), ssl_pp);
 #else
-        AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_TRANSPORT_PROTOCOL,
-                        AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Invalid Transport Protocol,\
-            HTTPS transport not enabled.");
+        AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_TRANSPORT_PROTOCOL, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Invalid Transport Protocol, HTTPS transport not enabled.");
+
         return AXIS2_FAILURE;
 #endif
     }
@@ -263,8 +253,9 @@
     if (!client->data_stream)
     {
         axutil_network_handler_close_socket(env, client->sockfd);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Data stream creation failed \
-        for Host %s and %d port", host, port);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+                "Data stream creation failed for Host %s and %d port", host, port);
+
         return AXIS2_FAILURE;
     }
 
@@ -279,8 +270,9 @@
         for (i = 0; i < header_count; i++)
         {
             axis2_char_t *header_ext_form = NULL;
-            axis2_http_header_t *tmp_header = (axis2_http_header_t *)
-                axutil_array_list_get(headers, env, i);
+            axis2_http_header_t *tmp_header = (axis2_http_header_t *) axutil_array_list_get(headers, 
+                    env, i);
+
             if (!tmp_header)
             {
                 /* This continue is added as a safey mechanism,
@@ -296,16 +288,15 @@
 
             /* check whether we have transfer encoding and then see whether the
              * value is "chunked" */
-            if (0 == axutil_strcmp(axis2_http_header_get_name(tmp_header, env),
-                                   AXIS2_HTTP_HEADER_TRANSFER_ENCODING) && 0 ==
-                axutil_strcmp(axis2_http_header_get_value(tmp_header,
-                                                          env),
-                              AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED))
+            if (!axutil_strcmp(axis2_http_header_get_name(tmp_header, env), 
+                    AXIS2_HTTP_HEADER_TRANSFER_ENCODING) && 
+                    !axutil_strcmp(axis2_http_header_get_value(tmp_header, env), 
+                        AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED))
             {
                 chunking_enabled = AXIS2_TRUE;
             }
-            header_ext_form =
-                axis2_http_header_to_external_form(tmp_header, env);
+
+            header_ext_form = axis2_http_header_to_external_form(tmp_header, env);
 
             /* str_header2 is to hold intermediate value of str_header */
             str_header2 = axutil_stracat(env, str_header, header_ext_form);
@@ -321,8 +312,7 @@
 
     if (AXIS2_FALSE == client->proxy_enabled)
     {
-        str_request_line =
-            axis2_http_request_line_to_string
+        str_request_line = axis2_http_request_line_to_string
             (axis2_http_simple_request_get_request_line(request, env), env);
     }
     else
@@ -338,48 +328,45 @@
             axis2_http_simple_request_get_request_line(request, env);
         axis2_char_t *path = axis2_http_request_line_get_uri(request_line, env);
 
-        host_port_str = AXIS2_MALLOC(env->allocator, axutil_strlen(host) +
-                                     +axutil_strlen(path) +
-                                     20 * sizeof(axis2_char_t));
+        host_port_str = AXIS2_MALLOC(env->allocator, axutil_strlen(host) + axutil_strlen(path) +
+            20 * sizeof(axis2_char_t));
+
         if (!host_port_str)
         {
             AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-            AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "memory allocation failed\
- for host %s and %s path", host, path);
+            AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+                    "Memory allocation failed for host %s and %s path", host, path);
+
             return AXIS2_FAILURE;
         }
 
-        sprintf(host_port_str, "http://%s:%d%s", host,
-                axutil_url_get_port(client->url, env), path);
-        str_request_line =
-            AXIS2_MALLOC(env->allocator,
-                         axutil_strlen(host_port_str) +
+        sprintf(host_port_str, "http://%s:%d%s", host, axutil_url_get_port(client->url, env), path);
+        str_request_line = AXIS2_MALLOC(env->allocator, axutil_strlen(host_port_str) +
                          20 * sizeof(axis2_char_t));
 
         if (!str_request_line)
         {
             AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-            AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "memory allocation failed\
- for host %s and %s path", host, path);
+            AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+                    "memory allocation failed for host %s and %s path", host, path);
+
             return AXIS2_FAILURE;
         }
 
-        sprintf(str_request_line, "%s %s %s\r\n",
-                axis2_http_request_line_get_method(request_line, env),
-                host_port_str,
-                axis2_http_request_line_get_http_version(request_line, env));
+        sprintf(str_request_line, "%s %s %s\r\n", axis2_http_request_line_get_method(request_line, 
+            env), host_port_str, axis2_http_request_line_get_http_version(request_line, env));
 
         AXIS2_FREE(env->allocator, host_port_str);
         host_port_str = NULL;
 
     }
+
     wire_format = axutil_stracat(env, str_request_line, str_header);
     AXIS2_FREE(env->allocator, str_header);
     str_header = NULL;
     AXIS2_FREE(env->allocator, str_request_line);
     str_request_line = NULL;
-    written = axutil_stream_write(client->data_stream, env, wire_format,
-                                  axutil_strlen(wire_format));
+    written = axutil_stream_write(client->data_stream, env, wire_format, axutil_strlen(wire_format));
     AXIS2_FREE(env->allocator, wire_format);
     wire_format = NULL;
     written = axutil_stream_write(client->data_stream, env, AXIS2_HTTP_CRLF, 2);
@@ -399,7 +386,7 @@
         int len = 0;
         written = 0;
 
-        if (AXIS2_FALSE == chunking_enabled)
+        if (!chunking_enabled)
         {
             status = AXIS2_SUCCESS;
             while (written < client->req_body_size)
@@ -424,9 +411,7 @@
 
             /* Sending HTTP request via chunking */
             axutil_http_chunked_stream_t *chunked_stream = NULL;
-            chunked_stream = axutil_http_chunked_stream_create(env,
-                                                              client->
-                                                              data_stream);
+            chunked_stream = axutil_http_chunked_stream_create(env, client->data_stream);
             status = AXIS2_SUCCESS;
             if (!chunked_stream)
             {
@@ -436,20 +421,21 @@
 
             while (written < client->req_body_size)
             {
-                written = axutil_http_chunked_stream_write(chunked_stream, env,
-                                                          client->req_body,
-                                                          client->
-                                                          req_body_size);
+                written = axutil_http_chunked_stream_write(chunked_stream, env, client->req_body, 
+                        client->req_body_size);
+
                 if (-1 == written)
                 {
                     status = AXIS2_FAILURE;
                     break;
                 }
             }
+
             if (AXIS2_SUCCESS == status)
             {
                 axutil_http_chunked_stream_write_last_chunk(chunked_stream, env);
             }
+
             axutil_http_chunked_stream_free(chunked_stream, env);
         }
     }

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/sender/http_sender.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/sender/http_sender.c?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/sender/http_sender.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/sender/http_sender.c Fri Jul  4 04:13:51 2008
@@ -1382,17 +1382,13 @@
         op = axis2_msg_ctx_get_op (msg_ctx, env);
         if (op)
         {
-            const axis2_char_t *mep =
-                axis2_op_get_msg_exchange_pattern (op, env);
-            AXIS2_HANDLE_ERROR(env,
-                               AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR,
-                               AXIS2_FAILURE);
+            const axis2_char_t *mep = axis2_op_get_msg_exchange_pattern (op, env);
+            AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR, AXIS2_FAILURE);
             /* handle one way case */
 
-            if (axutil_strcmp (mep, AXIS2_MEP_URI_OUT_ONLY) == 0)
+            if (!axutil_strcmp (mep, AXIS2_MEP_URI_OUT_ONLY))
             {
-                AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI,
-                                 "mep is AXIS2_MEP_URI_OUT_ONLY");
+                AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "mep is AXIS2_MEP_URI_OUT_ONLY");
                 return AXIS2_FAILURE;
             }
         }

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/README
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/README?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/README (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/README Fri Jul  4 04:13:51 2008
@@ -16,6 +16,26 @@
 
 Add a string value with the name log_level. The value can be one of trace, error, info, critical, debug, warning
 
+You can add a string value with the name services_url_prefix. This is optional and defaults to "/services".
+As an example, if you have "/web_services" as the prefix, then all the services hosted would have the endpoint prefix of : 
+http://localhost/axis2/web_services.
+Note: don't forget the / at the begining.
+
+If you wish, you can also change the location as well by adding a string value with the name axis2_location. 
+This is also optional and defaults to /axis2. If you have /myserser as the value you can access your web 
+services with a url like http://localhost/myserver/services.
+Note: Don't forget the / at the beginning.
+
+Now you can do all the registry editing using the JScript file axis2_iis_regedit.js 
+provided with the distribution. When you build axis2/C with the IIS module the file 
+is copied to the root directory of the binary distribution. Just double click it and 
+everything will be set to the defaults. The axis2c_home is taken as the current directory, 
+so make sure you run the file in the Axis2/C repository location (or root of the binary distribution). 
+If you want to change the values you can manually edit the the .js file or give it as command line arguments 
+to the script when running the script. To run the jscript from the command line use the command 
+:\cscript axis2_iis_regedit.js optional arguments. 
+We recomend the manual editing as it is the easiest way to specify the values
+
 IIS 5.1 or Below
 
 Using the IIS management console, add a new virtual directory to your IIS/PWS Web site.

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/axis2_iis_worker.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/axis2_iis_worker.c?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/axis2_iis_worker.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/axis2_iis_worker.c Fri Jul  4 04:13:51 2008
@@ -198,11 +198,11 @@
 	{
 		axis2_worker_get_original_url(redirect_url, original_url);
 		/* create the url using the above variables */                     
-		sprintf(req_url, "%s%s%s%s", "http://", server_name, port, original_url);
+		sprintf(req_url, "%s%s%s%s%s", "http://", server_name, ":", port, original_url);
 	}
 	else
 	{
-		sprintf(req_url, "%s%s%s%s", "http://", server_name, port, redirect_url);
+		sprintf(req_url, "%s%s%s%s%s", "http://", server_name, ":", port, redirect_url);
 	}
 	/* Set the request url */
 	request.request_uri = req_url;
@@ -273,7 +273,7 @@
 		AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "IIS: Unsupported HTTP Method.");
 		return AXIS2_FAILURE;
 	}
-	/* Set the URL prefix */
+	/* Set the URL prefix. axis2_request_url_prefix is a global variable set at the init time */
 	request.request_url_prefix = axis2_request_url_prefix;
 	/* Create the transport out info */
 	request.out_transport_info = axis2_iis_out_transport_info_create(env, lpECB);
@@ -493,12 +493,9 @@
 axis2_status_t AXIS2_CALL axis2_worker_get_original_url(char url[],
                                                         char ret_url[]) 
 {
-    int i = 0;
-    for (i = 0; i < 7; i++)
-        ret_url[i] = url[i];
-    for (i = 7; url[i] != '\0'; i++)
-        ret_url[i] = url[i + 18];
-    ret_url[i] = '\0';
+	extern axis2_char_t *axis2_location;
+	strcpy(ret_url, axis2_location);
+	strcat(ret_url, &url[25]);
     return URI_MATCHED;
 }
 

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/axis2_isapi_plugin.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/axis2_isapi_plugin.c?rev=674007&r1=674006&r2=674007&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/axis2_isapi_plugin.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/axis2_isapi_plugin.c Fri Jul  4 04:13:51 2008
@@ -43,7 +43,7 @@
 #define AXIS2_IIS_EXTENSION_URI_TAG	 "extension_uri"
 #define AXIS2_IIS_REDIRECT_WORD_TAG	 "redirect_uri"
 #define AXIS2_IIS_AXIS2_LOCATION	 "axis2_location"
-#define AXIS2_IIS_SERVICE_URL_PREFIX "services"
+#define AXIS2_IIS_SERVICE_URL_PREFIX "services_url_prefix"
 
 #define AXIS2_IIS_LOG_TRACE_VERB	 "trace"
 #define AXIS2_IIS_LOG_ERROR_VERB	 "error"
@@ -61,8 +61,8 @@
 static const axutil_env_t *axutil_env		 = NULL;
 
 /* Configuration parameters */
-static axis2_char_t *axis2_location			 = "axis2";
-static axis2_char_t *axis2_service_url_prefix= "services";
+axis2_char_t *axis2_location			 = "/axis2";
+static axis2_char_t *axis2_service_url_prefix= "/services";
 static axis2_char_t repo_path[MAX_FILE_PATH];
 static axis2_char_t log_file[MAX_FILE_PATH];
 static axutil_log_levels_t log_level		 = AXIS2_LOG_LEVEL_CRITICAL;
@@ -157,7 +157,7 @@
     HSE_EXEC_URL_INFO   ExecUrlInfo; 
     DWORD               cbData = INTERNET_MAX_URL_LENGTH; 
     char				url[INTERNET_MAX_URL_LENGTH]; 
-	axis2_bool_t		is_for_us = AXIS2_FALSE;
+	axis2_bool_t		is_for_us = AXIS2_TRUE;
 
     /* Get the URL */      
     if ( pecb->GetServerVariable( pecb->ConnID, 
@@ -167,75 +167,80 @@
     { 
         return HSE_STATUS_ERROR;  
     } 
+
+	if (!is_inited) 
+	{			
+		DWORD dwBufferSize = 0;
+		axis2_char_t server_software[256];
+		axis2_char_t *version = NULL;
+
+		ZeroMemory(szOriginalPath, sizeof szOriginalPath);
+		dwBufferSize = sizeof szOriginalPath;
+
+#if _WIN32_WINNT >= 0x0502
+		GetDllDirectory( dwBufferSize, szOriginalPath );
+#else
+		GetCurrentDirectory( dwBufferSize, szOriginalPath );
+#endif
+		ZeroMemory(szPath, sizeof szPath);
+		dwBufferSize = sizeof szPath;
+		/* Get the current physical paht */
+		if (pecb->GetServerVariable(pecb->ConnID, "APPL_PHYSICAL_PATH", szPath, &dwBufferSize) == FALSE)
+		{
+			send_error(pecb, initializing_error);
+			return HSE_STATUS_ERROR;				
+		}
+		/* Retrieve the server version */
+		dwBufferSize = 32;
+		if (pecb->GetServerVariable(pecb->ConnID, "SERVER_SOFTWARE", server_software, &dwBufferSize) == FALSE)
+		{
+			send_error(pecb, initializing_error);
+			return HSE_STATUS_ERROR;				
+		}
+		version = axutil_strchr(server_software, '/');	
+		if (version)
+		{
+			server_version = atoi(version + 1);
+		}
+#if _WIN32_WINNT >= 0x0502
+		SetDllDirectory( szPath );
+#else
+		SetCurrentDirectory( szPath );
+#endif
+		/* If we haven't initialized axis2/c before initialization failed */
+		if (AXIS2_FAILURE == init_axis2())
+		{
+			send_error(pecb, initializing_error);
+			return HSE_STATUS_ERROR;
+		}
+#if _WIN32_WINNT >= 0x0502
+		SetDllDirectory( szOriginalPath );
+#else
+		SetCurrentDirectory( szOriginalPath );
+#endif
+	}
+
 	/* Check weather we have a request for Axis2/C */
-	if (strlen(url) > strlen(axis2_location))
+	if (server_version >= 6 && strlen(url) >= strlen(axis2_location))
     {
 		int i = 0;
 		is_for_us = AXIS2_TRUE;	
 		while (axis2_location[i] != '\0')
 		{
-			if (axis2_location[i] != (url + 1)[i]) {
+			if (axis2_location[i] != (url)[i]) {
 				is_for_us = AXIS2_FALSE;
 				break;
 			}
 			i++;
 		}		
+		if (url[i] != '/' && url[i] != '\0')
+		{
+			is_for_us = AXIS2_FALSE;
+		}
 	}
 		
 	if (is_for_us)
-	{		
-		if (!is_inited) 
-		{			
-			DWORD dwBufferSize = 0;
-			axis2_char_t server_software[256];
-			axis2_char_t *version = NULL;
-
-			ZeroMemory(szOriginalPath, sizeof szOriginalPath);
-			dwBufferSize = sizeof szOriginalPath;
-
-#if _WIN32_WINNT >= 0x0502
-			GetDllDirectory( dwBufferSize, szOriginalPath );
-#else
-			GetCurrentDirectory( dwBufferSize, szOriginalPath );
-#endif
-			ZeroMemory(szPath, sizeof szPath);
-			dwBufferSize = sizeof szPath;
-			/* Get the current physical paht */
-			if (pecb->GetServerVariable(pecb->ConnID, "APPL_PHYSICAL_PATH", szPath, &dwBufferSize) == FALSE)
-			{
-				send_error(pecb, initializing_error);
-				return HSE_STATUS_ERROR;				
-			}
-			/* Retrieve the server version */
-			dwBufferSize = 32;
-			if (pecb->GetServerVariable(pecb->ConnID, "SERVER_SOFTWARE", server_software, &dwBufferSize) == FALSE)
-			{
-				send_error(pecb, initializing_error);
-				return HSE_STATUS_ERROR;				
-			}
-			version = axutil_strchr(server_software, '/');	
-			if (version)
-			{
-				server_version = atoi(version + 1);
-			}
-#if _WIN32_WINNT >= 0x0502
-			SetDllDirectory( szPath );
-#else
-			SetCurrentDirectory( szPath );
-#endif
-			/* If we haven't initialized axis2/c before initialization failed */
-			if (AXIS2_FAILURE == init_axis2())
-			{
-				send_error(pecb, initializing_error);
-				return HSE_STATUS_ERROR;
-			}
-#if _WIN32_WINNT >= 0x0502
-			SetDllDirectory( szOriginalPath );
-#else
-			SetCurrentDirectory( szOriginalPath );
-#endif
-		}	
-
+	{			
 		/* Windows cannot find the correct dlls unless the path is set*/ 
 #if _WIN32_WINNT >= 0x0502
 		SetDllDirectory( szPath );