axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r370353 - in /webservices/axis2/trunk/c: include/ modules/xml/om/ modules/xml/soap/ test/xml/soap/
Date Thu, 19 Jan 2006 03:31:12 GMT
Author: nandika
Date: Wed Jan 18 19:31:00 2006
New Revision: 370353

URL: http://svn.apache.org/viewcvs?rev=370353&view=rev
Log: (empty)

Modified:
    webservices/axis2/trunk/c/include/axis2_om_stax_builder.h
    webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c
    webservices/axis2/trunk/c/modules/xml/soap/soap11_builder_helper.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_fault_node.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_fault_value.c
    webservices/axis2/trunk/c/test/xml/soap/test_soap.c

Modified: webservices/axis2/trunk/c/include/axis2_om_stax_builder.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_stax_builder.h?rev=370353&r1=370352&r2=370353&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_stax_builder.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_stax_builder.h Wed Jan 18 19:31:00 2006
@@ -133,7 +133,10 @@
         axis2_status_t (AXIS2_CALL *set_element_level)
                                             (struct axis2_om_stax_builder* builder,
                                              axis2_env_t **env,
-                                             int element_level);                        
                                                                                         
                                                                                  
+                                             int element_level); 
+                                             
+        int (AXIS2_CALL *next_with_token)(struct axis2_om_stax_builder *builder,
+                                          axis2_env_t **env);                           
                                                                                         
                                                                                         
                                 
                                                            
     } axis2_om_stax_builder_ops_t;
 
@@ -190,7 +193,10 @@
         ((builder)->ops->get_element_level(builder, env))
         
 #define AXIS2_OM_STAX_BUILDER_SET_ELEMENT_LEVEL(builder, env, element_level) \
-        ((builder)->ops->set_element_level(builder, env, element_level))          
  
+        ((builder)->ops->set_element_level(builder, env, element_level)) 
+        
+#define AXIS2_OM_STAX_BUILDER_NEXT_WITH_TOKEN(builder, env) \
+        ((builder)->ops->next_with_token(builder, env))                    
 
 /** @} */
 

Modified: webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c?rev=370353&r1=370352&r2=370353&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c Wed Jan 18 19:31:00 2006
@@ -72,7 +72,11 @@
 axis2_status_t AXIS2_CALL 
 axis2_om_stax_builder_set_element_level(axis2_om_stax_builder_t* builder,
                                         axis2_env_t **env,
-                                        int element_level);                             
                                                                         											
+                                        int element_level);   
+                                        
+int AXIS2_CALL 
+axis2_om_stax_builder_next_with_token(axis2_om_stax_builder_t *builder,
+                                          axis2_env_t **env);                           
                                                                                         
                      											
 													
 /********************************* axis2_om_stax_builder_impl_t struct ********/
 typedef struct axis2_om_stax_builder_impl_t
@@ -160,6 +164,12 @@
 	        axis2_om_stax_builder_get_current_event;
     builder->om_stax_builder.ops->get_last_node = 
             axis2_om_stax_builder_get_lastnode;	
+    builder->om_stax_builder.ops->set_last_node =
+            axis2_om_stax_builder_set_last_node; 
+            
+    builder->om_stax_builder.ops->next_with_token =
+            axis2_om_stax_builder_next_with_token;                       
+            
     builder->om_stax_builder.ops->is_complete =
             axis2_om_stax_builder_is_complete;
     builder->om_stax_builder.ops->set_element_level =
@@ -869,4 +879,91 @@
     builder_impl = AXIS2_INTF_TO_IMPL(builder);
     builder_impl->element_level = element_level;    
     return AXIS2_SUCCESS;
