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 sa...@apache.org on 2005/12/07 10:06:06 UTC

svn commit: r354753 - in /webservices/axis2/trunk/c: include/axis2_disp_checker.h include/axis2_msg_ctx.h modules/core/context/src/msg_ctx.c modules/core/engine/src/Makefile.am modules/core/engine/src/disp_checker.c

Author: samisa
Date: Wed Dec  7 01:05:53 2005
New Revision: 354753

URL: http://svn.apache.org/viewcvs?rev=354753&view=rev
Log:
Added initial version of dispatcher checker and also fixed message context in line with that.

Added:
    webservices/axis2/trunk/c/include/axis2_disp_checker.h
    webservices/axis2/trunk/c/modules/core/engine/src/disp_checker.c
Modified:
    webservices/axis2/trunk/c/include/axis2_msg_ctx.h
    webservices/axis2/trunk/c/modules/core/context/src/msg_ctx.c
    webservices/axis2/trunk/c/modules/core/engine/src/Makefile.am

Added: webservices/axis2/trunk/c/include/axis2_disp_checker.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_disp_checker.h?rev=354753&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_disp_checker.h (added)
+++ webservices/axis2/trunk/c/include/axis2_disp_checker.h Wed Dec  7 01:05:53 2005
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_DISP_CHECKER_H
+#define AXIS2_DISP_CHECKER_H
+
+/**
+ * @file axis2_disp_checker.h
+ * @brief Axis2 Dispatcher interface
+ */
+
+#include <axis2_defines.h>
+#include <axis2_qname.h>
+#include <axis2_handler.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+    struct axis2_disp_checker;
+    struct axis2_disp_checker_ops;
+    
+/**
+ * @defgroup axis2_disp_checker Dispatcher
+ * @ingroup axis2_engine
+ * @{
+ */
+
+/**
+ *   \brief Dispatcher operations struct
+ */
+ AXIS2_DECLARE_DATA   typedef struct axis2_disp_checker_ops
+    { 
+        axis2_handler_t* (AXIS2_CALL *get_base) (struct axis2_disp_checker *disp_checker, 
+                                               axis2_env_t **env);
+        axis2_qname_t* (AXIS2_CALL *get_qname) (struct axis2_disp_checker *disp_checker, 
+                                               axis2_env_t **env);
+        axis2_status_t (AXIS2_CALL *set_qname) (struct axis2_disp_checker *disp_checker, 
+                                               axis2_env_t **env, axis2_qname_t *qname);
+        axis2_status_t (AXIS2_CALL *free) (struct axis2_disp_checker *disp_checker, 
+                                               axis2_env_t **env);
+        
+    } axis2_disp_checker_ops_t;
+	
+   /** 
+    * \brief Dispatcher struct
+    */
+    typedef struct axis2_disp_checker
+    {
+        /** Dispatcher related operations */
+        axis2_disp_checker_ops_t *ops;
+    } axis2_disp_checker_t;
+
+
+/**
+ * creates disp_checker struct
+ * @param qname qname, can be NULL
+ */
+AXIS2_DECLARE(axis2_disp_checker_t*) axis2_disp_checker_create(axis2_env_t **env, axis2_qname_t *qname);
+
+#define AXIS2_DISP_CHECKER_GET_BASE(disp_checker, env) ((disp_checker)->ops->get_base(disp_checker, env))
+#define AXIS2_DISP_CHECKER_GET_QNAME(disp_checker, env) ((disp_checker)->ops->get_qname(disp_checker, env))
+#define AXIS2_DISP_CHECKER_SET_QNAME(disp_checker, env, name) ((disp_checker)->ops->set_qname(disp_checker, env, name))
+#define AXIS2_DISP_CHECKER_FREE(disp_checker, env) ((disp_checker)->ops->free(disp_checker, env))
+    
+/** @} */
+    
+#ifdef __cplusplus
+}
+#endif
+
+#endif    /* AXIS2_DISP_CHECKER_H */

Modified: webservices/axis2/trunk/c/include/axis2_msg_ctx.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_msg_ctx.h?rev=354753&r1=354752&r2=354753&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_msg_ctx.h (original)
+++ webservices/axis2/trunk/c/include/axis2_msg_ctx.h Wed Dec  7 01:05:53 2005
@@ -31,6 +31,7 @@
 #include <axis2_param.h>
 #include <axis2_handler_desc.h>
 #include <axis2_qname.h>
+#include <axis2_msg_info_headers.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -104,14 +105,14 @@
     /**
      * @return
      */
-    /*EndpointReference (AXIS2_CALL *get_fault_to)(struct axis2_msg_ctx *msg_ctx, 
+    /*axis2_endpoint_ref_t *(AXIS2_CALL *get_fault_to)(struct axis2_msg_ctx *msg_ctx, 
                                                     axis2_env_t **env);
     */
     
     /**
      * @return
      */
