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 da...@apache.org on 2005/12/14 09:24:07 UTC

svn commit: r356748 - in /webservices/axis2/trunk/c: include/ modules/core/context/src/ modules/core/description/src/

Author: damitha
Date: Wed Dec 14 00:23:41 2005
New Revision: 356748

URL: http://svn.apache.org/viewcvs?rev=356748&view=rev
Log:
Integrating with context

Modified:
    webservices/axis2/trunk/c/include/axis2_conf_ctx.h
    webservices/axis2/trunk/c/include/axis2_error.h
    webservices/axis2/trunk/c/include/axis2_op.h
    webservices/axis2/trunk/c/include/axis2_op_ctx.h
    webservices/axis2/trunk/c/include/axis2_svc_ctx.h
    webservices/axis2/trunk/c/include/axis2_svc_grp_ctx.h
    webservices/axis2/trunk/c/modules/core/context/src/conf_ctx.c
    webservices/axis2/trunk/c/modules/core/description/src/Makefile.am
    webservices/axis2/trunk/c/modules/core/description/src/op.c

Modified: webservices/axis2/trunk/c/include/axis2_conf_ctx.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_conf_ctx.h?rev=356748&r1=356747&r2=356748&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_conf_ctx.h (original)
+++ webservices/axis2/trunk/c/include/axis2_conf_ctx.h Wed Dec 14 00:23:41 2005
@@ -78,14 +78,14 @@
     axis2_status_t (AXIS2_CALL *register_op_ctx)(struct axis2_conf_ctx *conf_ctx, 
                                                                     axis2_env_t **env,
                                                                     axis2_char_t *message_id,
-                                                                    axis2_op_ctx_t *op_ctx);
+                                                                    struct axis2_op_ctx *op_ctx);
     /**
      * get axis2_op_ctx struct given a Message ID
      *
      * @param message_id
      * @return struct axis2_op_ctx * <code>struct axis2_op_ctx *<code>
      */
