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 ka...@apache.org on 2006/10/25 12:02:34 UTC

svn commit: r467595 - in /webservices/axis2/trunk/c/rampart: samples/client/echo/echo.c src/handlers/rampart_out_handler.c src/util/rampart_handler_util.c

Author: kaushalye
Date: Wed Oct 25 03:02:33 2006
New Revision: 467595

URL: http://svn.apache.org/viewvc?view=rev&rev=467595
Log:
Changed out handler logic. Now Clients(e.g. PHP) doesnt need to use xml descriptors. 
If there is any action item in the message context, (e.g. UsernameToken) relavent security headers will be added to the out going message.
But we might need to revert this hack in order to facilitate multiple action in the future. 

Modified:
    webservices/axis2/trunk/c/rampart/samples/client/echo/echo.c
    webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c
    webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c

Modified: webservices/axis2/trunk/c/rampart/samples/client/echo/echo.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/samples/client/echo/echo.c?view=diff&rev=467595&r1=467594&r2=467595
==============================================================================
--- webservices/axis2/trunk/c/rampart/samples/client/echo/echo.c (original)
+++ webservices/axis2/trunk/c/rampart/samples/client/echo/echo.c Wed Oct 25 03:02:33 2006
@@ -22,7 +22,7 @@
 #include <rampart_constants.h>
 
 /*Enable following line to setup dynamic values*/
-/*#define DYN_SETTINGS 1*/
+#define DYN_SETTINGS 1
 
 axiom_node_t *
 build_om_payload_for_echo_svc(const axis2_env_t *env);

Modified: webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c?view=diff&rev=467595&r1=467594&r2=467595
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c (original)
+++ webservices/axis2/trunk/c/rampart/src/handlers/rampart_out_handler.c Wed Oct 25 03:02:33 2006
@@ -134,6 +134,8 @@
         soap_header_node = AXIOM_SOAP_HEADER_GET_BASE_NODE(soap_header, env);
         soap_header_ele = (axiom_element_t *)AXIOM_NODE_GET_DATA_ELEMENT(soap_header_node, env);
 
+        /*Create and populate rampart actions*/
+        actions = rampart_actions_create(env);
 
         ctx = AXIS2_MSG_CTX_GET_BASE(msg_ctx, env);
         param_out_flow_security = rampart_get_security_param(env, msg_ctx, RAMPART_OUTFLOW_SECURITY);
@@ -141,46 +143,47 @@
         if (!param_out_flow_security)
         {
             AXIS2_LOG_INFO(env->log, "[rampart][rampart_out_handler] No Outflow Security. So nothing to do");
-            return AXIS2_SUCCESS;
-        }
-
-        /*Get actions*/
-        action_list = rampart_get_actions(env, ctx, param_out_flow_security);
-
-        if (!action_list)
-        {
-            AXIS2_LOG_INFO(env->log, "[rampart][rampart_out_handler] No actions defined in outflow security");
-            return AXIS2_SUCCESS;
-        }
-
-        if (AXIS2_ARRAY_LIST_IS_EMPTY(action_list, env))
-        {
-            AXIS2_LOG_INFO(env->log, "[rampart][rampart_out_handler] No actions defined in outflow security");
-            return AXIS2_SUCCESS;
-        }
+            /*return AXIS2_SUCCESS;*/
+        }else{
+            
+            /*Get actions*/
+            action_list = rampart_get_actions(env, ctx, param_out_flow_security);
+
+            if (!action_list)
+            {
+                AXIS2_LOG_INFO(env->log, "[rampart][rampart_out_handler] No actions defined in outflow security");
+                return AXIS2_SUCCESS;
+            }
+
+            if (AXIS2_ARRAY_LIST_IS_EMPTY(action_list, env))
+            {
+                AXIS2_LOG_INFO(env->log, "[rampart][rampart_out_handler] No actions defined in outflow security");
+                return AXIS2_SUCCESS;
+            }
+
+            /*Now we support only one action.*/
+            param_action = (axis2_param_t*) AXIS2_ARRAY_LIST_GET(action_list, env, 0);
+
+            if (!param_action)
+            {
+                AXIS2_LOG_INFO(env->log, "[rampart][rampart_out_handler] Cannot find first action element ERROR");
+                return AXIS2_FAILURE;
+            }
 
-        /*Now we support only one action.*/
-        param_action = (axis2_param_t*) AXIS2_ARRAY_LIST_GET(action_list, env, 0);
-
-        if (!param_action)
-        {
-            AXIS2_LOG_INFO(env->log, "[rampart][rampart_out_handler] Cannot find first action element ERROR");
-            return AXIS2_FAILURE;
+            status = RAMPART_ACTIONS_POPULATE_FROM_PARAMS(actions, env, param_action);
         }
-
-        /*Create and populate rampart actions*/
-        actions = rampart_actions_create(env);
-        status = RAMPART_ACTIONS_POPULATE_FROM_PARAMS(actions, env, param_action);
-
-        /*Then re-populate using the axis2_ctx*/
+        /*Then re-populate using the axis2_ctx. 
+         *This is a hack to facilitate PHP extension to pass security parameters using options
+         *In future we should change this to get the param_out_flow_security from a PROPERTY if it is not available
+         *in the msg_ctx as as a parameter.*/
         status = RAMPART_ACTIONS_POPULATE_FROM_CTX(actions, env, ctx);
 
         items = AXIS2_STRDUP(RAMPART_ACTIONS_GET_ITEMS(actions, env), env);
 
         if (!items)
         {
-            AXIS2_LOG_INFO(env->log, "[rampart][rampart_out_handler] No action items defined. ERROR");
-            return AXIS2_FAILURE;
+            AXIS2_LOG_INFO(env->log, "[rampart][rampart_out_handler] No action items defined. Nothing to do");
+            return AXIS2_SUCCESS;
         }
 
         sec_ns_obj =  axiom_namespace_create(env, RAMPART_WSSE_XMLNS,

Modified: webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c?view=diff&rev=467595&r1=467594&r2=467595
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/rampart_handler_util.c Wed Oct 25 03:02:33 2006
@@ -105,7 +105,6 @@
         axis2_char_t *parameter)
 {
 
-
     axis2_param_t *param = NULL;
     param = AXIS2_MSG_CTX_GET_PARAMETER(msg_ctx, env, parameter);
     return param;



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