-    /*EndpointReference (AXIS2_CALL *get_from)(struct axis2_msg_ctx *msg_ctx, 
+    /*axis2_endpoint_ref_t *(AXIS2_CALL *get_from)(struct axis2_msg_ctx *msg_ctx, 
                                                 axis2_env_t **env);
     */
     
@@ -150,7 +151,7 @@
     /**
      * @return
      */
-    /*EndpointReference (AXIS2_CALL *get_reply_to)(struct axis2_msg_ctx *msg_ctx, 
+    /*axis2_endpoint_ref_t *(AXIS2_CALL *get_reply_to)(struct axis2_msg_ctx *msg_ctx, 
                                                     axis2_env_t **env);
     */
     
@@ -175,15 +176,14 @@
     /**
      * @return
      */
-    /*EndpointReference (AXIS2_CALL *get_to)(struct axis2_msg_ctx *msg_ctx, 
+    axis2_endpoint_ref_t* (AXIS2_CALL *get_to)(struct axis2_msg_ctx *msg_ctx, 
                                                 axis2_env_t **env);
-    */
     
     /**
      * @param reference
      */
     /*axis2_status_t (AXIS2_CALL *set_fault_to)(struct axis2_msg_ctx *msg_ctx, 
-                                                axis2_env_t **env, EndpointReference reference);
+                                                axis2_env_t **env, axis2_endpoint_ref_t *reference);
     */
     
     /**
@@ -191,7 +191,7 @@
      */
     /*
     axis2_status_t (AXIS2_CALL *set_from)(struct axis2_msg_ctx *msg_ctx, 
-                                                axis2_env_t **env, EndpointReference reference);
+                                                axis2_env_t **env, axis2_endpoint_ref_t *reference);
     */
     
     /**
@@ -234,7 +234,7 @@
      */
     /*axis2_status_t (AXIS2_CALL *set_reply_to)(struct axis2_msg_ctx *msg_ctx, 
                                                 axis2_env_t **env, 
-                                                EndpointReference referance);
+                                                axis2_endpoint_ref_t *referance);
     */
     
     /**
@@ -256,7 +256,7 @@
      */
     /*axis2_status_t (AXIS2_CALL *set_to)(struct axis2_msg_ctx *msg_ctx, 
                                             axis2_env_t **env, 
-                                            EndpointReference referance);
+                                            axis2_endpoint_ref_t *referance);
     */
     
     /**
@@ -275,13 +275,13 @@
     /**
      * Method AXIS2_CALL getExecutionChain
      */
-    /*axis2_status_t (AXIS2_CALL *set_wsa_action)(struct axis2_msg_ctx *msg_ctx, 
+    axis2_status_t (AXIS2_CALL *set_wsa_action)(struct axis2_msg_ctx *msg_ctx, 
                                                     axis2_env_t **env, 
                                                     axis2_char_t *action_uri);
     
     axis2_char_t* (AXIS2_CALL *get_wsa_action)(struct axis2_msg_ctx *msg_ctx, 
                                                 axis2_env_t **env);
-    
+    /*
     axis2_status_t (AXIS2_CALL *set_wsa_message_id)(struct axis2_msg_ctx *msg_ctx, 
                                                     axis2_env_t **env, 
                                                     axis2_char_t *message_id);
@@ -612,9 +612,7 @@
 #define AXIS2_MSG_CTX_GET_RESPONSE_WRITTEN(msg_ctx, env) ((msg_ctx)->ops->get_response_written(msg_ctx, env))
 #define AXIS2_MSG_CTX_GET_SERVER_SIDE(msg_ctx, env) ((msg_ctx)->ops->get_server_side(msg_ctx, env))
 #define AXIS2_MSG_CTX_GET_SESSION_CTX(msg_ctx, env) ((msg_ctx)->ops->get_session_ctx(msg_ctx, env))
-/*
 #define AXIS2_MSG_CTX_GET_TO(msg_ctx, env) ((msg_ctx)->ops->get_to(msg_ctx, env))
-*/
 /*
 #define AXIS2_MSG_CTX_SET_FAULT_TO(msg_ctx, env, reference) ((msg_ctx)->ops->set_fault_to(msg_ctx, env, reference))
 */
@@ -640,10 +638,11 @@
 */
 #define AXIS2_MSG_CTX_GET_NEW_THREAD_REQUIRED(msg_ctx, env) ((msg_ctx)->ops->set_response_written(msg_ctx, env))
 #define AXIS2_MSG_CTX_SET_NEW_THREAD_REQUIRED(msg_ctx, env, new_thread_required) ((msg_ctx)->ops->set_response_written(msg_ctx, env, new_thread_required))
