From 76fce97026da5af2f824bdb1037d07f64dbb1bbd Mon Sep 17 00:00:00 2001 From: snowdrop Date: Fri, 6 Feb 2004 07:36:27 +0000 Subject: added building xml with csoap --- doc/tutorial.xml | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 110 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/tutorial.xml b/doc/tutorial.xml index 60ef598..3db45bd 100755 --- a/doc/tutorial.xml +++ b/doc/tutorial.xml @@ -2,7 +2,7 @@
- cSOAP Implementation Guide $Revision: 1.1 $ + cSOAP Implementation Guide $Revision: 1.2 $ FerhatAyaz 2004csoap @@ -286,4 +286,113 @@ simpleserver: $(SERVEROBJECTS) + +
+Building XML tree using libxml2 API + + +One of the ways building a xml tree into an +SOAP envelope is to use directly the libxml2 API. +You can obtain the xmlNodePtr of an envelope +with the SoapEnv structure. + + + +typedef struct _SoapEnv +{ + xmlNodePtr root; + xmlNodePtr cur; +}SoapEnv; + + + +Here is "root" your xml node to <SOAP-ENV:Envelope>. + + +
+ +
+Building XML tree using csoap + + +You can build a xml tree using following functions + + + +xmlNodePtr +soap_env_add_item(SoapEnv* env, const char *type, + const char *name, const char *value); +xmlNodePtr +soap_env_add_itemf(SoapEnv* env, const char *type, + const char *name, const char *value, ...); +xmlNodePtr +soap_env_push_item(SoapEnv *env, const char *type, + const char *name); +void +soap_env_pop_item(SoapEnv* env); + + + +soap_env_add_itemf() does the same thing like soap_env_add_item() +but with a C style argument list. (Max buffer for value is 1054) + + + +Building xml using csoap stack pattern + + + + + + +This will create the following xml structure + + + +Generated SOAP envelope + + + + + + + + 09189 + + MyCity + 12456 + + snowdrop + passphrase64 + + + + + + +]]> + + + + + +
+ +
-- cgit v1.1-32-gdbae