ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r390950 - in /webservices/axis2/trunk/c: include/axis2_soap_body.h modules/xml/soap/soap_body.c
Date Mon, 03 Apr 2006 04:35:13 GMT
Author: nandika
Date: Sun Apr  2 21:35:08 2006
New Revision: 390950

URL: http://svn.apache.org/viewcvs?rev=390950&view=rev
Log:
soap_body_add_child method added

Modified:
    webservices/axis2/trunk/c/include/axis2_soap_body.h
    webservices/axis2/trunk/c/modules/xml/soap/soap_body.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=390950&r1=390949&r2=390950&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_body.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_body.h Sun Apr  2 21:35:08 2006
@@ -124,7 +124,21 @@
         axis2_status_t (AXIS2_CALL *
 		build)(axis2_soap_body_t *body, 
                axis2_env_t **env);                                                 
-                                                       
+
+       /** add an om node as the child to this soap_body 
+        * the child is added to as the first child 
+        * @param body pointer to soap_body struct
+        * @param env axis2_environment struct MUST not be NULL
+        * @returns status code , AXIS2_SUCCESS on success , AXIS2_ERROR
+        * otherwise
+        */
+
+        axis2_status_t (AXIS2_CALL *
+        add_child)(axis2_soap_body_t *body,
+                   axis2_env_t **env,
+                   axis2_om_node_t *child);
+                   
+
 };                                                      
 
   /**
@@ -150,25 +164,27 @@
 /******************** Macros **************************************************/
     
 /** free soap_body */
-#define AXIS2_SOAP_BODY_FREE(body , env) \
-        ((body)->ops->free(body, env))
+#define AXIS2_SOAP_BODY_FREE( body, env) \
+        ((body)->ops->free( body, env))
         
 /** indecate whether soap_body has a fault or not*/        
-#define AXIS2_SOAP_BODY_HAS_FAULT(body, env) \
-        ((body)->ops->has_fault(body, env))
+#define AXIS2_SOAP_BODY_HAS_FAULT( body, env) \
+        ((body)->ops->has_fault( body, env))
         
-#define AXIS2_SOAP_BODY_GET_FAULT(body, env) \
-        ((body)->ops->get_fault(body, env))
+#define AXIS2_SOAP_BODY_GET_FAULT( body, env) \
+        ((body)->ops->get_fault( body, env))
         
-#define AXIS2_SOAP_BODY_GET_BASE_NODE(body, env) \
-        ((body)->ops->get_base_node(body, env))
+#define AXIS2_SOAP_BODY_GET_BASE_NODE( body, env) \
+        ((body)->ops->get_base_node( body, env))
                                    
-#define AXIS2_SOAP_BODY_GET_SOAP_VERSION(body, env) \
-        ((body)->ops->get_soap_version(body, env))
+#define AXIS2_SOAP_BODY_GET_SOAP_VERSION( body, env) \
+        ((body)->ops->get_soap_version( body, env))
 
-#define AXIS2_SOAP_BODY_BUILD(body, env) \
-        ((body)->ops->build(body, env))
+#define AXIS2_SOAP_BODY_BUILD( body, env) \
+        ((body)->ops->build( body, env))
 
+#define AXIS2_SOAP_BODY_ADD_CHILD( body, env, child) \
+        ((body)->ops->add_child( body, env, child);
 /** @} */
 #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=390950&r1=390949&r2=390950&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_body.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_body.c Sun Apr  2 21:35:08 2006
@@ -70,6 +70,11 @@
                       
                      
 
+axis2_status_t AXIS2_CALL
+axis2_soap_body_add_child(axis2_soap_body_t *body,
+                          axis2_env_t **env,
+                          axis2_om_node_t *child);
+                          
 /*************** function implementations *************************************/
 axis2_soap_body_t* AXIS2_CALL
 axis2_soap_body_create(axis2_env_t **env)
@@ -91,7 +96,7 @@
     body_impl->soap_builder = NULL;
     body_impl->has_fault = AXIS2_FALSE;
     body_impl->soap_fault = NULL; 
-
+   
     body_impl->soap_body.ops = (axis2_soap_body_ops_t*) AXIS2_MALLOC(
                                (*env)->allocator, sizeof(axis2_soap_body_ops_t));
 
@@ -117,6 +122,9 @@
         
     body_impl->soap_body.ops->build = 
         axis2_soap_body_build;
+    
+    body_impl->soap_body.ops->add_child = 
+        axis2_soap_body_add_child;
         
     return &(body_impl->soap_body);
     
@@ -376,7 +384,6 @@
     This is an internal function 
 
 */
-
 axis2_status_t AXIS2_CALL 
 axis2_soap_body_set_fault(axis2_soap_body_t *body,
                           axis2_env_t **env,
@@ -398,3 +405,20 @@
     }
     return AXIS2_SUCCESS;
 }
+
+axis2_status_t AXIS2_CALL
+axis2_soap_body_add_child(axis2_soap_body_t *body,
+                          axis2_env_t **env,
+                          axis2_om_node_t *child)
+{
+    axis2_soap_body_impl_t *body_impl = NULL;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, child, AXIS2_FAILURE);
+
+    body_impl = AXIS2_INTF_TO_IMPL(body);
+    if(NULL != body_impl->om_ele_node)
+    {
+        return AXIS2_OM_NODE_ADD_CHILD(body_impl->om_ele_node, env, child);
+    }
+    return AXIS2_FAILURE;
+}                          



Mime
View raw message