axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r371454 - in /webservices/axis2/trunk/c: modules/xml/soap/ test/xml/soap/
Date Mon, 23 Jan 2006 03:42:30 GMT
Author: nandika
Date: Sun Jan 22 19:42:17 2006
New Revision: 371454

URL: http://svn.apache.org/viewcvs?rev=371454&view=rev
Log:
set builder method added 

Modified:
    webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_fault_code.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_fault_sub_code.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_header.c
    webservices/axis2/trunk/c/test/xml/soap/test_soap.c

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c?rev=371454&r1=371453&r2=371454&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c Sun Jan 22 19:42:17
2006
@@ -194,6 +194,8 @@
                 soap_fault_code = axis2_soap_fault_code_create(env);
                 AXIS2_SOAP_FAULT_CODE_SET_BASE_NODE(soap_fault, env, om_ele_node);      
     
                 AXIS2_SOAP_FAULT_CODE_SET_SOAP_VERSION(soap_fault_code, env, AXIS2_SOAP12);
+                AXIS2_SOAP_FAULT_CODE_SET_BUILDER(soap_fault_code, env, 
+                    builder_helper_impl->soap_builder);
                 AXIS2_SOAP_FAULT_SET_CODE(soap_fault, env, soap_fault_code);
                 builder_helper_impl->code_present = AXIS2_TRUE;
                 builder_helper_impl->code_processing = AXIS2_TRUE;

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=371454&r1=371453&r2=371454&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c Sun Jan 22 19:42:17 2006
@@ -473,7 +473,6 @@
             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);
-            printf("body create");                        
         }
         else
         {
@@ -609,6 +608,7 @@
     }
     envelope_node = AXIS2_SOAP_ENVELOPE_GET_BASE_NODE(builder_impl->soap_envelope, env);
     om_ele = (axis2_om_element_t *) AXIS2_OM_NODE_GET_DATA_ELEMENT(envelope_node, env);
+    
     om_ns = AXIS2_OM_ELEMENT_GET_NAMESPACE(om_ele, env);
     
     ns_uri = AXIS2_OM_NAMESPACE_GET_URI(om_ns, env);
@@ -632,6 +632,7 @@
     axis2_soap_builder_impl_t *builder_impl = NULL;
     axis2_om_node_t *om_node = NULL;
     axis2_soap_header_t *soap_header = NULL;
+    int status = AXIS2_SUCCESS;
     builder_impl = AXIS2_INTF_TO_IMPL(builder);
     soap_header = AXIS2_SOAP_ENVELOPE_GET_HEADER(builder_impl->soap_envelope, env);
     om_node = AXIS2_SOAP_HEADER_GET_BASE_NODE(soap_header, env);
@@ -640,10 +641,13 @@
     {
         while(!AXIS2_OM_NODE_GET_BUILD_STATUS(om_node, env))
         {
-            axis2_soap_builder_next(builder, env);
+            status = axis2_soap_builder_next(builder, env);
+            if(status == AXIS2_FAILURE)
+                return AXIS2_FAILURE;
             
         }
     }
+    return AXIS2_SUCCESS;
 } 
 
 axis2_status_t AXIS2_CALL 

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c?rev=371454&r1=371453&r2=371454&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c Sun Jan 22 19:42:17 2006
@@ -335,11 +335,10 @@
     
     if(envelope_impl->header)
     {
-        printf("header already there ");
         return envelope_impl->header;
     }
     if(envelope_impl->soap_builder)