-    axis2_op_ctx_t* (AXIS2_CALL *get_op_ctx)(struct axis2_conf_ctx *conf_ctx, 
+    struct axis2_op_ctx* (AXIS2_CALL *get_op_ctx)(struct axis2_conf_ctx *conf_ctx, 
                                                                             axis2_env_t **env,
                                                                             axis2_char_t *message_id);
     /**
@@ -97,14 +97,14 @@
     axis2_status_t (AXIS2_CALL *register_svc_ctx)(struct axis2_conf_ctx *conf_ctx, 
                                                                     axis2_env_t **env,
                                                                     axis2_char_t *svc_id,
-                                                                    axis2_svc_ctx_t *svc_ctx);
+                                                                    struct axis2_svc_ctx *svc_ctx);
     /**
      * get axis2_svc_ctx struct given a Message ID
      *
      * @param svc_id
      * @return struct axis2_svc_ctx * <code>struct axis2_svc_ctx *<code>
      */
-    axis2_svc_ctx_t* (AXIS2_CALL *get_svc_ctx)(struct axis2_conf_ctx *conf_ctx, 
+    struct axis2_svc_ctx* (AXIS2_CALL *get_svc_ctx)(struct axis2_conf_ctx *conf_ctx, 
                                                                             axis2_env_t **env,
                                                                             axis2_char_t *svc_id);
     /**
@@ -116,14 +116,14 @@
     axis2_status_t (AXIS2_CALL *register_svc_grp_ctx)(struct axis2_conf_ctx *conf_ctx, 
                                                                     axis2_env_t **env,
                                                                     axis2_char_t *svc_grp_id,
-                                                                    axis2_svc_grp_ctx_t *svc_grp_ctx);
+                                                                    struct axis2_svc_grp_ctx *svc_grp_ctx);
     /**
      * get axis2_svc_grp_ctx struct given a service group ID
      *
      * @param svc_grp_id
      * @return struct axis2_svc_grp_ctx * <code>struct axis2_svc_grp_ctx *<code>
      */
-    axis2_svc_grp_ctx_t* (AXIS2_CALL *get_svc_grp_ctx)(struct axis2_conf_ctx *conf_ctx, 
+    struct axis2_svc_grp_ctx* (AXIS2_CALL *get_svc_grp_ctx)(struct axis2_conf_ctx *conf_ctx, 
                                                                             axis2_env_t **env,
                                                                             axis2_char_t *svc_grp_id);
     /**
@@ -157,7 +157,7 @@
      *
      * @param messageContext
      */
-    axis2_svc_grp_ctx_t* (AXIS2_CALL *fill_ctxs)(struct axis2_conf_ctx *conf_ctx, 
+    struct axis2_svc_grp_ctx* (AXIS2_CALL *fill_ctxs)(struct axis2_conf_ctx *conf_ctx, 
                                                    axis2_env_t **env,
                                                    axis2_msg_ctx_t *msg_ctx);
 };

Modified: webservices/axis2/trunk/c/include/axis2_error.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_error.h?rev=356748&r1=356747&r2=356748&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_error.h (original)
+++ webservices/axis2/trunk/c/include/axis2_error.h Wed Dec 14 00:23:41 2005
@@ -262,7 +262,9 @@
         /** fault to field not specified in message context */
         AXIS2_ERROR_NOWHERE_TO_SEND_FAULT,
         /* Invalid status line or invalid request line */
-        AXIS2_ERROR_INVALID_HTTP_INVALID_HEADER_START_LINE 
+        AXIS2_ERROR_INVALID_HTTP_INVALID_HEADER_START_LINE,
+        /* Cannot correlate message*/
+        AXIS2_ERROR_CANNOT_CORRELATE_MSG
         
     };
 

Modified: webservices/axis2/trunk/c/include/axis2_op.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_op.h?rev=356748&r1=356747&r2=356748&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_op.h (original)
+++ webservices/axis2/trunk/c/include/axis2_op.h Wed Dec 14 00:23:41 2005
@@ -32,7 +32,11 @@
 #include <axis2_wsdl_msg_ref.h>
 #include <axis2_description.h>
 #include <axis2_phase_meta.h>
-
+#include <axis2_relates_to.h>
+#include <axis2_msg_ctx.h>
+#include <axis2_op_ctx.h>
+#include <axis2_svc_ctx.h>
+#include <axis2_conf_ctx.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -52,7 +56,12 @@
 struct axis2_op;
 struct axis2_wsdl_feature;
 struct axis2_wsdl_property; 
-struct axis2_wsdl_fault_ref;    
+struct axis2_wsdl_fault_ref;  
+struct axis2_relates_to;
+struct axis2_op_ctx;
+struct axis2_svc_ctx;    
+struct axis2_msg_ctx; 
+struct axis2_conf_ctx;    
 typedef struct axis2_op_ops axis2_op_ops_t;    
 typedef struct axis2_op axis2_op_t;    
     
@@ -123,7 +132,7 @@
 	axis2_status_t (AXIS2_CALL *
     set_msg_exchange_pattern) (axis2_op_t *op, 
                                 axis2_env_t **env,
-                                const axis2_char_t *pattern);
+                                axis2_char_t *pattern);
 
 	axis2_char_t *(AXIS2_CALL *
     get_msg_exchange_pattern) (axis2_op_t *op, 
@@ -321,7 +330,51 @@
     axis2_status_t (AXIS2_CALL * 
     set_wsdl_op) (axis2_op_t *op,
                                     axis2_env_t **env,
-                                    struct axis2_wsdl_op *wsdl_op);                                           
+                                    struct axis2_wsdl_op *wsdl_op);
+
+    /**
+     * This method is responsible for finding a MEPContext for an incomming
+     * messages. An incomming message can be of two states.
+     * <p/>
+     * 1)This is a new incomming message of a given MEP. 2)This message is a
+     * part of an MEP which has already begun.
+     * <p/>
+     * The method is special cased for the two MEPs
+     * <p/>
+     * #IN_ONLY #IN_OUT
+     * <p/>
+     * for two reasons. First reason is the wide usage and the second being that
+     * the need for the MEPContext to be saved for further incomming messages.
+     * <p/>
+     * In the event that MEP of this op is different from the two MEPs
+     * deafulted above the decession of creating a new or this message relates
+     * to a MEP which already in business is decided by looking at the WSA
+     * Relates TO of the incomming message.
+     *
+     * @param msgContext
+     */
+    struct axis2_op_ctx *(AXIS2_CALL *
+    find_op_ctx) (axis2_op_t *op,
+                            axis2_env_t **env,
+                            struct axis2_msg_ctx *msg_ctx, 
+                            struct axis2_svc_ctx *svc_ctx);
+
+    /**
+     * This will not create a new op context if there is no one already.
+     * @param msgContext
+     * @return
+     * @throws AxisFault
+     */
+    struct axis2_op_ctx *(AXIS2_CALL *
+    find_for_existing_op_ctx) (axis2_op_t *op,
+                                        axis2_env_t **env,
+                                        struct axis2_msg_ctx *msg_ctx);
+                                            
+    axis2_status_t (AXIS2_CALL *
+    register_op_ctx) (axis2_op_t *op,
+                                axis2_env_t **env,
+                                struct axis2_msg_ctx *msg_ctx,
+                                struct axis2_op_ctx *op_ctx);                                    
 };
 
 /** 
@@ -504,6 +557,17 @@
 
 #define AXIS2_OP_SET_WSDL_OP(op, env, wsdl_op) \
 		((op->ops)->set_wsdl_op (op, env, wsdl_op))
+  
+
+#define AXIS2_OP_FIND_OP_CTX(op, env, wsdl_op) \
+		((op->ops)->find_op_ctx (op, env, wsdl_op))
+        
+#define AXIS2_OP_FIND_FOR_EXISTING_OP_CTX(op, env, wsdl_op) \
+		((op->ops)->find_for_existing_op_ctx (op, env, wsdl_op))
+
+#define AXIS2_OP_REGISTER_OP_CTX(op, env, wsdl_op) \
+		((op->ops)->register_op_ctx (op, env, wsdl_op))
+   
 
 /************************** End of function macros ****************************/
 