-}                                        
\ No newline at end of file
+} 
+
+int AXIS2_CALL 
+axis2_om_stax_builder_next_with_token(axis2_om_stax_builder_t *builder,
+                                          axis2_env_t **env)
+{
+
+    int token = 0;
+    axis2_om_stax_builder_impl_t *builder_impl = NULL;
+    builder_impl = AXIS2_INTF_TO_IMPL(builder);
+    
+    if (builder_impl->done)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_BUILDER_DONE_CANNOT_PULL, AXIS2_FAILURE);
+            return -1;
+    }
+
+        token = AXIS2_XML_READER_NEXT (builder_impl->parser, env);
+
+        if(token == -1)
+            return -1;
+
+                
+        if (!(builder_impl->cache))
+        {
+            return -1;
+        }
+
+        
+        switch (token)
+        {
+        case AXIS2_XML_READER_START_DOCUMENT:
+            /*Do nothing */
+            break;
+        
+        case AXIS2_XML_READER_START_ELEMENT:
+            axis2_om_stax_builder_create_om_element (
+                        builder, env); 
+            break;
+        
+        case AXIS2_XML_READER_EMPTY_ELEMENT:
+             axis2_om_stax_builder_create_om_element (
+                        builder, env);
+        
+        case AXIS2_XML_READER_END_ELEMENT:
+            axis2_om_stax_builder_end_element (builder, env);
+            break;
+        
+        
+        case AXIS2_XML_READER_SPACE:
+            /* Do nothing */
+            break;
+        
+        case AXIS2_XML_READER_CHARACTER:
+            axis2_om_stax_builder_create_om_text(builder, env);
+            break;
+                
+        case AXIS2_XML_READER_ENTITY_REFERANCE:
+            break;
+        
+        case AXIS2_XML_READER_COMMENT:
+            
+               axis2_om_stax_builder_create_om_comment(builder, env);
+                axis2_om_stax_builder_end_element (builder, env);
+        
+            break;
+        
+        case AXIS2_XML_READER_PROCESSING_INSTRUCTION:
+            
+             axis2_om_stax_builder_create_om_processing_instruction(
+                                        builder , env );
+            axis2_om_stax_builder_end_element (builder, env);
+          
+            break;
+        
+        case AXIS2_XML_READER_CDATA:
+            break;
+        
+        case AXIS2_XML_READER_DOCUMENT_TYPE:
+        /* node = axis2_om_stax_builder_create_om_doctype(om_stax_builder, env);
+        */          
+        break;
+        
+        default:
+            break;
+        }
+   return token;
+}                                                                                
\ No newline at end of file

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap11_builder_helper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap11_builder_helper.c?rev=370353&r1=370352&r2=370353&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap11_builder_helper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap11_builder_helper.c Wed Jan 18 19:31:00
2006
@@ -146,10 +146,11 @@
     axis2_soap_fault_t *soap_fault = NULL;
     
     AXIS2_FUNC_PARAM_CHECK(builder_helper, env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK((*env)->error, element_level, AXIS2_FAILURE);
     builder_helper_impl = AXIS2_INTF_TO_IMPL(builder_helper);
-    
+      
     om_ele = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(om_element_node, env);
+    ele_localname = AXIS2_OM_ELEMENT_GET_LOCALNAME(om_ele, env);
+    printf("\nelement localname %s\n", ele_localname);
     
     soap_envelope = AXIS2_SOAP_BUILDER_GET_SOAP_ENVELOPE(builder_helper_impl->soap_builder,
env);
     if(soap_envelope)
@@ -159,7 +160,7 @@
     }
     
                 
