soap-env.h

Go to the documentation of this file.
00001 /******************************************************************
00002  *  $Id: soap-env.h,v 1.21 2006/12/09 09:27:11 m0gg Exp $
00003  *
00004  * CSOAP Project:  A SOAP client/server library in C
00005  * Copyright (C) 2003  Ferhat Ayaz
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public
00018  * License along with this library; if not, write to the
00019  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020  * Boston, MA  02111-1307, USA.
00021  * 
00022  * Email: ayaz@jprogrammer.net
00023  ******************************************************************/
00024 #ifndef __csoap_env_h
00025 #define __csoap_env_h
00026 
00118 static const char * const soap_env_ns = "http://schemas.xmlsoap.org/soap/envelope/";
00119 
00125 struct SoapEnv
00126 {
00127   xmlNodePtr root; 
00128   xmlNodePtr header;
00129   xmlNodePtr body;
00130   xmlNodePtr cur; 
00131 };
00132 
00133 typedef void (*XmlSerializerCallback) (void * obj, const xmlChar *root_element_name, void (*OnStartElement) (const xmlChar * element_name, int attr_count, xmlChar ** keys, xmlChar ** values, void *userData), void (*OnCharacters) (const xmlChar * element_name, const xmlChar * chars, void *userData), void (*OnEndElement) (const xmlChar * element_name, void *userData), void *userdata);
00134 
00135 #ifdef __cplusplus
00136 extern "C" {
00137 #endif
00138 
00171 extern herror_t soap_env_new_with_fault(int faultCode, const char *faultString, const char *faultActor, const char *detail, struct SoapEnv **out);
00172 
00199 extern herror_t soap_env_new_with_method(const char *urn, const char *method, struct SoapEnv ** out);
00200 
00232 extern herror_t soap_env_new_with_response(struct SoapEnv * req, struct SoapEnv ** out);
00233 
00244 extern herror_t soap_env_new_from_doc(xmlDocPtr doc, struct SoapEnv ** out);
00245 
00255 extern herror_t soap_env_new_from_buffer(const char *buffer, struct SoapEnv ** out);
00256 
00276 extern xmlNodePtr soap_env_add_item(struct SoapEnv * env, const char *type, const char *name, const char *value);
00277 
00295 extern xmlNodePtr
00296 soap_env_add_attachment(struct SoapEnv * env, const char *name, const char *href);
00297 
00306 extern void soap_env_add_custom(struct SoapEnv * env, void *obj, XmlSerializerCallback cb, const char *type, const char *name);
00307 
00318 extern xmlNodePtr
00319 soap_env_add_itemf(struct SoapEnv * env, const char *type, const char *name, const char *value, ...);
00320 
00347 extern xmlNodePtr soap_env_push_item(struct SoapEnv * env, const char *type, const char *name);
00348 
00357 extern void soap_env_pop_item(struct SoapEnv * env);
00358 
00366 extern void soap_env_free(struct SoapEnv *env);
00367 
00373 extern xmlNodePtr soap_env_get_body(struct SoapEnv * env);
00374 
00380 extern xmlNodePtr soap_env_get_method(struct SoapEnv * env);
00381 
00387 extern xmlNodePtr soap_env_get_fault(struct SoapEnv * env);
00388 
00394 extern xmlNodePtr soap_env_get_header(struct SoapEnv * env);
00395 
00401 extern const char *soap_env_find_urn(struct SoapEnv * env);
00402 
00408 extern const char *soap_env_find_methodname(struct SoapEnv * env);
00409 
00410 #ifdef __cplusplus
00411 }
00412 #endif
00413 
00414 #endif

Generated on Thu Jan 25 23:36:03 2007 for csoap by  doxygen 1.4.6