Modified: webservices/axis2/trunk/c/include/axis2_op_ctx.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_op_ctx.h?rev=356748&r1=356747&r2=356748&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_op_ctx.h (original)
+++ webservices/axis2/trunk/c/include/axis2_op_ctx.h Wed Dec 14 00:23:41 2005
@@ -75,7 +75,7 @@
     /**
      * @return Returns the op.
      */
-    axis2_op_t* (AXIS2_CALL *get_op)(struct axis2_op_ctx *op_ctx, axis2_env_t **env);
+    struct axis2_op* (AXIS2_CALL *get_op)(struct axis2_op_ctx *op_ctx, axis2_env_t **env);
     
     /**
      * Return the struct axis2_svc_ctx * in which this op_ctx lives.
@@ -145,7 +145,7 @@
 };
 
 axis2_op_ctx_t* AXIS2_CALL axis2_op_ctx_create(axis2_env_t **env, 
-    axis2_op_t *op,
+    struct axis2_op *op,
     struct axis2_svc_ctx * svc_ctx);
     
 /************************** Start of function macros **************************/

Modified: webservices/axis2/trunk/c/include/axis2_svc_ctx.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_svc_ctx.h?rev=356748&r1=356747&r2=356748&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_svc_ctx.h (original)
+++ webservices/axis2/trunk/c/include/axis2_svc_ctx.h Wed Dec 14 00:23:41 2005
@@ -58,17 +58,17 @@
      */
     axis2_status_t (AXIS2_CALL *init)(struct axis2_svc_ctx *svc_ctx, 
                                                 axis2_env_t **env,
-                                                axis2_conf_t *conf);
+                                                struct axis2_conf *conf);
     /**
      * @return Returns the svc_id.
      */
     axis2_char_t* (AXIS2_CALL *get_svc_id)(struct axis2_svc_ctx *svc_ctx, 
                                                 axis2_env_t **env);
