You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ma...@apache.org on 2008/12/10 09:58:02 UTC

svn commit: r725030 - in /webservices/axis2/trunk/c/src/core/transport/http/common: http_simple_response.c http_worker.c simple_http_svr_conn.c

Author: manjula
Date: Wed Dec 10 00:58:01 2008
New Revision: 725030

URL: http://svn.apache.org/viewvc?rev=725030&view=rev
Log:
Fixing Axis2C-1302

Modified:
    webservices/axis2/trunk/c/src/core/transport/http/common/http_simple_response.c
    webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c
    webservices/axis2/trunk/c/src/core/transport/http/common/simple_http_svr_conn.c

Modified: webservices/axis2/trunk/c/src/core/transport/http/common/http_simple_response.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/common/http_simple_response.c?rev=725030&r1=725029&r2=725030&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/common/http_simple_response.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/common/http_simple_response.c Wed Dec 10 00:58:01 2008
@@ -30,6 +30,7 @@
     axutil_array_list_t *header_group;
     axutil_stream_t *stream;
     axutil_array_list_t *mime_parts;
+    axis2_char_t *mtom_sending_callback_name;
 };
 
 
@@ -97,6 +98,7 @@
     simple_response->header_group = NULL;
     simple_response->stream = NULL;
     simple_response->mime_parts = NULL;
+    simple_response->mtom_sending_callback_name = NULL;
 
     return simple_response;
 }
@@ -660,3 +662,20 @@
 
 }
 
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+axis2_http_simple_response_get_mtom_sending_callback_name(
+    axis2_http_simple_response_t * simple_response,
+    const axutil_env_t * env)
+{
+    return simple_response->mtom_sending_callback_name;
+}
+
+void AXIS2_EXTERN AXIS2_CALL
+axis2_http_simple_response_set_mtom_sending_callback_name(
+    axis2_http_simple_response_t * simple_response,
+    const axutil_env_t * env,
+    axis2_char_t *mtom_sending_callback_name)
+{
+    simple_response->mtom_sending_callback_name = 
+        mtom_sending_callback_name;
+}

Modified: webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c?rev=725030&r1=725029&r2=725030&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c Wed Dec 10 00:58:01 2008
@@ -1925,7 +1925,25 @@
 
                     if(mime_parts)
                     {
-                        axis2_http_header_t *transfer_enc_header = NULL;                        
+                        axis2_http_header_t *transfer_enc_header = NULL;   
+                        axutil_param_t *callback_name_param = NULL;
+                        axis2_char_t *mtom_sending_callback_name = NULL;
+
+                        /* Getting the sender callback name paramter if it is 
+                         * specified in the configuration file */
+
+                        callback_name_param = axis2_msg_ctx_get_parameter(out_msg_ctx, env ,
+                            AXIS2_MTOM_SENDING_CALLBACK);
+                        if(callback_name_param)
+                        {
+                            mtom_sending_callback_name =
+                                (axis2_char_t *) axutil_param_get_value (callback_name_param, env);
+                            if(mtom_sending_callback_name)
+                            {
+                                axis2_http_simple_response_set_mtom_sending_callback_name(
+                                    response, env, mtom_sending_callback_name);
+                            }
+                        }
 
                         axis2_http_simple_response_set_mime_parts(response, env, mime_parts);  
 

Modified: webservices/axis2/trunk/c/src/core/transport/http/common/simple_http_svr_conn.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/common/simple_http_svr_conn.c?rev=725030&r1=725029&r2=725030&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/common/simple_http_svr_conn.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/common/simple_http_svr_conn.c Wed Dec 10 00:58:01 2008
@@ -415,16 +415,34 @@
         axutil_http_chunked_stream_t *chunked_stream = NULL;
         axis2_status_t write_stat = AXIS2_FAILURE;
         axutil_array_list_t *mime_parts = NULL;
+        axis2_char_t *mtom_sending_callback_name = NULL;
         
+        mime_parts = axis2_http_simple_response_get_mime_parts(response, env);
+
+        mtom_sending_callback_name = axis2_http_simple_response_get_mtom_sending_callback_name(
+            response, env);
+
+        /* If the callback name is not there, then we will check whether there 
+         * is any mime_parts which has type callback. If we found then no point 
+         * of continuing we should return a failure */
+
+        if(!mtom_sending_callback_name)
+        {
+            if(axis2_http_transport_utils_is_callback_required(
+                env, mime_parts))
+            {
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Sender callback not specified");
+                return AXIS2_FAILURE;
+            }
+        }
+
         chunked_stream = axutil_http_chunked_stream_create(env,
                                                           svr_conn->stream);
-        
-        mime_parts = axis2_http_simple_response_get_mime_parts(response, env);
 
         if(mime_parts)
         {            
             write_stat = axis2_http_transport_utils_send_mtom_message(
-                    chunked_stream, env, mime_parts);
+                    chunked_stream, env, mime_parts, mtom_sending_callback_name);
             axutil_http_chunked_stream_free(chunked_stream, env);
             chunked_stream = NULL;