-    if(element_level > 4)
+    if(element_level == 4)
     {
         axis2_soap_fault_code_t *fault_code = NULL;
         axis2_soap_fault_value_t *fault_value = NULL;
@@ -169,7 +170,7 @@
 
 
         if(AXIS2_STRCMP(ele_localname, AXIS2_SOAP11_SOAP_FAULT_CODE_LOCAL_NAME) == 0)
-        {
+        {   printf("\n fault code found %s\n", AXIS2_SOAP11_SOAP_FAULT_CODE_LOCAL_NAME);
             if(builder_helper_impl->fault_string_present)
             {
                 AXIS2_SOAP_BUILDER_SET_BOOL_PROCESSING_MANDATORY_FAULT_ELEMENTS(
@@ -178,9 +179,9 @@
             fault_code = axis2_soap_fault_code_create(env);
             AXIS2_SOAP_FAULT_CODE_SET_BASE_NODE(fault_code, env, om_element_node);
             AXIS2_SOAP_FAULT_CODE_SET_SOAP_VERSION(fault_code, env, AXIS2_SOAP11);
-            
             AXIS2_SOAP_FAULT_SET_CODE(soap_fault, env, fault_code);
-            
+            AXIS2_OM_ELEMENT_SET_LOCALNAME(om_ele, env, AXIS2_SOAP12_SOAP_FAULT_CODE_LOCAL_NAME);
+                        
             fault_value = axis2_soap_fault_value_create_with_code(env, fault_code);
             
             fault_value_node = AXIS2_SOAP_FAULT_VALUE_GET_BASE_NODE(fault_value, env);
@@ -191,7 +192,8 @@
                                                 env, fault_value_node); 
             
             axis2_soap11_builder_helper_process_text(builder_helper, env);
-            
+            AXIS2_OM_STAX_BUILDER_SET_LAST_NODE(builder_helper_impl->om_builder,
+                                                env, om_element_node); 
             AXIS2_OM_NODE_SET_BUILD_STATUS(om_element_node, env, AXIS2_TRUE); 
             
             AXIS2_OM_STAX_BUILDER_SET_ELEMENT_LEVEL(builder_helper_impl->om_builder, 
@@ -204,7 +206,6 @@
             axis2_soap_fault_reason_t *fault_reason = NULL;
             axis2_soap_fault_text_t *fault_text = NULL;
             axis2_om_node_t *fault_text_node = NULL;
-            axis2_om_element_t *om_ele       = NULL;
             if(builder_helper_impl->fault_code_present)
             {
                 AXIS2_SOAP_BUILDER_SET_BOOL_PROCESSING_MANDATORY_FAULT_ELEMENTS(
@@ -217,13 +218,15 @@
             
             AXIS2_SOAP_FAULT_SET_REASON(soap_fault, env, fault_reason); 
             
-            axis2_soap_fault_text_create_with_parent(env, fault_reason);
+            fault_text = axis2_soap_fault_text_create_with_parent(env, fault_reason);
+            
             
             fault_text_node = AXIS2_SOAP_FAULT_TEXT_GET_BASE_NODE(fault_text, env);
             /* TODO process namespace data */
             AXIS2_OM_STAX_BUILDER_SET_LAST_NODE(builder_helper_impl->om_builder, env,
fault_text_node);
             
             axis2_soap11_builder_helper_process_text(builder_helper, env);
+            AXIS2_OM_STAX_BUILDER_SET_LAST_NODE(builder_helper_impl->om_builder, env,
om_element_node);
             
             AXIS2_OM_NODE_SET_BUILD_STATUS(om_element_node, env, AXIS2_TRUE);
             
@@ -320,8 +323,21 @@
     axis2_soap11_builder_helper_impl_t *builder_helper_impl = NULL;
     int token = 0;
     builder_helper_impl = AXIS2_INTF_TO_IMPL(builder_helper);
-    AXIS2_OM_STAX_BUILDER_NEXT(builder_helper_impl->om_builder, env);
-    token = AXIS2_OM_STAX_BUILDER_GET_CURRENT_EVENT(builder_helper_impl->om_builder, env);
+    token = AXIS2_OM_STAX_BUILDER_NEXT_WITH_TOKEN(builder_helper_impl->om_builder, env);
+   
+   /* while(!AXIS2_OM_NODE_GET_BUILD_STATUS(last_node, env))
+    {
+        
+        token = AXIS2_OM_STAX_BUILDER_NEXT_WITH_TOKEN(builder_helper_impl->om_builder,
env);
+        if(token
+        if(token != AXIS2_XML_READER_CHARACTER)
+        {
+            AXIS2_ERROR_SET((*env)->error, 
+                AXIS2_ERROR_ONLY_CHARACTERS_ARE_ALLOWED_HERE, AXIS2_FAILURE);
+            return AXIS2_FAILURE;                
+        }
+    }
+    */
     while(token != AXIS2_XML_READER_END_ELEMENT)
     {
         if(token != AXIS2_XML_READER_CHARACTER)
@@ -329,8 +345,9 @@
             AXIS2_ERROR_SET((*env)->error, 
                 AXIS2_ERROR_ONLY_CHARACTERS_ARE_ALLOWED_HERE, AXIS2_FAILURE);
             return AXIS2_FAILURE;                
+        
         }
-        AXIS2_OM_STAX_BUILDER_NEXT(builder_helper_impl->om_builder, env);
+        token = AXIS2_OM_STAX_BUILDER_NEXT_WITH_TOKEN(builder_helper_impl->om_builder,
env);    
     }
     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=370353&r1=370352&r2=370353&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 18 19:31:00 2006
@@ -522,7 +522,8 @@
             }
             else if(AXIS2_STRCMP(AXIS2_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI, 
                 AXIS2_OM_NAMESPACE_GET_URI(env_ns , env)) == 0)
-            {
+            {   
+                printf("\nsoap11 builder create\n");
                 builder_impl->builder_helper = axis2_soap11_builder_helper_create(env,
builder, builder_impl->om_builder);            
             }
              
@@ -530,7 +531,8 @@
     else if(element_level > 3 && builder_impl->processing_fault)
     {
         if(builder_impl->soap_version == AXIS2_SOAP11)
-        {
+        {   
+            printf("\nSoap11  handel event\n");
              status = AXIS2_SOAP11_BUILDER_HELPER_HANDLE_EVENT(((axis2_soap11_builder_helper_t*)(builder_impl->builder_helper)),

                 env,  om_element_node , element_level);
         

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_fault_node.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_fault_node.c?rev=370353&r1=370352&r2=370353&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_fault_node.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_fault_node.c Wed Jan 18 19:31:00 2006
@@ -85,7 +85,7 @@
     
     fault_node_impl = (axis2_soap_fault_node_impl_t*)AXIS2_MALLOC(
                             (*env)->allocator,
-                            sizeof(axis2_soap_fault_node_impl_t*));
+                            sizeof(axis2_soap_fault_node_impl_t));
     if(!fault_node_impl)
     {
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -220,17 +220,16 @@
                            axis2_om_node_t *node)
 {
     axis2_soap_fault_node_impl_t* fault_node_impl = NULL;
-    AXIS2_FUNC_PARAM_CHECK(fault_node, env, AXIS2_FAILURE);
     fault_node_impl = AXIS2_INTF_TO_IMPL(fault_node); 
+    
+    AXIS2_PARAM_CHECK((*env)->error, node, AXIS2_FAILURE);
     if(AXIS2_OM_NODE_GET_NODE_TYPE(node, env) != AXIS2_OM_ELEMENT)
     {
         AXIS2_ERROR_SET((*env)->error, 
                 AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    
-    fault_node_impl = AXIS2_INTF_TO_IMPL(fault_node);
-    fault_node_impl->om_ele_node = node;
+    fault_node_impl->om_ele_node = node;  
     fault_node_impl->om_ele = (axis2_om_element_t *) 
                             AXIS2_OM_NODE_GET_DATA_ELEMENT(node, env);
     return AXIS2_SUCCESS;

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_fault_value.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_fault_value.c?rev=370353&r1=370352&r2=370353&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_fault_value.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_fault_value.c Wed Jan 18 19:31:00 2006
@@ -179,7 +179,7 @@
     fault_val_impl = AXIS2_INTF_TO_IMPL(fault_value);
     
     fault_val_impl->parent = parent;
-    fault_val_impl->parent_type = AXIS2_SOAP_FAULT_SUB_CODE;
+    fault_val_impl->parent_type = AXIS2_SOAP_FAULT_CODE;
     
     parent_node = AXIS2_SOAP_FAULT_CODE_GET_BASE_NODE(parent, env);
     parent_ele  = (axis2_om_element_t*)
@@ -192,7 +192,7 @@
                     &this_node);
     fault_val_impl->om_ele_node = this_node;
     fault_val_impl->om_ele = this_ele;
-    AXIS2_SOAP_FAULT_SUB_CODE_SET_VALUE(parent, env, fault_value);
+    AXIS2_SOAP_FAULT_CODE_SET_VALUE(parent, env, fault_value);
     return &(fault_val_impl->fault_value);
 }                                                        
 
@@ -239,7 +239,6 @@
                                   axis2_env_t **env)
 {
     axis2_soap_fault_value_impl_t *fault_val_impl = NULL;
-    AXIS2_FUNC_PARAM_CHECK(fault_val_impl, env, NULL);
     fault_val_impl = AXIS2_INTF_TO_IMPL(fault_value);
     return fault_val_impl->om_ele_node;
 }                                  
@@ -249,7 +248,6 @@
                                      axis2_env_t **env)
 {
     axis2_soap_fault_value_impl_t *fault_val_impl = NULL;
-    AXIS2_FUNC_PARAM_CHECK(fault_val_impl, env, AXIS2_FAILURE);
     fault_val_impl = AXIS2_INTF_TO_IMPL(fault_value);
     return fault_val_impl->soap_version;
 
@@ -262,7 +260,6 @@
                                         int soap_version)
 {
     axis2_soap_fault_value_impl_t *fault_val_impl = NULL;
-    AXIS2_FUNC_PARAM_CHECK(fault_val_impl, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, soap_version, AXIS2_FAILURE);
     fault_val_impl = AXIS2_INTF_TO_IMPL(fault_value);
      fault_val_impl->soap_version = soap_version; 

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=370353&r1=370352&r2=370353&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 18 19:31:00 2006
@@ -67,7 +67,7 @@
     
     om_doc = axis2_om_document_create(env, NULL, om_builder);
     
-    soap_builder = axis2_soap_builder_create(env, om_builder, AXIS2_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI);
+    soap_builder = axis2_soap_builder_create(env, om_builder, AXIS2_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI);
    /* 
     if(soap_builder)    
         printf("soap version %d", AXIS2_SOAP_BUILDER_GET_SOAP_VERSION(soap_builder, env)
);
@@ -96,15 +96,13 @@
         return AXIS2_FAILURE;
     }
     */
-   /*
     while(!(AXIS2_OM_STAX_BUILDER_IS_COMPLETE(om_builder, env)) && !(AXIS2_OM_NODE_GET_BUILD_STATUS(om_node,
env)))
     {
         ret_value = AXIS2_SOAP_BUILDER_NEXT(soap_builder, env);
         if(!ret_value)
                printf("%s" ,AXIS2_ERROR_GET_MESSAGE((*env)->error));
     }
-     */
-    AXIS2_SOAP_BUILDER_NEXT(soap_builder, env);
+    /*
     AXIS2_SOAP_BUILDER_NEXT(soap_builder, env);
     AXIS2_SOAP_BUILDER_NEXT(soap_builder, env);
     AXIS2_SOAP_BUILDER_NEXT(soap_builder, env);
@@ -129,13 +127,15 @@
     AXIS2_SOAP_BUILDER_NEXT(soap_builder, env);
     AXIS2_SOAP_BUILDER_NEXT(soap_builder, env);
     AXIS2_SOAP_BUILDER_NEXT(soap_builder, env);
+    AXIS2_SOAP_BUILDER_NEXT(soap_builder, env);*/
     xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE);
     
     om_output = axis2_om_output_create( env, xml_writer);  
     
     AXIS2_SOAP_ENVELOPE_SERIALIZE(soap_envelope, env, om_output, AXIS2_FALSE);
     buffer = AXIS2_XML_WRITER_GET_XML(xml_writer, env);         
-    printf("%s \n",  buffer); 
+   // fwrite(buffer, sizeof(char), strlen(buffer)+1, fopen("result.xml","w"));
+    printf("%s", buffer);
     return AXIS2_SUCCESS;
     
 }



Mime
View raw message