-    axis2_svc_t* (AXIS2_CALL *get_svc)(struct axis2_svc_ctx *svc_ctx, 
+    struct axis2_svc* (AXIS2_CALL *get_svc)(struct axis2_svc_ctx *svc_ctx, 
                                                 axis2_env_t **env);
     struct axis2_conf_ctx* (AXIS2_CALL *get_conf_ctx)(struct axis2_svc_ctx *svc_ctx, 
                                                 axis2_env_t **env);
-    axis2_op_ctx_t* (AXIS2_CALL *create_op_ctx)(struct axis2_svc_ctx *svc_ctx, 
+    struct axis2_op_ctx* (AXIS2_CALL *create_op_ctx)(struct axis2_svc_ctx *svc_ctx, 
                                                 axis2_env_t **env, axis2_qname_t *qname);
 };
 
@@ -82,7 +82,7 @@
 };
 
 AXIS2_DECLARE(axis2_svc_ctx_t*) axis2_svc_ctx_create(axis2_env_t **env, 
-    axis2_svc_t *svc,
+    struct axis2_svc *svc,
     struct axis2_svc_grp_ctx *svc_grp_ctx);
     
 /************************** Start of function macros **************************/

Modified: webservices/axis2/trunk/c/include/axis2_svc_grp_ctx.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_svc_grp_ctx.h?rev=356748&r1=356747&r2=356748&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_svc_grp_ctx.h (original)
+++ webservices/axis2/trunk/c/include/axis2_svc_grp_ctx.h Wed Dec 14 00:23:41 2005
@@ -60,13 +60,13 @@
      */
     axis2_status_t (AXIS2_CALL *init)(struct axis2_svc_grp_ctx *svc_grp_ctx, 
                                         axis2_env_t **env,
-                                        axis2_conf_t *conf);
+                                        struct axis2_conf *conf);
     axis2_char_t* (AXIS2_CALL *get_id)(struct axis2_svc_grp_ctx *svc_grp_ctx, 
                             axis2_env_t **env);
     axis2_status_t (AXIS2_CALL *set_id)(struct axis2_svc_grp_ctx *svc_grp_ctx, 
                             axis2_env_t **env, axis2_char_t *id);
     /** if the servic name is foo:bar , you should pass only bar */
