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 na...@apache.org on 2006/01/25 11:32:11 UTC

svn commit: r372187 - in /webservices/axis2/trunk/c: include/axis2_soap_body.h modules/xml/soap/soap_body.c modules/xml/soap/soap_builder.c test/xml/soap/test_soap.c

Author: nandika
Date: Wed Jan 25 02:31:59 2006
New Revision: 372187

URL: http://svn.apache.org/viewcvs?rev=372187&view=rev
Log:
soap_body build method added 

Modified:
    webservices/axis2/trunk/c/include/axis2_soap_body.h
    webservices/axis2/trunk/c/modules/xml/soap/soap_body.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c
    webservices/axis2/trunk/c/test/xml/soap/test_soap.c

Modified: webservices/axis2/trunk/c/include/axis2_soap_body.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap_body.h?rev=372187&r1=372186&r2=372187&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_body.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_body.h Wed Jan 25 02:31:59 2006
@@ -111,6 +111,9 @@
         axis2_status_t (AXIS2_CALL *set_builder)(axis2_soap_body_t *body,
                                                  axis2_env_t **env,
                                                  struct axis2_soap_builder *builder);
+                                                     
+        axis2_status_t (AXIS2_CALL *build)(axis2_soap_body_t *body, 
+                                           axis2_env_t **env);                                                 
                                                               
 };                                                      
 
@@ -166,6 +169,9 @@
         
 #define AXIS2_SOAP_BODY_SET_BUILDER(body, env, builder) \
         ((body)->ops->set_builder(body, env, builder))               
+
+#define AXIS2_SOAP_BODY_BUILD(body, env) \
+        ((body)->ops->build(body, env))
 
 /** @} */
 #ifdef __cplusplus

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_body.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_body.c?rev=372187&r1=372186&r2=372187&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_body.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_body.c Wed Jan 25 02:31:59 2006
@@ -83,7 +83,11 @@
 axis2_status_t AXIS2_CALL 
 axis2_soap_body_set_builder(axis2_soap_body_t *body,
                             axis2_env_t **env,
-                            axis2_soap_builder_t *builder);                                 
+                            axis2_soap_builder_t *builder);   
+
+axis2_status_t AXIS2_CALL
+axis2_soap_body_build(axis2_soap_body_t *body,
+                      axis2_env_t **env);
 
 /*************** function implementations *************************************/
 axis2_soap_body_t* AXIS2_CALL
@@ -127,6 +131,7 @@
     body_impl->soap_body.ops->get_soap_version = axis2_soap_body_get_soap_version;
     body_impl->soap_body.ops->set_soap_version = axis2_soap_body_set_soap_version;
     body_impl->soap_body.ops->set_builder = axis2_soap_body_set_builder;
+    body_impl->soap_body.ops->build = axis2_soap_body_build;
     return &(body_impl->soap_body);
 return NULL;
 }
@@ -383,5 +388,26 @@
     AXIS2_PARAM_CHECK((*env)->error, builder, AXIS2_FAILURE);
     body_impl = AXIS2_INTF_TO_IMPL(body);
     body_impl->soap_builder = builder;
+    return AXIS2_SUCCESS;
+}
+
+
+axis2_status_t AXIS2_CALL
+axis2_soap_body_build(axis2_soap_body_t *body,
+                      axis2_env_t **env)
+{
+    axis2_soap_body_impl_t *soap_body_impl = NULL;
+    int status = AXIS2_SUCCESS;
+    AXIS2_FUNC_PARAM_CHECK(body, env, AXIS2_FAILURE);
+    soap_body_impl = AXIS2_INTF_TO_IMPL(body);
+    if(soap_body_impl->om_ele_node && soap_body_impl->soap_builder)
+    {
+        while(!AXIS2_OM_NODE_GET_BUILD_STATUS(soap_body_impl->om_ele_node, env))
+        {
+            status = AXIS2_SOAP_BUILDER_NEXT(soap_body_impl->soap_builder, env);
+            if(status == AXIS2_FAILURE)
+                return AXIS2_FAILURE;                
+        }
+    }            
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c?rev=372187&r1=372186&r2=372187&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c Wed Jan 25 02:31:59 2006
@@ -482,6 +482,7 @@
             soap_body = axis2_soap_body_create(env);
             AXIS2_SOAP_BODY_SET_BASE_NODE(soap_body, env, om_element_node);
             AXIS2_SOAP_BODY_SET_SOAP_VERSION(soap_body, env, builder_impl->soap_version);
+            AXIS2_SOAP_BODY_SET_BUILDER(soap_body, env, builder);
             AXIS2_SOAP_ENVELOPE_SET_BODY(builder_impl->soap_envelope, env, soap_body);
             status = axis2_soap_builder_process_namespace_data(builder, env, 
                         om_element_node, AXIS2_TRUE);

Modified: webservices/axis2/trunk/c/test/xml/soap/test_soap.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/xml/soap/test_soap.c?rev=372187&r1=372186&r2=372187&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/xml/soap/test_soap.c (original)
+++ webservices/axis2/trunk/c/test/xml/soap/test_soap.c Wed Jan 25 02:31:59 2006
@@ -125,7 +125,9 @@
         printf ("\n\n ERROR soap_body NULL.\n\n");
         return AXIS2_FAILURE;
     }
+    AXIS2_SOAP_BODY_BUILD(soap_body, env);
     
+    /*
 
     while(!(AXIS2_OM_NODE_GET_BUILD_STATUS(om_node, env)) && !(AXIS2_OM_STAX_BUILDER_IS_COMPLETE(om_builder, env)))
     {
@@ -133,7 +135,7 @@
         if(status == AXIS2_FAILURE)
                printf("failure %s" ,AXIS2_ERROR_GET_MESSAGE((*env)->error));
     }
-
+    */
     xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE);
     
     om_output = axis2_om_output_create( env, xml_writer);  
@@ -229,7 +231,7 @@
     env = axis2_env_create_with_error_log(allocator, error,  log);
     
     axis2_error_init();
-    build_soap_programatically(&env);
+/*    build_soap_programatically(&env); */
     build_soap(&env, filename,uri);
     axis2_env_free(env); 
     return 0;