axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manj...@apache.org
Subject svn commit: r743997 - in /webservices/axis2/trunk/c/axiom/src/soap: soap_body.c soap_builder.c
Date Fri, 13 Feb 2009 05:38:12 GMT
Author: manjula
Date: Fri Feb 13 05:38:12 2009
New Revision: 743997

URL: http://svn.apache.org/viewvc?rev=743997&view=rev
Log:
Changes to SOAP related stuff.

Modified:
    webservices/axis2/trunk/c/axiom/src/soap/soap_body.c
    webservices/axis2/trunk/c/axiom/src/soap/soap_builder.c

Modified: webservices/axis2/trunk/c/axiom/src/soap/soap_body.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/soap/soap_body.c?rev=743997&r1=743996&r2=743997&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/soap/soap_body.c (original)
+++ webservices/axis2/trunk/c/axiom/src/soap/soap_body.c Fri Feb 13 05:38:12 2009
@@ -529,3 +529,25 @@
     }
     return AXIS2_SUCCESS;
 }
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axiom_soap_body_process_attachments(
+    axiom_soap_body_t * soap_body,
+    const axutil_env_t * env,
+    void *user_pram,
+    axis2_char_t *callback_name)
+{
+    axis2_status_t status = AXIS2_FAILURE;
+
+    status = axiom_soap_builder_create_attachments(
+        soap_body->soap_builder, env, user_pram, callback_name);
+
+    if(status == AXIS2_FAILURE)
+    {
+        return status;                 
+    }    
+    else
+    {
+        return axiom_soap_body_build(soap_body, env);                        
+    }
+}

Modified: webservices/axis2/trunk/c/axiom/src/soap/soap_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/soap/soap_builder.c?rev=743997&r1=743996&r2=743997&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/soap/soap_builder.c (original)
+++ webservices/axis2/trunk/c/axiom/src/soap/soap_builder.c Fri Feb 13 05:38:12 2009
@@ -26,6 +26,7 @@
 #include "_axiom_soap_header_block.h"
 #include <axiom_stax_builder_internal.h>
 #include "_axiom_soap_fault.h"
+#include <axutil_http_chunked_stream.h>
 
 axis2_status_t axiom_soap_builder_create_om_element(
     axiom_soap_builder_t * soap_builder,
@@ -89,6 +90,12 @@
 
     axutil_hash_t *mime_body_parts;
 
+    axiom_mime_parser_t *mime_parser;
+
+    AXIS2_READ_INPUT_CALLBACK callback;
+
+    void *callback_ctx;
+
 };
 
 typedef enum axis2_builder_last_node_states
@@ -136,6 +143,9 @@
     soap_builder->soap_envelope = NULL;
     soap_builder->mime_body_parts = NULL;
     soap_builder->om_builder = stax_builder;
+    soap_builder->mime_parser = NULL;
+    soap_builder->callback = NULL;
+    soap_builder->callback_ctx = NULL;
 
     status =
         axiom_soap_builder_identify_soap_version(soap_builder, env,
@@ -212,6 +222,31 @@
         soap_builder->mime_body_parts = NULL;
     }
 
+    if(soap_builder->mime_parser)
+    {
+        axiom_mime_parser_free(soap_builder->mime_parser, env);
+        soap_builder->mime_parser = NULL;
+    }        
+
+    if(soap_builder->callback_ctx)
+    {
+        axis2_callback_info_t *callback_info = NULL;
+
+        callback_info = (axis2_callback_info_t *)(soap_builder->callback_ctx);
+        if(callback_info)
+        {
+            if(callback_info->chunked_stream)
+            {
+                axutil_http_chunked_stream_free(callback_info->chunked_stream, env);
+                callback_info->chunked_stream = NULL;
+            }
+
+            AXIS2_FREE(env->allocator, callback_info);
+            callback_info = NULL;
+            soap_builder->callback_ctx = NULL;
+        }
+    }
+
     if (soap_builder)
     {
         AXIS2_FREE(env->allocator, soap_builder);
@@ -1172,3 +1207,88 @@
 {
     return builder->mime_body_parts;
 }
+
+AXIS2_EXTERN void AXIS2_CALL
+axiom_soap_builder_set_mime_parser(
+    axiom_soap_builder_t * builder,
+    const axutil_env_t * env,
+    axiom_mime_parser_t *mime_parser)
+{
+    builder->mime_parser = mime_parser;
+}
+
+AXIS2_EXTERN void AXIS2_CALL
+axiom_soap_builder_set_callback_function(
+    axiom_soap_builder_t * builder,
+    const axutil_env_t * env,
+    AXIS2_READ_INPUT_CALLBACK callback)
+{
+    builder->callback = callback;
+}
+
+AXIS2_EXTERN void AXIS2_CALL
+axiom_soap_builder_set_callback_ctx(
+    axiom_soap_builder_t * builder,
+    const axutil_env_t * env,
+    void *callback_ctx)
+{
+    builder->callback_ctx = callback_ctx;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+axiom_soap_builder_create_attachments(
+    axiom_soap_builder_t * builder,
+    const axutil_env_t * env,
+    void *user_param,
+    axis2_char_t *callback_name)
+{
+    axutil_hash_t *attachments_map = NULL;
+    axis2_char_t *mime_boundary = NULL;
+
+    if(builder->mime_parser)
+    {
+        if(builder->callback_ctx)
+        {
+            mime_boundary = axiom_mime_parser_get_mime_boundary(
+                builder->mime_parser, env);
+
+            if(mime_boundary)
+            {
+                if(callback_name)
+                {
+                    axiom_mime_parser_set_caching_callback_name(builder->mime_parser,
env, 
+                        callback_name);
+                }
+                attachments_map = axiom_mime_parser_parse_for_attachments(
+                    builder->mime_parser, env,
+                    builder->callback,
+                    builder->callback_ctx,
+                    mime_boundary,
+                    user_param);
+
+                if(attachments_map)
+                {
+                    builder->mime_body_parts = attachments_map;
+                    return AXIS2_SUCCESS; 
+                }  
+                else
+                {
+                    return AXIS2_FAILURE;
+                }  
+            }
+            else
+            {
+                return AXIS2_FAILURE;
+            }
+        }
+        else
+        {
+            return AXIS2_FAILURE;
+        }
+    }
+    else
+    {
+        return AXIS2_FAILURE;
+    }
+}
+



Mime
View raw message