-    axis2_svc_ctx_t* (AXIS2_CALL *get_svc_ctx)(struct axis2_svc_grp_ctx *svc_grp_ctx, 
+    struct axis2_svc_ctx* (AXIS2_CALL *get_svc_ctx)(struct axis2_svc_grp_ctx *svc_grp_ctx, 
                             axis2_env_t **env,
                             axis2_char_t *svc_name);
     /**

Modified: webservices/axis2/trunk/c/modules/core/context/src/conf_ctx.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/context/src/conf_ctx.c?rev=356748&r1=356747&r2=356748&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/src/conf_ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/src/conf_ctx.c Wed Dec 14 00:23:41 2005
@@ -453,8 +453,8 @@
 {
     axis2_conf_ctx_impl_t *conf_ctx_impl = NULL;
     axis2_char_t *svc_grp_ctx_id = NULL;
-    axis2_svc_grp_ctx_t *svc_grp_ctx;
-    axis2_svc_ctx_t *svc_ctx;
+    axis2_svc_grp_ctx_t *svc_grp_ctx = NULL;
+    axis2_svc_ctx_t *svc_ctx = NULL;
     axis2_svc_t *svc = NULL;
     axis2_qname_t *qname = NULL;
     axis2_char_t *svc_id = NULL;

Modified: webservices/axis2/trunk/c/modules/core/description/src/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/src/Makefile.am?rev=356748&r1=356747&r2=356748&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/src/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/core/description/src/Makefile.am Wed Dec 14 00:23:41 2005
@@ -20,4 +20,5 @@
             -I$(top_builddir)/modules/util/src \
             -I$(top_builddir)/modules/wsdl/src \
             -I$(top_builddir)/modules/core/transport \
-            -I$(top_builddir)/modules/core/description
+            -I$(top_builddir)/modules/core/description \
+            -I$(top_builddir)/modules/core/addr

Modified: webservices/axis2/trunk/c/modules/core/description/src/op.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/src/op.c?rev=356748&r1=356747&r2=356748&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/src/op.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/src/op.c Wed Dec 14 00:23:41 2005
@@ -94,7 +94,7 @@
 axis2_status_t AXIS2_CALL
 axis2_op_set_msg_exchange_pattern (axis2_op_t *op, 
                                             axis2_env_t **env,
-                                            const axis2_char_t *pattern);
+                                            axis2_char_t *pattern);
 		
 axis2_char_t * AXIS2_CALL
 axis2_op_get_msg_exchange_pattern (axis2_op_t *op, 
@@ -259,6 +259,50 @@
                                 axis2_env_t **env,
                                 axis2_wsdl_op_t *wsdl_op);
 
+/**
+ * This method is responsible for finding a MEPContext for an incomming
+ * messages. An incomming message can be of two states.
+ * <p/>
+ * 1)This is a new incomming message of a given MEP. 2)This message is a
+ * part of an MEP which has already begun.
+ * <p/>
+ * The method is special cased for the two MEPs
+ * <p/>
+ * #IN_ONLY #IN_OUT
+ * <p/>
+ * for two reasons. First reason is the wide usage and the second being that
+ * the need for the MEPContext to be saved for further incomming messages.
+ * <p/>
+ * In the event that MEP of this op is different from the two MEPs
+ * deafulted above the decession of creating a new or this message relates
+ * to a MEP which already in business is decided by looking at the WSA
+ * Relates TO of the incomming message.
+ *
+ * @param msgContext
+ */
+struct axis2_op_ctx *AXIS2_CALL
+axis2_op_find_op_ctx(axis2_op_t *op,
+                        axis2_env_t **env,
+                        struct axis2_msg_ctx *msg_ctx, 
+                        struct axis2_svc_ctx *svc_ctx);
+
+/**
+ * This will not create a new op context if there is no one already.
+ * @param msgContext
+ * @return
+ * @throws AxisFault
+ */
+axis2_op_ctx_t *AXIS2_CALL
+axis2_op_find_for_existing_op_ctx(axis2_op_t *op,
+                                    axis2_env_t **env,
+                                    struct axis2_msg_ctx *msg_ctx);
+                                        
+axis2_status_t AXIS2_CALL
+axis2_op_register_op_ctx(axis2_op_t *op,
+                            axis2_env_t **env,
+                            struct axis2_msg_ctx *msg_ctx,
+                            struct axis2_op_ctx *op_ctx);
+                                
 /************************* End of function headers ****************************/	
 
 axis2_op_t * AXIS2_CALL
@@ -418,7 +462,10 @@
     op_impl->op.ops->add_property = axis2_op_add_property;
     op_impl->op.ops->get_Properties = axis2_op_get_Properties;
     op_impl->op.ops->set_wsdl_op = axis2_op_set_wsdl_op;
-						
+	op_impl->op.ops->find_op_ctx = axis2_op_find_op_ctx;	
+    op_impl->op.ops->find_for_existing_op_ctx = axis2_op_find_for_existing_op_ctx;
+    op_impl->op.ops->register_op_ctx = axis2_op_register_op_ctx;
+    
 	return &(op_impl->op);
 }
 
@@ -803,13 +850,12 @@
 axis2_status_t AXIS2_CALL 
 axis2_op_set_msg_exchange_pattern (axis2_op_t *op, 
                                             axis2_env_t **env,
-		                                    const axis2_char_t *pattern)
+		                                    axis2_char_t *pattern)
 {
     AXIS2_FUNC_PARAM_CHECK(op, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, pattern, AXIS2_FAILURE);
     
-    return AXIS2_WSDL_OP_SET_MSG_EXCHANGE_PATTERN(op->
-        wsdl_op, env, pattern);
+    return AXIS2_WSDL_OP_SET_MSG_EXCHANGE_PATTERN(op->wsdl_op, env, pattern);
 }
 
 axis2_char_t * AXIS2_CALL
@@ -1402,99 +1448,142 @@
     return AXIS2_SUCCESS;
 }
 
