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 2006/01/11 04:49:42 UTC

svn commit: r367904 - in /webservices/axis2/trunk/c/modules/core/util: ./ Makefile.am core_utils.c

Author: damitha
Date: Tue Jan 10 19:49:36 2006
New Revision: 367904

URL: http://svn.apache.org/viewcvs?rev=367904&view=rev
Log:
added new folder

Added:
    webservices/axis2/trunk/c/modules/core/util/
    webservices/axis2/trunk/c/modules/core/util/Makefile.am
    webservices/axis2/trunk/c/modules/core/util/core_utils.c

Added: webservices/axis2/trunk/c/modules/core/util/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/util/Makefile.am?rev=367904&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/core/util/Makefile.am (added)
+++ webservices/axis2/trunk/c/modules/core/util/Makefile.am Tue Jan 10 19:49:36 2006
@@ -0,0 +1,11 @@
+lib_LTLIBRARIES = libaxis2_core_util.la
+AM_CPPFLAGS = $(CPPFLAGS)
+libaxis2_core_util_la_SOURCES = core_utils.c
+
+libaxis2_core_util_la_LIBADD = 
+INCLUDES = -I$(top_builddir)/include \
+            -I$(top_builddir)/modules/util \
+            -I$(top_builddir)/modules/core/transport \
+            -I$(top_builddir)/modules/core/description \
+            -I$(top_builddir)/modules/wsdl \
+            -I$(top_builddir)/modules/platforms

