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/04 09:55:10 UTC

svn commit: r365866 - in /webservices/axis2/trunk/c: include/axis2_soap_body.h include/axis2_soap_model_builder.h modules/xml/om/om_document.c modules/xml/om/om_stax_builder.c

Author: nandika
Date: Wed Jan  4 00:55:01 2006
New Revision: 365866

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

Added:
    webservices/axis2/trunk/c/include/axis2_soap_model_builder.h
Modified:
    webservices/axis2/trunk/c/include/axis2_soap_body.h
    webservices/axis2/trunk/c/modules/xml/om/om_document.c
    webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.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=365866&r1=365865&r2=365866&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_body.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_body.h Wed Jan  4 00:55:01 2006
@@ -17,10 +17,11 @@
 #ifndef AXIS2_SOAP_BODY_H
 #define AXIS2_SOAP_BODY_H
  
-    /**
-    * @file axis2_soap_body.h
-    * @brief axis2_soap_body struct
-    */
+/**
+ * @file axis2_soap_body.h
+ * @brief axis2_soap_body struct
+ */
+ 
 #include <axis2_env.h>
 #include <axis2_om_node.h>
 #include <axis2_om_element.h>

Added: webservices/axis2/trunk/c/include/axis2_soap_model_builder.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap_model_builder.h?rev=365866&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_model_builder.h (added)
+++ webservices/axis2/trunk/c/include/axis2_soap_model_builder.h Wed Jan  4 00:55:01 2006
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+ #ifndef AXIS2_SOAP_MODEL_BUILDER_H
+ #define AXIS2_SOAP_MODEL_BUILDER_H
+ 
+ #include <axis2_om_stax_builder.h>
+ #include <axis2_soap_envelope.h>
+ 
+/**
+ * @file axis2_soap_model_builder.h
+ * @brief axis2_soap_model_builder struct 
+ */
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+typedef struct axis2_soap_model_builder axis2_soap_model_builder_t;
+typedef struct axis2_soap_model_builder_ops  axis2_soap_model_builder_ops_t;
+    
+/**
+ * @defgroup axis2_soap_model_builder
+ * @ingroup axis2_soap_model builder
+ * @{
+ */
+
+/**
+ *   \brief soap_model builder operations struct
+ *   ops Encapsulator struct of axis2_soap_operations 
+ */
+
+AXIS2_DECLARE_DATA   struct axis2_soap_body_ops
+{
+        axis2_status_t (AXIS2_CALL *free)(axis2_soap_model_builder_t *builder,
+                                          axis2_env_t **env);
+
+        axis2_soap_envelope_t* (AXIS2_CALL *get_soap_envelope)
+                                         (axis2_soap_model_builder_t *builder,
+                                          axis2_env_t **env);
+                                          
+        axis2_om_document_t* (AXIS2_CALL *get_document)
+                                         (axis2_soap_model_builder_t *builder,
+                                          axis2_env_t **env);
+                                          
+        axis2_om_node_t * (AXIS2_CALL *next)(axis2_soap_model_builder_t *builder,
+                                             axis2_env_t **env);
+                                             
+        axis2_om_node_t* (AXIS2_CALL *get_document_element)
+                                            (axis2_soap_model_builder_t *builder,
+                                             axis2_env_t **env);                                                                                               
+                                                                                            
+};
+                                                      
+
+/**
+ * \brief soap_body struct
+ * represent a soap_body
+ */
+ 
+struct axis2_soap_model_builder
+{
+    /** operation of axis2_soap_body struct */
+    axis2_soap_model_builder_ops_t *ops;
+};
+
+/**
+ * creates a axis2_soap_model_builder struct
+ * @param env Environment. MUST NOT be NULL
+ */
+
+AXIS2_DECLARE(axis2_soap_model_builder_t *)
+axis2_soap_model_builder_create(axis2_env_t **env,
+                                axis2_om_stax_builder_t *builder);
+
+/******************** Macros **************************************************/
+    
+#define AXIS2_SOAP_MODEL_BUILDER_FREE(builder, env) \
+        ((builder)->ops->free(builder, env))
+
+#define AXIS2_SOAP_MODEL_BUILDER_GET_SOAP_ENVELOPE(builder, env) \
+        ((builder)->ops->get_soap_envelope(builder, env))
+        
+#define AXIS2_SOAP_MODEL_BUILDER_GET_DOCUMENT_ELEMENT(builder, env) \
+        ((builder)->ops->get_document_element(builder, env))
+        
+#define AXIS2_SOAP_MODEL_BUILDER_NEXT(builder, env) \
+        ((builder)->ops->next(builder, env))
+        
+#define AXIS2_SOAP_MODEL_BUILDER_GET_DOCUMENT(builder, env) \
+        ((builder)->ops->get_document(builder, env))
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif 
+ 
+
+
+#endif /* AXIS2_SOAP_MODEL_BUILDER_H */
\ No newline at end of file