-/**
- * This method is responsible for finding a MEPContext for an incomming
- * messages. An incomming message can be of two states.
- * <p/>
- * 1)This is a new incomming message of a given MEP. 2)This message is a
- * part of an MEP which has already begun.
- * <p/>
- * The method is special cased for the two MEPs
- * <p/>
- * #IN_ONLY #IN_OUT
- * <p/>
- * for two reasons. First reason is the wide usage and the second being that
- * the need for the MEPContext to be saved for further incomming messages.
- * <p/>
- * In the event that MEP of this op is different from the two MEPs
- * deafulted above the decession of creating a new or this message relates
- * to a MEP which already in business is decided by looking at the WSA
- * Relates TO of the incomming message.
- *
- * @param msgContext
- */
-/*OperationContext findOperationContext(MessageContext msgContext, ServiceContext serviceContext) throws AxisFault {
-    OperationContext opContext ;
+struct axis2_op_ctx *AXIS2_CALL
+axis2_op_find_op_ctx(axis2_op_t *op,
+                        axis2_env_t **env,
+                        struct axis2_msg_ctx *msg_ctx, 
+                        struct axis2_svc_ctx *svc_ctx)
+{
+    axis2_op_impl_t *op_impl = NULL;
+    struct axis2_op_ctx *op_ctx = NULL;
+    struct axis2_relates_to *relates_to = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+        
+    AXIS2_FUNC_PARAM_CHECK(op, env, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, msg_ctx, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, svc_ctx, NULL);
 
-    if (null == msgContext.get_RelatesTo()) {
-        //Its a new incomming message so get_ the factory to create a new
-        // one
-       opContext =  new OperationContext(this,serviceContext);
-    } else {
-        // So this message is part of an ongoing MEP
-        //			opContext =
-        ConfigurationContext configContext = msgContext.get_SystemContext();
-        opContext =
-                configContext.get_OperationContext( msgContext.get_RelatesTo().get_Value());
-
-        if (null == opContext) {
-            throw new AxisFault(Messages.get_Message("cannotCorrelateMsg",
-                    this.get_Name().toString(),msgContext.get_RelatesTo().get_Value()));
+    op_impl = AXIS2_INTF_TO_IMPL(op);
+    relates_to = AXIS2_MSG_CTX_GET_RELATES_TO(msg_ctx, env);
+    if(NULL == relates_to)
+    {
+        /* Its a new incomming message so get_ the factory to create a new
+            one */
+        op_ctx = axis2_op_ctx_create(env, op, svc_ctx);
+        if(!op_ctx)
+        {
+            AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+            return NULL;
         }
-
     }
+    else
+    {
+        struct axis2_conf_ctx *conf_ctx = NULL;
+        axis2_char_t *value = NULL;
+            
+        /* So this message is part of an ongoing MEP
+        			opContext = */
+        conf_ctx = AXIS2_MSG_CTX_GET_CONF_CTX(msg_ctx, env);
+        value = AXIS2_RELATES_TO_GET_VALUE(relates_to, env);
+        op_ctx = AXIS2_CONF_CTX_GET_OP_CTX(conf_ctx, env, value);
+        if(NULL == op_ctx)
+        {
+            AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_CANNOT_CORRELATE_MSG, NULL);
+            return NULL;
+        }
+    }
+    
+    status = axis2_op_register_op_ctx(op, env, msg_ctx, op_ctx);
+    if(AXIS2_FAILURE == status)
+    {
+        AXIS2_OP_CTX_FREE(op_ctx, env);
+        return NULL;
+    }
+    else
+        return op_ctx;
+}
 