-/*
+
 #define AXIS2_MSG_CTX_SET_WSA_ACTION(msg_ctx, env, action_uri) ((msg_ctx)->ops->set_wsa_action(msg_ctx, env, action_uri))
 #define AXIS2_MSG_CTX_GET_WSA_ACTION(msg_ctx, env) ((msg_ctx)->ops->get_wsa_action(msg_ctx, env))
-#define AXIS2_MSG_CTX_SET_WSA_MESSAGE_ID(msg_ctx, env, message_id) ((msg_ctx)->ops->set_wsa_message_id(msg_ctx, env, message_id))
+
+/*#define AXIS2_MSG_CTX_SET_WSA_MESSAGE_ID(msg_ctx, env, message_id) ((msg_ctx)->ops->set_wsa_message_id(msg_ctx, env, message_id))
 #define AXIS2_MSG_CTX_GET_WSA_MESSAGE_ID(msg_ctx, env) ((msg_ctx)->ops->get_wsa_message_id(msg_ctx, env))
 */
 #define AXIS2_MSG_CTX_GET_MSG_INFO_HEADERS(msg_ctx, env) ((msg_ctx)->ops->get_msg_info_headers(msg_ctx, env))
@@ -681,7 +680,7 @@
 #define AXIS2_MSG_CTX_GET_SVC_GRP_CTX(msg_ctx, env) ((msg_ctx)->ops->get_svc_grp_ctx(msg_ctx, env))
 #define AXIS2_MSG_CTX_SET_SVC_GRP_CTX(msg_ctx, env, svc_grp_ctx) ((msg_ctx)->ops->set_svc_grp_ctx(msg_ctx, env, svc_grp_ctx))
 #define AXIS2_MSG_CTX_GET_OPERATION(msg_ctx, env) ((msg_ctx)->ops->get_operation(msg_ctx, env))
-#define AXIS2_MSG_CTX_SET_OPERATION(msg_ctx, env, operation) ((msg_ctx)->ops->get_operation(msg_ctx, env, operation))
+#define AXIS2_MSG_CTX_SET_OPERATION(msg_ctx, env, operation) ((msg_ctx)->ops->set_operation(msg_ctx, env, operation))
 #define AXIS2_MSG_CTX_GET_SVC(msg_ctx, env) ((msg_ctx)->ops->get_svc(msg_ctx, env))
 #define AXIS2_MSG_CTX_SET_SVC(msg_ctx, env, svc) ((msg_ctx)->ops->set_svc(msg_ctx, env, svc))
 #define AXIS2_MSG_CTX_GET_SVC_GRP(msg_ctx, env) ((msg_ctx)->ops->get_svc_grp(msg_ctx, env))

Modified: webservices/axis2/trunk/c/modules/core/context/src/msg_ctx.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/context/src/msg_ctx.c?rev=354753&r1=354752&r2=354753&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/src/msg_ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/src/msg_ctx.c Wed Dec  7 01:05:53 2005
@@ -42,7 +42,7 @@
      * the transport. Then later an addressing handler will make relevant changes to this, if addressing
      * information is present in the SOAP header.
      */
-    /*axis2_msg_info_headers_t *msg_info_headers;*/
+    axis2_msg_info_headers_t *msg_info_headers;
 
     struct axis2_operation_ctx *operation_ctx;
     struct axis2_svc_ctx *svc_ctx;
@@ -130,11 +130,11 @@
 axis2_msg_ctx_init(struct axis2_msg_ctx *msg_ctx, 
                     axis2_env_t **env, 
                     struct axis2_engine_config *engine_config);
-/*EndpointReference AXIS2_CALL 
+/*axis2_endpoint_ref_t *AXIS2_CALL 
 axis2_msg_ctx_get_fault_to(struct axis2_msg_ctx *msg_ctx, 
                             axis2_env_t **env);
 */
-/*EndpointReference AXIS2_CALL
+/*axis2_endpoint_ref_t *AXIS2_CALL
 axis2_msg_ctx_get_from(struct axis2_msg_ctx *msg_ctx, 
                         axis2_env_t **env);
 */
@@ -155,7 +155,7 @@
 axis2_msg_ctx_get_relates_to(struct axis2_msg_ctx *msg_ctx, 
                                 axis2_env_t **env);
 */
-/*EndpointReference AXIS2_CALL
+/*axis2_endpoint_ref_t *AXIS2_CALL
 axis2_msg_ctx_get_reply_to(struct axis2_msg_ctx *msg_ctx, 
                             axis2_env_t **env);
 */