Modified: webservices/axis2/trunk/c/modules/xml/om/om_document.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/om_document.c?rev=365866&r1=365865&r2=365866&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/om_document.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/om_document.c Wed Jan  4 00:55:01 2006
@@ -245,27 +245,29 @@
                                     axis2_env_t **env)
 {
     axis2_om_node_t *node = NULL;
+    axis2_om_document_impl_t *doc_impl = NULL;
     AXIS2_FUNC_PARAM_CHECK(document, env, NULL);
+    doc_impl = AXIS2_INTF_TO_IMPL(document);
     
-    if (AXIS2_INTF_TO_IMPL(document)->root_element)
+    if (doc_impl->root_element)
     {
-        return AXIS2_INTF_TO_IMPL(document)->root_element;
+        return doc_impl->root_element;
     }
     else
     {  
         node = axis2_om_document_build_next(document, env);
             
-        if (AXIS2_INTF_TO_IMPL(document)->root_element)
+        if (doc_impl->root_element)
         {
             
-            return AXIS2_INTF_TO_IMPL(document)->root_element;
+            return doc_impl->root_element;
         }
         else
         {
-            AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_INVALID_DOCUMENT_STATE_ROOT_NULL, AXIS2_FAILURE);
+            AXIS2_ERROR_SET((*env)->error, 
+                AXIS2_ERROR_INVALID_DOCUMENT_STATE_ROOT_NULL, AXIS2_FAILURE);
             return NULL;
         }
-        
     }
 }
 
@@ -316,8 +318,7 @@
 {
     AXIS2_FUNC_PARAM_CHECK(document, env, NULL);
     return AXIS2_INTF_TO_IMPL(document)->builder;
-}                              
-
+}
 
 axis2_status_t AXIS2_CALL
 axis2_om_document_serialize(axis2_om_document_t *document,
@@ -333,4 +334,3 @@
     }
     return AXIS2_OM_NODE_SERIALIZE(document_impl->root_element, env, om_output);
 }
-

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=365866&r1=365865&r2=365866&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  4 00:55:01 2006
@@ -63,6 +63,8 @@
     axis2_xml_reader_t *parser;
     /** last node the builder found */
     axis2_om_node_t *lastnode;
+    
+    axis2_om_node_t *root_node;
     /** document associated with the builder */
     axis2_om_document_t *document;
     /** done building the document? */
@@ -107,6 +109,7 @@
     builder->document = NULL;
     builder->parser = parser;
     builder->current_event = -1;
+    builder->root_node = NULL;
    
     /* ops */
     builder->om_stax_builder.ops = NULL;
@@ -427,8 +430,11 @@
         }
         else
         {
+            /*
             AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_BUILDER_NOT_ASSOCIATED_WITH_DOCUMENT, AXIS2_FAILURE);
             return  NULL;            
+            */
+            builder_impl->root_node = element_node;
         }            
         
     }