Added: webservices/axis2/trunk/c/modules/core/util/core_utils.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/util/core_utils.c?rev=367904&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/core/util/core_utils.c (added)
+++ webservices/axis2/trunk/c/modules/core/util/core_utils.c Tue Jan 10 19:49:36 2006
@@ -0,0 +1,131 @@
+/*
+ * 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_core_utils.h>
+#include <axis2_string.h>
+#include <axis2_conf.h>
+#include <axis2_relates_to.h>
+#include <axis2_addr.h>
+#include <axis2_http_transport.h>
+
+axis2_msg_ctx_t *AXIS2_CALL
+axis2_core_utils_create_out_msg_ctx(axis2_env_t **env,
+                                axis2_msg_ctx_t *in_msg_ctx)
+{
+    axis2_msg_ctx_t *new_msg_ctx = NULL;
+    axis2_conf_ctx_t *conf_ctx = NULL;
+    axis2_transport_in_desc_t *transport_in = NULL;
+    axis2_transport_out_desc_t *transport_out = NULL;
+    axis2_msg_info_headers_t *old_msg_info_headers = NULL;
+    axis2_msg_info_headers_t *msg_info_headers = NULL;
+    axis2_endpoint_ref_t *reply_to = NULL;
+    axis2_endpoint_ref_t *fault_to = NULL;
+    axis2_endpoint_ref_t *to = NULL;
+    axis2_char_t *msg_id = NULL;
+    axis2_relates_to_t *relates_to = NULL;
+    axis2_char_t *action = NULL;
+    axis2_op_ctx_t *op_ctx = NULL;
+    axis2_svc_ctx_t *svc_ctx = NULL;
+    void *trt_property = NULL;
+    void *trt_out_info_property = NULL;
+    void *char_set_encoding_property = NULL;
+    axis2_bool_t doing_rest = AXIS2_FALSE;
+    axis2_bool_t doing_mtom = AXIS2_FALSE;
+    axis2_bool_t server_side = AXIS2_FALSE;
+    axis2_svc_grp_ctx_t *svc_grp_ctx = NULL;
+    
+    AXIS2_PARAM_CHECK((*env)->error, in_msg_ctx, NULL);
+    
+    conf_ctx = AXIS2_MSG_CTX_GET_CONF_CTX(in_msg_ctx, env);
+    transport_in = AXIS2_MSG_CTX_GET_TRANSPORT_IN_DESC(in_msg_ctx, env);
+    transport_out = AXIS2_MSG_CTX_GET_TRANSPORT_OUT_DESC(in_msg_ctx, env);
+    
+    new_msg_ctx = axis2_msg_ctx_create(env, conf_ctx, transport_in, transport_out);
+    if(!new_msg_ctx)
+    {
+        return NULL;
+    }
+    old_msg_info_headers = AXIS2_MSG_CTX_GET_MSG_INFO_HEADERS(in_msg_ctx, env);
+    if(!old_msg_info_headers)
+    {
+        return NULL;
+    }
+    msg_info_headers = axis2_msg_info_headers_create(env, NULL, NULL);
+    if(!msg_info_headers)
+    {
+        return NULL;
+    }
+    /* TODO UUID is hard coded until it is generated */
+    AXIS2_MSG_INFO_HEADERS_SET_MESSAGE_ID(msg_info_headers, env, "UUID");
+    /*messageInformationHeaders.setMessageId(UUIDGenerator.getUUID());*/
+    reply_to = AXIS2_MSG_INFO_HEADERS_GET_REPLY_TO(old_msg_info_headers, env);
+    AXIS2_MSG_INFO_HEADERS_SET_TO(msg_info_headers, env, reply_to);
+    
+    fault_to = AXIS2_MSG_INFO_HEADERS_GET_FAULT_TO(old_msg_info_headers, env);
+    AXIS2_MSG_INFO_HEADERS_SET_FAULT_TO(msg_info_headers, env, fault_to);
+    
+    to = AXIS2_MSG_INFO_HEADERS_GET_TO(old_msg_info_headers, env);
+    AXIS2_MSG_INFO_HEADERS_SET_FROM(msg_info_headers, env, to);
+    
+    msg_id = AXIS2_MSG_INFO_HEADERS_GET_MESSAGE_ID(old_msg_info_headers, env);
+    relates_to = axis2_relates_to_create(env, msg_id, 
+        AXIS2_WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE);
+    AXIS2_MSG_INFO_HEADERS_SET_RELATES_TO(msg_info_headers, env, relates_to);
+    
+    action = AXIS2_MSG_INFO_HEADERS_GET_ACTION(old_msg_info_headers, env);
+    AXIS2_MSG_INFO_HEADERS_SET_ACTION(msg_info_headers, env, action);
+    AXIS2_MSG_CTX_SET_MSG_INFO_HEADERS(new_msg_ctx, env, msg_info_headers);
+    
+    op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(in_msg_ctx, env);
+    AXIS2_MSG_CTX_SET_OP_CTX(new_msg_ctx, env, op_ctx);
+    
+    svc_ctx = AXIS2_MSG_CTX_GET_SVC_CTX(in_msg_ctx, env);
+    AXIS2_MSG_CTX_SET_SVC_CTX(new_msg_ctx, env, svc_ctx);
+    
+    trt_property = AXIS2_MSG_CTX_GET_PROPERTY(in_msg_ctx, env, 
+            AXIS2_TRANSPORT_OUT, AXIS2_FALSE);
+            
+    AXIS2_MSG_CTX_SET_PROPERTY(new_msg_ctx, env, AXIS2_TRANSPORT_OUT, trt_property,
+        AXIS2_FALSE);
+    
+    trt_out_info_property = AXIS2_MSG_CTX_GET_PROPERTY(in_msg_ctx, env, 
+            AXIS2_HTTP_OUT_TRANSPORT_INFO, AXIS2_FALSE);
+            
+    AXIS2_MSG_CTX_SET_PROPERTY(new_msg_ctx, env, AXIS2_HTTP_OUT_TRANSPORT_INFO, 
+            trt_out_info_property, AXIS2_FALSE);
+
+    /* Setting the charater set encoding */
+    
+    char_set_encoding_property = AXIS2_MSG_CTX_GET_PROPERTY(in_msg_ctx, env, 
+            AXIS2_CHARACTER_SET_ENCODING, AXIS2_FALSE);         
+    AXIS2_MSG_CTX_SET_PROPERTY(new_msg_ctx, env, AXIS2_CHARACTER_SET_ENCODING, 
+            char_set_encoding_property, AXIS2_FALSE);
+            
+    doing_rest = AXIS2_MSG_CTX_GET_DOING_REST(in_msg_ctx, env);
+    AXIS2_MSG_CTX_SET_DOING_REST(new_msg_ctx, env, doing_rest);
+    
+    doing_mtom = AXIS2_MSG_CTX_GET_DOING_MTOM(in_msg_ctx, env);
+    AXIS2_MSG_CTX_SET_DOING_MTOM(new_msg_ctx, env, doing_mtom);
+    
+    server_side = AXIS2_MSG_CTX_GET_SERVER_SIDE(in_msg_ctx, env);
+    AXIS2_MSG_CTX_SET_SERVER_SIDE(new_msg_ctx, env, server_side);
+    
+    svc_grp_ctx = AXIS2_MSG_CTX_GET_SVC_GRP_CTX(new_msg_ctx, env);
+    AXIS2_MSG_CTX_SET_SVC_GRP_CTX(new_msg_ctx, env, svc_grp_ctx);
+    
+    return new_msg_ctx;
+}
+