00001 /****************************************************************** 00002 * $Id: soap-ctx.h,v 1.13 2006/11/25 15:06:57 m0gg Exp $ 00003 * 00004 * CSOAP Project: A SOAP client/server library in C 00005 * Copyright (C) 2003-2004 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: ferhatayaz@jprogrammer.net 00023 ******************************************************************/ 00024 #ifndef __csoap_context_h 00025 #define __csoap_context_h 00026 00027 #define SOAP_ERROR_NO_FILE_ATTACHED 4001 00028 #define SOAP_ERROR_EMPTY_ATTACHMENT 4002 00029 00030 #define MAX_HREF_SIZE 150 00031 00032 struct SoapCtx 00033 { 00034 struct SoapEnv *env; 00035 struct attachments_t *attachments; 00036 }; 00037 00038 #ifdef __cplusplus 00039 extern "C" { 00040 #endif 00041 00047 extern struct SoapCtx *soap_ctx_new(struct SoapEnv * env); 00048 00054 extern herror_t soap_ctx_new_with_method(const char *urn, const char *method, struct SoapCtx ** out); 00055 00056 extern void soap_ctx_free(struct SoapCtx * ctx); 00057 00068 extern struct part_t *soap_ctx_get_file(struct SoapCtx * ctx, xmlNodePtr node); 00069 00075 extern herror_t soap_ctx_add_file(struct SoapCtx * ctx, const char *filename, const char *content_type, char *dest_href); 00076 00083 extern void soap_ctx_add_files(struct SoapCtx * ctx, struct attachments_t * attachments); 00084 00085 #ifdef __cplusplus 00086 } 00087 #endif 00088 00089 #endif