-    {   printf("header pulled");
+    {
         while(!(envelope_impl->header) && !AXIS2_OM_NODE_GET_BUILD_STATUS(envelope_impl->om_ele_node,
env))
         {
             status = AXIS2_SOAP_BUILDER_NEXT(envelope_impl->soap_builder, env);  
@@ -376,7 +375,7 @@
     } 
     */           
     if(!(envelope_impl->header))
-    {    printf(" create new");
+    { 
         envelope_impl->header = axis2_soap_header_create_with_parent(env, envelope);
         if(envelope_impl->soap_version == AXIS2_SOAP12)
         {

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_fault_code.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_fault_code.c?rev=371454&r1=371453&r2=371454&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_fault_code.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_fault_code.c Sun Jan 22 19:42:17 2006
@@ -36,9 +36,7 @@
     
     axis2_soap_fault_value_t *value;
     
-    axis2_soap_fault_t *parent;
-    
-    axis2_soap_builder_t *soap_builder;
+    axis2_soap_builder_t *builder;
  
  }axis2_soap_fault_code_impl_t;
  
@@ -115,7 +113,7 @@
     fault_code_impl->subcode = NULL;
     fault_code_impl->value = NULL;
     fault_code_impl->soap_version = AXIS2_SOAP_VERSION_NOT_SET;
-    fault_code_impl->parent = NULL;
+    fault_code_impl->builder = NULL;
     
     fault_code_impl->fault_code.ops = 
             (axis2_soap_fault_code_ops_t*)AXIS2_MALLOC((*env)->allocator,
@@ -182,8 +180,6 @@
         
     fault_code_impl = AXIS2_INTF_TO_IMPL(fault_code);
     
-    fault_code_impl->parent = fault;
-    
     parent_node = AXIS2_SOAP_FAULT_GET_BASE_NODE(fault, env);
     
     parent_ele  = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(
@@ -420,7 +416,8 @@
     axis2_soap_fault_code_impl_t *fault_code_impl = NULL;
     AXIS2_FUNC_PARAM_CHECK(fault_code, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, soap_builder, AXIS2_FAILURE);
-    fault_code_impl->soap_builder = soap_builder;
+    fault_code_impl = AXIS2_INTF_TO_IMPL(fault_code);
+    fault_code_impl->builder = soap_builder;
     return AXIS2_SUCCESS;
 }                                                             
 /*********************** soap11 create function *******************************/

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_fault_sub_code.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_fault_sub_code.c?rev=371454&r1=371453&r2=371454&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_fault_sub_code.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_fault_sub_code.c Sun Jan 22 19:42:17 2006
@@ -33,8 +33,6 @@
     
     axis2_soap_fault_sub_code_t *subcode;
     
-    axis2_soap_fault_code_t *parent;
-    
     int soap_version; 
     
     axis2_soap_builder_t *builder;   
@@ -123,7 +121,6 @@
     fault_subcode_impl->soap_version = AXIS2_SOAP_VERSION_NOT_SET;
     fault_subcode_impl->value = NULL;
     fault_subcode_impl->subcode = NULL;
-    fault_subcode_impl->parent = NULL;
     fault_subcode_impl->builder = NULL;
     
     fault_subcode_impl->fault_sub_code.ops = 
@@ -189,7 +186,6 @@
         return NULL;
     fault_sub_code_impl = AXIS2_INTF_TO_IMPL(fault_sub_code);
     
-    fault_sub_code_impl->parent = fault_code;
     parent_node = AXIS2_SOAP_FAULT_CODE_GET_BASE_NODE(fault_code, env);
     parent_ele  = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(
                         parent_node, env);

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_header.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_header.c?rev=371454&r1=371453&r2=371454&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_header.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_header.c Sun Jan 22 19:42:17 2006
@@ -280,7 +280,6 @@
     axis2_om_element_t *om_ele = NULL;
     AXIS2_FUNC_PARAM_CHECK(header, env, NULL);
     header_impl = AXIS2_INTF_TO_IMPL(header);
-    printf(" header block");
     om_ele = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(header_impl->om_ele_node,
env);
     return AXIS2_OM_ELEMENT_GET_CHILDREN_WITH_QNAME(om_ele,
                 env, NULL, header_impl->om_ele_node);

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=371454&r1=371453&r2=371454&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/xml/soap/test_soap.c (original)
+++ webservices/axis2/trunk/c/test/xml/soap/test_soap.c Sun Jan 22 19:42:17 2006
@@ -17,6 +17,8 @@
 #include <axis2_soap_message.h>
 #include <axis2_soap_header_block.h>
 #include <axis2_soap_fault.h>
+#include <axis2_soap_fault_code.h>
+#include <axis2_soap_fault_role.h>
 
 FILE *f = NULL;
 
@@ -63,7 +65,7 @@
     axis2_soap_body_t *soap_body = NULL;
     axis2_soap_header_t *soap_header = NULL;
     axis2_soap_header_block_t *header_block = NULL;
-    axis2_om_children_iterator_t *children_iter = NULL;
+    axis2_om_children_qname_iterator_t *children_iter = NULL;
     axis2_hash_t *hbs = NULL;
     int status = AXIS2_SUCCESS;    
     
@@ -89,7 +91,7 @@
           
     om_node = AXIS2_SOAP_ENVELOPE_GET_BASE_NODE(soap_envelope, env);
     printnode(om_node, env);
-    
+    /*
     soap_header = AXIS2_SOAP_ENVELOPE_GET_HEADER(soap_envelope, env);
     if(soap_header)
     {
@@ -125,15 +127,15 @@
         return AXIS2_FAILURE;
     }
     
-    
-    /*
+    */
+
     while(!(AXIS2_OM_NODE_GET_BUILD_STATUS(om_node, env)) && !(AXIS2_OM_STAX_BUILDER_IS_COMPLETE(om_builder,
env)))
     {
         status = AXIS2_SOAP_BUILDER_NEXT(soap_builder, env);
         if(status == AXIS2_FAILURE)
-               printf("%s" ,AXIS2_ERROR_GET_MESSAGE((*env)->error));
+               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);  
@@ -156,15 +158,35 @@
     axis2_xml_writer_t *xml_writer = NULL;
     axis2_om_output_t *om_output = NULL;
     axis2_char_t *buffer = NULL;
+    axis2_soap_header_block_t *hb1 = NULL;
+    axis2_om_namespace_t *test_ns = NULL;
+    axis2_om_namespace_t *role_ns = NULL;
+    axis2_om_node_t *hb_node = NULL;
+    axis2_om_element_t *hb_ele =  NULL;
+    axis2_soap_fault_code_t *fault_code = NULL;
 
     env_ns = axis2_om_namespace_create(env, "http://www.w3.org/2003/05/soap-envelope", "env");
     soap_envelope = axis2_soap_envelope_create(env, env_ns);
     
     soap_header = axis2_soap12_header_create_with_parent(env, soap_envelope);
+    
+    test_ns = axis2_om_namespace_create(env, "http://example.org/ts-tests", "test");
+    role_ns = axis2_om_namespace_create(env, "http://www.w3.org/2003/05/soap-envelope/role/next","role");
+
+   
+    hb1 = axis2_soap12_header_block_create_with_parent(env, "echoOk", role_ns , soap_header);
+    hb_node = AXIS2_SOAP_HEADER_BLOCK_GET_BASE_NODE(hb1, env);
+    hb_ele = AXIS2_OM_NODE_GET_DATA_ELEMENT(hb_node, env);
+    
+    AXIS2_OM_ELEMENT_SET_NAMESPACE(hb_ele, env, test_ns, hb_node);
+    
     soap_body = axis2_soap_body_create_with_parent(env, soap_envelope);
+    
 
     soap_fault = axis2_soap_fault_create_with_parent(env, soap_body);
     
+    fault_code = axis2_soap12_fault_code_create(env, soap_fault);
+    
     xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE);
     om_output = axis2_om_output_create( env, xml_writer);
     
@@ -199,11 +221,11 @@
     
     axis2_error_init();
     /*build_soap_programatically(&env);*/
-    /*
+    
     
     printf("\nbuild soap\n");
-    */
     build_soap(&env, filename,uri);
     printf("\n");
+
     return 0;        
 }



Mime
View raw message