-    registerOperationContext(msgContext, opContext);
-
-    return opContext;
+axis2_op_ctx_t *AXIS2_CALL
+axis2_op_find_for_existing_op_ctx(axis2_op_t *op,
+                                    axis2_env_t **env,
+                                    struct axis2_msg_ctx *msg_ctx)
+{
+    struct axis2_op_ctx *op_ctx = NULL;
+    struct axis2_relates_to *relates_to = NULL;
+    
+    AXIS2_FUNC_PARAM_CHECK(op, env, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, msg_ctx, NULL);
+    
+    op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(msg_ctx, env);
+    if(NULL != op_ctx) 
+    {
+        return op_ctx;
+    }
 
-}
-*/
+    relates_to = AXIS2_MSG_CTX_GET_RELATES_TO(msg_ctx, env);
+    if (NULL == relates_to) 
+    {
+        return NULL;
+    } 
+    else 
+    {
+        struct axis2_conf_ctx *conf_ctx = NULL;
+        axis2_char_t *value = NULL;
+        /* So this message is part of an ongoing MEP
+        			opContext = */
+        conf_ctx = AXIS2_MSG_CTX_GET_CONF_CTX(msg_ctx, env);
+        op_ctx = AXIS2_CONF_CTX_GET_OP_CTX(conf_ctx, env, value);
 
-/**
- * This will not create a new op context if there is no one already.
- * @param msgContext
- * @return
- * @throws AxisFault
- */
-/*axis2_op_ctx_t *AXIS2_CALL
-OperationContext 
-findForExistingOperationContext(MessageContext msgContext) throws AxisFault {
-    OperationContext opContext = null;
-
-    if((opContext = msgContext.get_OperationContext()) != null) {
-        return opContext;
-    }
-
-    if (null == msgContext.get_RelatesTo()) {
-        return null;
-    } else {
-        // So this message is part of an ongoing MEP
-        //			opContext =
-        ConfigurationContext configContext = msgContext.get_SystemContext();
-        opContext = configContext.get_OperationContext(msgContext.get_RelatesTo().get_Value());
-
-        if (null == opContext) {
-            throw new AxisFault(Messages.get_Message("cannotCorrealteMsg",
-                    this.get_Name().toString(),msgContext.get_RelatesTo().get_Value()));
+        if (NULL == op_ctx) 
+        {
+            AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_CANNOT_CORRELATE_MSG, NULL);
+            return NULL;
         }
-
     }
 
-
-    return opContext;
+    return op_ctx;
 
 }
-*/
-/*
+
 axis2_status_t AXIS2_CALL
-registerOperationContext(MessageContext msgContext, OperationContext opContext) throws AxisFault {
-    msgContext.get_SystemContext().registerOperationContext(
-            msgContext.get_MessageID(), opContext);
-    opContext.addMessageContext(msgContext);
-    msgContext.setOperationContext(opContext);
-    if (opContext.isComplete()) {
-        opContext.cleanup();
+axis2_op_register_op_ctx(axis2_op_t *op,
+                            axis2_env_t **env,
+                            struct axis2_msg_ctx *msg_ctx,
+                            struct axis2_op_ctx *op_ctx)
+{
+    struct axis2_conf_ctx *conf_ctx = NULL;
+    axis2_char_t *msg_id = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+    
+    AXIS2_FUNC_PARAM_CHECK(op, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, msg_ctx, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, op_ctx, AXIS2_FAILURE);
+    
+    conf_ctx = AXIS2_MSG_CTX_GET_CONF_CTX(msg_ctx, env);
+    if(!conf_ctx)
+    {
+        return AXIS2_FAILURE;
+    }
+    msg_id = AXIS2_MSG_CTX_GET_MSG_ID(msg_ctx, env);
+    if(!msg_id)
+    {
+        return AXIS2_FAILURE;
     }
+    status = AXIS2_CONF_CTX_REGISTER_OP_CTX(conf_ctx, env, msg_id, op_ctx);
+    if(AXIS2_FAILURE == status)
+    {
+        return AXIS2_FAILURE;
+    }
+    status = AXIS2_MSG_CTX_SET_OP_CTX(msg_ctx, env, op_ctx);
+    if(AXIS2_FAILURE == status)
+    {
+        axis2_hash_t *op_ctx_map = NULL;
+        op_ctx_map = (axis2_hash_t *) AXIS2_CONF_CTX_GET_OP_CTX_MAP(conf_ctx, env);
+        axis2_hash_set(op_ctx_map, msg_id, AXIS2_HASH_KEY_STRING, NULL); 
+    }
+    if(AXIS2_TRUE == AXIS2_OP_CTX_GET_IS_COMPLETE(op_ctx, env))
+    {
+        AXIS2_OP_CTX_CLEANUP(op_ctx, env);
+    }
+    return AXIS2_SUCCESS;
 }
-*/