@@ -168,20 +168,20 @@
 struct axis2_session_ctx* AXIS2_CALL
 axis2_msg_ctx_get_session_ctx(struct axis2_msg_ctx *msg_ctx, 
                                 axis2_env_t **env);
-/*EndpointReference AXIS2_CALL
+axis2_endpoint_ref_t *AXIS2_CALL
 axis2_msg_ctx_get_to(struct axis2_msg_ctx *msg_ctx, 
                         axis2_env_t **env);
-*/
+
 /*axis2_status_t AXIS2_CALL
 axis2_msg_ctx_set_fault_to(struct axis2_msg_ctx *msg_ctx, 
                             axis2_env_t **env, 
-                            EndpointReference reference);
+                            axis2_endpoint_ref_t *reference);
 */
 /*
 axis2_status_t AXIS2_CALL
 axis2_msg_ctx_set_from(struct axis2_msg_ctx *msg_ctx, 
                         axis2_env_t **env, 
-                        EndpointReference reference);
+                        axis2_endpoint_ref_t *reference);
 */
 axis2_status_t AXIS2_CALL
 axis2_msg_ctx_set_in_fault_flow(struct axis2_msg_ctx *msg_ctx, 
@@ -208,7 +208,7 @@
 /*axis2_status_t AXIS2_CALL
 axis2_msg_ctx_set_reply_to(struct axis2_msg_ctx *msg_ctx, 
                             axis2_env_t **env, 
-                            EndpointReference referance);
+                            axis2_endpoint_ref_t *referance);
 */
 axis2_status_t AXIS2_CALL
 axis2_msg_ctx_set_response_written(struct axis2_msg_ctx *msg_ctx, 
@@ -221,7 +221,7 @@
 /*axis2_status_t AXIS2_CALL
 axis2_msg_ctx_set_to(struct axis2_msg_ctx *msg_ctx, 
                         axis2_env_t **env, 
-                        EndpointReference referance);
+                        axis2_endpoint_ref_t *referance);
 */
 axis2_bool_t AXIS2_CALL
 axis2_msg_ctx_get_new_thread_required(struct axis2_msg_ctx *msg_ctx, 
@@ -230,14 +230,14 @@
 axis2_msg_ctx_set_new_thread_required(struct axis2_msg_ctx *msg_ctx, 
                                         axis2_env_t **env, 
                                         axis2_bool_t new_thread_required);
-/*axis2_status_t AXIS2_CALL
+axis2_status_t AXIS2_CALL
 axis2_msg_ctx_set_wsa_action(struct axis2_msg_ctx *msg_ctx, 
                                 axis2_env_t **env, 
                                 axis2_char_t *action_uri);
 axis2_char_t* AXIS2_CALL
 axis2_msg_ctx_get_wsa_action(struct axis2_msg_ctx *msg_ctx, 
                              axis2_env_t **env);
-
+/*
 axis2_status_t AXIS2_CALL
 axis2_msg_ctx_set_wsa_message_id(struct axis2_msg_ctx *msg_ctx, 
                                     axis2_env_t **env, 
@@ -537,9 +537,7 @@
     msg_ctx_impl->msg_ctx.ops->get_response_written = axis2_msg_ctx_get_response_written;
     msg_ctx_impl->msg_ctx.ops->get_server_side = axis2_msg_ctx_get_server_side;
     msg_ctx_impl->msg_ctx.ops->get_session_ctx = axis2_msg_ctx_get_session_ctx;
-/*
     msg_ctx_impl->msg_ctx.ops->get_to = axis2_msg_ctx_get_to;
-*/
 /*
     msg_ctx_impl->msg_ctx.ops->set_fault_to = axis2_msg_ctx_set_fault_to;
 */
@@ -566,10 +564,10 @@
 */
     msg_ctx_impl->msg_ctx.ops->get_new_thread_required = axis2_msg_ctx_get_new_thread_required;
     msg_ctx_impl->msg_ctx.ops->set_new_thread_required = axis2_msg_ctx_set_new_thread_required;
-/*
+
     msg_ctx_impl->msg_ctx.ops->set_wsa_action = axis2_msg_ctx_set_wsa_action;
     msg_ctx_impl->msg_ctx.ops->get_wsa_action = axis2_msg_ctx_get_wsa_action;
-    msg_ctx_impl->msg_ctx.ops->set_wsa_message_id = axis2_msg_ctx_set_wsa_message_id;
+/*    msg_ctx_impl->msg_ctx.ops->set_wsa_message_id = axis2_msg_ctx_set_wsa_message_id;
     msg_ctx_impl->msg_ctx.ops->get_wsa_message_id = axis2_msg_ctx_get_wsa_message_id;
 */
     /*msg_ctx_impl->msg_ctx.ops->get_msg_info_headers = axis2_msg_ctx_get_msg_info_headers;*/
@@ -768,7 +766,7 @@
 /**
  * @return
  */
-/*EndpointReference AXIS2_CALL axis2_msg_ctx_get_fault_to(struct axis2_msg_ctx *msg_ctx, 
+/*axis2_endpoint_ref_t *AXIS2_CALL axis2_msg_ctx_get_fault_to(struct axis2_msg_ctx *msg_ctx, 
                                             axis2_env_t **env) {
     return msg_info_headersgetFaultTo();
 }
@@ -777,7 +775,7 @@
 /**
  * @return
  */
-/*EndpointReference AXIS2_CALL axis2_msg_ctx_get_from(struct axis2_msg_ctx *msg_ctx, 
+/*axis2_endpoint_ref_t *AXIS2_CALL axis2_msg_ctx_get_from(struct axis2_msg_ctx *msg_ctx, 
                                             axis2_env_t **env) 
 {
     return msg_info_headersgetFrom();
@@ -837,7 +835,7 @@
 /**
  * @return
  */
-/*EndpointReference AXIS2_CALL axis2_msg_ctx_get_reply_to(struct axis2_msg_ctx *msg_ctx, 
+/*axis2_endpoint_ref_t *AXIS2_CALL axis2_msg_ctx_get_reply_to(struct axis2_msg_ctx *msg_ctx, 
                                             axis2_env_t **env) {
     return msg_info_headersgetReplyTo();
 }
@@ -876,19 +874,30 @@
 /**
  * @return
  */
-/*EndpointReference AXIS2_CALL axis2_msg_ctx_get_to(struct axis2_msg_ctx *msg_ctx, 
+axis2_endpoint_ref_t *AXIS2_CALL axis2_msg_ctx_get_to(struct axis2_msg_ctx *msg_ctx, 
                                             axis2_env_t **env)
 {
+    axis2_msg_ctx_impl_t *msg_ctx_impl = NULL;
+    
     AXIS2_FUNC_PARAM_CHECK(msg_ctx, env, NULL);
-    return AXIS2_INTF_TO_IMPL(msg_ctx)->msg_info_headers.getTo();
+    
+    msg_ctx_impl = AXIS2_INTF_TO_IMPL(msg_ctx);
+    
+    
+    if (msg_ctx_impl->msg_info_headers)
+    {
+        return AXIS2_MSG_INFO_HEADERS_GET_TO(msg_ctx_impl->msg_info_headers, env);
+    }
+    
+    return NULL;
 }
-*/
+
 
 /**
  * @param reference
  */
 /*axis2_status_t AXIS2_CALL axis2_msg_ctx_set_fault_to(struct axis2_msg_ctx *msg_ctx, 
-                                            axis2_env_t **env, EndpointReference reference) {
+                                            axis2_env_t **env, axis2_endpoint_ref_t *reference) {
     msg_info_headers.setFaultTo(reference);
 }
 */
@@ -898,7 +907,7 @@
  */
 /*
 axis2_status_t AXIS2_CALL axis2_msg_ctx_set_from(struct axis2_msg_ctx *msg_ctx, 
-                                            axis2_env_t **env, EndpointReference reference) {
+                                            axis2_env_t **env, axis2_endpoint_ref_t *reference) {
     msg_info_headers.setFrom(reference);
 }
 */
@@ -983,7 +992,7 @@
  * @param referance
  */
 /*axis2_status_t AXIS2_CALL axis2_msg_ctx_set_reply_to(struct axis2_msg_ctx *msg_ctx, 
-                                            axis2_env_t **env, EndpointReference referance) {
+                                            axis2_env_t **env, axis2_endpoint_ref_t *referance) {
     msg_info_headers.setReplyTo(referance);
 }
 */
@@ -1014,7 +1023,7 @@
  * @param referance
  */
 /*axis2_status_t AXIS2_CALL axis2_msg_ctx_set_to(struct axis2_msg_ctx *msg_ctx, 
-                                            axis2_env_t **env, EndpointReference referance) 
+                                            axis2_env_t **env, axis2_endpoint_ref_t *referance) 
 {
     msg_info_headers.set_to(referance);
 }
@@ -1045,19 +1054,43 @@
  * Method AXIS2_CALL axis2_msg_ctx_getExecutionChain
  */
 
-/*axis2_status_t AXIS2_CALL axis2_msg_ctx_set_wsa_action(struct axis2_msg_ctx *msg_ctx, 
+axis2_status_t AXIS2_CALL axis2_msg_ctx_set_wsa_action(struct axis2_msg_ctx *msg_ctx, 
                                             axis2_env_t **env, axis2_char_t *action_uri) 
 {
-    msg_info_headerssetAction(action_uri);
+    axis2_msg_ctx_impl_t *msg_ctx_impl = NULL;
+    
+    AXIS2_FUNC_PARAM_CHECK(msg_ctx, env, AXIS2_FAILURE);
+    
+    msg_ctx_impl = AXIS2_INTF_TO_IMPL(msg_ctx);
+    
+    
+    if (msg_ctx_impl->msg_info_headers)
+    {
+        return AXIS2_MSG_INFO_HEADERS_SET_ACTION(msg_ctx_impl->msg_info_headers, env, action_uri);
+    }
+    
+    return AXIS2_SUCCESS;
 }
 
 axis2_char_t *AXIS2_CALL axis2_msg_ctx_get_wsa_action(struct axis2_msg_ctx *msg_ctx, 
                                             axis2_env_t **env)
 {
+    axis2_msg_ctx_impl_t *msg_ctx_impl = NULL;
+    
     AXIS2_FUNC_PARAM_CHECK(msg_ctx, env, NULL);
-    return AXIS2_INTF_TO_IMPL(msg_ctx)->msg_info_headers.getAction();
+    
+    msg_ctx_impl = AXIS2_INTF_TO_IMPL(msg_ctx);
+    
+    
+    if (msg_ctx_impl->msg_info_headers)
+    {
+        return AXIS2_MSG_INFO_HEADERS_GET_ACTION(msg_ctx_impl->msg_info_headers, env);
+    }
+    
+    return NULL;
 }
 
+/*
 axis2_status_t AXIS2_CALL axis2_msg_ctx_set_wsa_message_id(struct axis2_msg_ctx *msg_ctx, 
                                             axis2_env_t **env, axis2_char_t *message_id) 
 {
@@ -1851,7 +1884,7 @@
 {
     axis2_msg_ctx_impl_t *msg_ctx_impl = NULL;
     
-    AXIS2_FUNC_PARAM_CHECK(msg_ctx, env, NULL);
+    AXIS2_FUNC_PARAM_CHECK(msg_ctx, env, AXIS2_FAILURE);
     
     msg_ctx_impl = AXIS2_INTF_TO_IMPL(msg_ctx);
     

Modified: webservices/axis2/trunk/c/modules/core/engine/src/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/engine/src/Makefile.am?rev=354753&r1=354752&r2=354753&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/src/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/core/engine/src/Makefile.am Wed Dec  7 01:05:53 2005
@@ -1,6 +1,6 @@
 lib_LTLIBRARIES = libaxis2_engine.la
 AM_CPPFLAGS = $(CPPFLAGS)
-libaxis2_engine_la_SOURCES = handler.c msg_recv.c engine_config.c phase.c
+libaxis2_engine_la_SOURCES = handler.c msg_recv.c engine_config.c phase.c disp_checker.c
 
 libaxis2_engine_la_LIBADD = $(LDFLAGS)
 INCLUDES = -I${CUTEST_HOME}/include \

Added: webservices/axis2/trunk/c/modules/core/engine/src/disp_checker.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/engine/src/disp_checker.c?rev=354753&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/src/disp_checker.c (added)
+++ webservices/axis2/trunk/c/modules/core/engine/src/disp_checker.c Wed Dec  7 01:05:53 2005
@@ -0,0 +1,264 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_disp_checker.h>
+#include <axis2_handler_desc.h>
+#include <axis2_qname.h>
+#include <axis2_relates_to.h>
+#include <axis2_svc.h>
+#include <axis2.h>
+#include <axis2_msg_ctx.h>
+#include <axis2_operation_ctx.h>
+#include <axis2_svc_ctx.h>
+#include <axis2_endpoint_ref.h>
+
+typedef struct axis2_disp_checker_impl 
+{
+    /** phase */
+	axis2_disp_checker_t disp_checker;
+    /** base class, inherits from handler */
+    axis2_handler_t *base;
+    /** phase name */
+    axis2_qname_t *qname;    
+} axis2_disp_checker_impl_t;
+
+/** Interface to implementation conversion macro */
+#define AXIS2_INTF_TO_IMPL(disp_checker) ((axis2_disp_checker_impl_t *)disp_checker)
+
+axis2_status_t AXIS2_CALL axis2_disp_checker_invoke (struct axis2_handler * handler, 
+                                                axis2_env_t **env,
+                                                struct axis2_msg_ctx *msg_ctx);
+axis2_handler_t* AXIS2_CALL axis2_disp_checker_get_base(struct axis2_disp_checker *disp_checker, 
+                                               axis2_env_t **env);
+axis2_qname_t* AXIS2_CALL axis2_disp_checker_get_qname(struct axis2_disp_checker *disp_checker, 
+                                       axis2_env_t **env);
+axis2_status_t AXIS2_CALL axis2_disp_checker_set_qname(struct axis2_disp_checker *disp_checker, 
+                                       axis2_env_t **env, axis2_qname_t *qname);
+axis2_status_t AXIS2_CALL axis2_disp_checker_free (struct axis2_disp_checker * disp_checker, 
+                                            axis2_env_t **env);
+
+axis2_disp_checker_t* AXIS2_CALL axis2_disp_checker_create(axis2_env_t **env, axis2_qname_t *qname) 
+{
+    axis2_disp_checker_impl_t *disp_checker_impl = NULL;
+    axis2_handler_desc_t *handler_desc = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    disp_checker_impl = AXIS2_MALLOC( (*env)->allocator, sizeof(axis2_disp_checker_impl_t) );
+    if (!disp_checker_impl)
+    { 
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;        
+    }
+
+    disp_checker_impl->disp_checker.ops = NULL;
+    disp_checker_impl->qname = NULL;
+    disp_checker_impl->base = NULL;
+    
+    /* create default qname */
+    disp_checker_impl->qname = axis2_qname_create(env, "dispatch_post_conditions_evaluator", 
+                                            "http://axis.ws.apache.org",
+                                            NULL);
+    if (!(disp_checker_impl->qname))
+    {
+        axis2_disp_checker_free(&(disp_checker_impl->disp_checker), env);
+        return NULL;        
+    }           
+    
+    disp_checker_impl->base = axis2_handler_create(env);
+    if (!disp_checker_impl->base)
+    {
+        axis2_disp_checker_free(&(disp_checker_impl->disp_checker), env);
+        return NULL;
+    }
+    
+    /* handler desc of base handler */
+    handler_desc = axis2_handler_desc_create(env, disp_checker_impl->qname);
+    if (!handler_desc)
+    {
+        axis2_disp_checker_free(&(disp_checker_impl->disp_checker), env);
+        return NULL;
+    }
+    
+    AXIS2_HANDLER_INIT(disp_checker_impl->base, env, handler_desc);
+    
+    /* set the base struct's invoke operation */
+    if (disp_checker_impl->base->ops) 
+        disp_checker_impl->base->ops->invoke = axis2_disp_checker_invoke;
+
+    /* initialize operations */    
+    disp_checker_impl->disp_checker.ops  = AXIS2_MALLOC( (*env)->allocator, sizeof(axis2_disp_checker_ops_t) );
+    if (!disp_checker_impl->disp_checker.ops)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        axis2_disp_checker_free(&(disp_checker_impl->disp_checker), env);
+        return NULL;        
+    }
+
+    disp_checker_impl->disp_checker.ops->get_base = axis2_disp_checker_get_base;
+    disp_checker_impl->disp_checker.ops->get_qname = axis2_disp_checker_get_qname;
+    disp_checker_impl->disp_checker.ops->set_qname = axis2_disp_checker_set_qname;
+    disp_checker_impl->disp_checker.ops->free = axis2_disp_checker_free;
+
+    return &(disp_checker_impl->disp_checker);
+}
+
+axis2_handler_t* AXIS2_CALL axis2_disp_checker_get_base(struct axis2_disp_checker *disp_checker, 
+                                               axis2_env_t **env)
+{
+    AXIS2_FUNC_PARAM_CHECK(disp_checker, env, NULL);
+    return AXIS2_INTF_TO_IMPL(disp_checker)->base;
+}
+
+axis2_qname_t* AXIS2_CALL axis2_disp_checker_get_qname(struct axis2_disp_checker *disp_checker, 
+                                       axis2_env_t **env)
+{
+    AXIS2_FUNC_PARAM_CHECK(disp_checker, env, NULL);
+    return AXIS2_INTF_TO_IMPL(disp_checker)->qname;
+}
+
+axis2_status_t AXIS2_CALL axis2_disp_checker_set_qname(struct axis2_disp_checker *disp_checker, 
+                                       axis2_env_t **env, axis2_qname_t *qname)
+{
+    axis2_disp_checker_impl_t *disp_checker_impl = NULL;
+    
+    AXIS2_FUNC_PARAM_CHECK(disp_checker, env, AXIS2_FAILURE);
+    
+    disp_checker_impl = AXIS2_INTF_TO_IMPL(disp_checker);
+    
+    if (disp_checker_impl->qname)
+    {
+        AXIS2_QNAME_FREE(disp_checker_impl->qname, env);
+        disp_checker_impl->qname = NULL;
+    }
+    
+    if (qname)
+    {
+        disp_checker_impl->qname = AXIS2_QNAME_CLONE(qname, env);
+        if (!(disp_checker_impl->qname))
+            return AXIS2_FAILURE;
+    }
+    
+    return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL 
+axis2_disp_checker_free(struct axis2_disp_checker * disp_checker, 
+                    axis2_env_t **env)
+{
+    axis2_disp_checker_impl_t *disp_checker_impl = NULL;
+    AXIS2_FUNC_PARAM_CHECK(disp_checker, env, AXIS2_FAILURE);
+    disp_checker_impl = AXIS2_INTF_TO_IMPL(disp_checker);
+    
+    if (disp_checker_impl->qname)
+    {
+        AXIS2_QNAME_FREE(disp_checker_impl->qname, env);
+        disp_checker_impl->qname = NULL;
+    }
+    
+    if (disp_checker_impl->base)
+    {
+        axis2_handler_desc_t *handler_desc = AXIS2_HANDLER_GET_HANDLER_DESC(disp_checker_impl->base, env);
+        AXIS2_HANDLER_DESC_FREE(handler_desc, env); /* freeing handler desc frees handler */
+        disp_checker_impl->base = NULL;
+    }
+    
+    if (disp_checker_impl->disp_checker.ops)
+    {
+        AXIS2_FREE((*env)->allocator, disp_checker_impl->disp_checker.ops);
+        disp_checker_impl->disp_checker.ops = NULL;
+    }
+    
+    AXIS2_FREE((*env)->allocator, disp_checker_impl);
+    disp_checker_impl = NULL;
+    
+    return AXIS2_SUCCESS;    
+}
+    
+
+/**
+ * Method invoke.
+ *
+ * @param msgctx
+ * @throws AxisFault
+ */
+axis2_status_t AXIS2_CALL axis2_disp_checker_invoke(axis2_handler_t* handler, axis2_env_t **env, axis2_msg_ctx_t *msg_ctx)
+{
+    axis2_operation_t *operation = NULL;
+    axis2_operation_ctx_t *operation_ctx = NULL;
+    axis2_svc_t *svc = NULL;
+    axis2_svc_ctx_t *svc_ctx = NULL;
+    axis2_endpoint_ref_t *endpoint_ref = NULL;
+
+    AXIS2_FUNC_PARAM_CHECK(handler, env, AXIS2_FAILURE);
+    
+    AXIS2_PARAM_CHECK((*env)->error, msg_ctx, AXIS2_FAILURE);
+
+    operation = AXIS2_MSG_CTX_GET_OPERATION(msg_ctx, env);
+    
+    if (!operation)
+    {
+        operation_ctx = AXIS2_MSG_CTX_GET_OPERATION_CTX(msg_ctx, env);
+        if (operation_ctx)
+        {
+            axis2_operation_t *op = AXIS2_OPERATION_CTX_GET_OPERATION(operation_ctx, env);
+            if (op)
+                AXIS2_MSG_CTX_SET_OPERATION(msg_ctx, env, op);
+        }
+    }
+    
+    svc = AXIS2_MSG_CTX_GET_SVC(msg_ctx, env);
+    
+    if (!svc)
+    {
+        svc_ctx = AXIS2_MSG_CTX_GET_SVC_CTX(msg_ctx, env);
+        if (svc_ctx)
+        {
+            axis2_svc_t *tsvc = AXIS2_SVC_CTX_GET_SVC(svc_ctx, env);
+            if (tsvc)
+                AXIS2_MSG_CTX_SET_SVC(msg_ctx, env, tsvc);
+        }
+    }
+
+    endpoint_ref = AXIS2_MSG_CTX_GET_TO(msg_ctx, env);
+    
+    svc = AXIS2_MSG_CTX_GET_SVC(msg_ctx, env);
+    if (!svc)
+    {
+        AXIS2_LOG(env, "Service Not found. Endpoint reference is ");
+        if (endpoint_ref)
+        {
+            AXIS2_LOG(env, AXIS2_ENDPOINT_REF_GET_ADDRESS(endpoint_ref, env));
+        }
+       
+        return AXIS2_FAILURE;
+    }
+    
+    operation = AXIS2_MSG_CTX_GET_OPERATION(msg_ctx, env);
+    if (!operation)
+    {
+        AXIS2_LOG(env, "Operation Not found. Endpoint reference is ");
+        if (endpoint_ref)
+        {
+            AXIS2_LOG(env, AXIS2_ENDPOINT_REF_GET_ADDRESS(endpoint_ref, env));
+        }
+        AXIS2_LOG(env, " and WSA Action = ");
+        AXIS2_LOG(env, AXIS2_MSG_CTX_GET_WSA_ACTION(msg_ctx, env));
+        
+        return AXIS2_FAILURE;
+    }    
+    return AXIS2_SUCCESS;
+}