Back to index

php5  5.3.10
php_soap.h
Go to the documentation of this file.
00001 /*
00002   +----------------------------------------------------------------------+
00003   | PHP Version 5                                                        |
00004   +----------------------------------------------------------------------+
00005   | Copyright (c) 1997-2012 The PHP Group                                |
00006   +----------------------------------------------------------------------+
00007   | This source file is subject to version 3.01 of the PHP license,      |
00008   | that is bundled with this package in the file LICENSE, and is        |
00009   | available through the world-wide-web at the following url:           |
00010   | http://www.php.net/license/3_01.txt                                  |
00011   | If you did not receive a copy of the PHP license and are unable to   |
00012   | obtain it through the world-wide-web, please send a note to          |
00013   | license@php.net so we can mail you a copy immediately.               |
00014   +----------------------------------------------------------------------+
00015   | Authors: Brad Lafountain <rodif_bl@yahoo.com>                        |
00016   |          Shane Caraveo <shane@caraveo.com>                           |
00017   |          Dmitry Stogov <dmitry@zend.com>                             |
00018   +----------------------------------------------------------------------+
00019 */
00020 /* $Id: php_soap.h 321634 2012-01-01 13:15:04Z felipe $ */
00021 
00022 #ifndef PHP_SOAP_H
00023 #define PHP_SOAP_H
00024 
00025 #include "php.h"
00026 #include "php_globals.h"
00027 #include "ext/standard/info.h"
00028 #include "ext/standard/php_standard.h"
00029 #if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
00030 #include "ext/session/php_session.h"
00031 #endif
00032 #include "ext/standard/php_smart_str.h"
00033 #include "php_ini.h"
00034 #include "SAPI.h"
00035 #include <libxml/parser.h>
00036 #include <libxml/xpath.h>
00037 
00038 #ifndef PHP_HAVE_STREAMS
00039 # error You lose - must be compiled against PHP 4.3.0 or later
00040 #endif
00041 
00042 #ifndef PHP_WIN32
00043 # define TRUE 1
00044 # define FALSE 0
00045 # define stricmp strcasecmp
00046 #endif
00047 
00048 extern int le_url;
00049 
00050 typedef struct _encodeType encodeType, *encodeTypePtr;
00051 typedef struct _encode encode, *encodePtr;
00052 
00053 typedef struct _sdl sdl, *sdlPtr;
00054 typedef struct _sdlRestrictionInt sdlRestrictionInt, *sdlRestrictionIntPtr;
00055 typedef struct _sdlRestrictionChar sdlRestrictionChar, *sdlRestrictionCharPtr;
00056 typedef struct _sdlRestrictions sdlRestrictions, *sdlRestrictionsPtr;
00057 typedef struct _sdlType sdlType, *sdlTypePtr;
00058 typedef struct _sdlParam sdlParam, *sdlParamPtr;
00059 typedef struct _sdlFunction sdlFunction, *sdlFunctionPtr;
00060 typedef struct _sdlAttribute sdlAttribute, *sdlAttributePtr;
00061 typedef struct _sdlBinding sdlBinding, *sdlBindingPtr;
00062 typedef struct _sdlSoapBinding sdlSoapBinding, *sdlSoapBindingPtr;
00063 typedef struct _sdlSoapBindingFunction sdlSoapBindingFunction, *sdlSoapBindingFunctionPtr;
00064 typedef struct _sdlSoapBindingFunctionBody sdlSoapBindingFunctionBody, *sdlSoapBindingFunctionBodyPtr;
00065 
00066 typedef struct _soapMapping soapMapping, *soapMappingPtr;
00067 typedef struct _soapService soapService, *soapServicePtr;
00068 
00069 #include "php_xml.h"
00070 #include "php_encoding.h"
00071 #include "php_sdl.h"
00072 #include "php_schema.h"
00073 #include "php_http.h"
00074 #include "php_packet_soap.h"
00075 
00076 struct _soapMapping {
00077        zval *to_xml;
00078        zval *to_zval;
00079 };
00080 
00081 struct _soapHeader;
00082 
00083 struct _soapService {
00084        sdlPtr sdl;
00085 
00086        struct _soap_functions {
00087               HashTable *ft;
00088               int functions_all;
00089        } soap_functions;
00090 
00091        struct _soap_class {
00092               zend_class_entry *ce;
00093               zval **argv;
00094               int argc;
00095               int persistance;
00096        } soap_class;
00097 
00098        zval *soap_object;
00099 
00100        HashTable *typemap;
00101        int        version;
00102        int        type;
00103        char      *actor;
00104        char      *uri;
00105        xmlCharEncodingHandlerPtr encoding;
00106        HashTable *class_map;
00107        int        features;
00108        struct _soapHeader **soap_headers_ptr;
00109        int send_errors;
00110 };
00111 
00112 #define SOAP_CLASS 1
00113 #define SOAP_FUNCTIONS 2
00114 #define SOAP_OBJECT 3
00115 #define SOAP_FUNCTIONS_ALL 999
00116 
00117 #define SOAP_MAP_FUNCTION 1
00118 #define SOAP_MAP_CLASS 2
00119 
00120 #define SOAP_PERSISTENCE_SESSION 1
00121 #define SOAP_PERSISTENCE_REQUEST 2
00122 
00123 #define SOAP_1_1 1
00124 #define SOAP_1_2 2
00125 
00126 #define SOAP_ACTOR_NEXT             1
00127 #define SOAP_ACTOR_NONE             2
00128 #define SOAP_ACTOR_UNLIMATERECEIVER 3
00129 
00130 #define SOAP_1_1_ACTOR_NEXT             "http://schemas.xmlsoap.org/soap/actor/next"
00131 
00132 #define SOAP_1_2_ACTOR_NEXT             "http://www.w3.org/2003/05/soap-envelope/role/next"
00133 #define SOAP_1_2_ACTOR_NONE             "http://www.w3.org/2003/05/soap-envelope/role/none"
00134 #define SOAP_1_2_ACTOR_UNLIMATERECEIVER "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"
00135 
00136 #define SOAP_COMPRESSION_ACCEPT  0x20
00137 #define SOAP_COMPRESSION_GZIP    0x00
00138 #define SOAP_COMPRESSION_DEFLATE 0x10
00139 
00140 #define SOAP_AUTHENTICATION_BASIC   0
00141 #define SOAP_AUTHENTICATION_DIGEST  1
00142 
00143 #define SOAP_SINGLE_ELEMENT_ARRAYS  (1<<0)
00144 #define SOAP_WAIT_ONE_WAY_CALLS     (1<<1)
00145 #define SOAP_USE_XSI_ARRAY_TYPE     (1<<2)
00146 
00147 #define WSDL_CACHE_NONE     0x0
00148 #define WSDL_CACHE_DISK     0x1
00149 #define WSDL_CACHE_MEMORY   0x2
00150 #define WSDL_CACHE_BOTH     0x3
00151 
00152 ZEND_BEGIN_MODULE_GLOBALS(soap)
00153        HashTable  defEncNs;     /* mapping of default namespaces to prefixes */
00154        HashTable  defEnc;
00155        HashTable  defEncIndex;
00156        HashTable *typemap;
00157        int        cur_uniq_ns;
00158        int        soap_version;
00159        sdlPtr     sdl;
00160        zend_bool  use_soap_error_handler;
00161        char*      error_code;
00162        zval*      error_object;
00163        char       cache;
00164        char       cache_mode;
00165        char       cache_enabled;
00166        char*      cache_dir;
00167        long       cache_ttl;
00168        long       cache_limit;
00169        HashTable *mem_cache;
00170        xmlCharEncodingHandlerPtr encoding;
00171        HashTable *class_map;
00172        int        features;
00173        HashTable  wsdl_cache;
00174        int        cur_uniq_ref;
00175        HashTable *ref_map;
00176 ZEND_END_MODULE_GLOBALS(soap)
00177 
00178 #ifdef ZTS
00179 #include "TSRM.h"
00180 #endif
00181 
00182 extern zend_module_entry soap_module_entry;
00183 #define soap_module_ptr &soap_module_entry
00184 #define phpext_soap_ptr soap_module_ptr
00185 
00186 ZEND_EXTERN_MODULE_GLOBALS(soap)
00187 
00188 #ifdef ZTS
00189 # define SOAP_GLOBAL(v) TSRMG(soap_globals_id, zend_soap_globals *, v)
00190 #else
00191 # define SOAP_GLOBAL(v) (soap_globals.v)
00192 #endif
00193 
00194 extern zend_class_entry* soap_var_class_entry;
00195 
00196 zval* add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC);
00197 
00198 #define soap_error0(severity, format) \
00199        php_error(severity, "SOAP-ERROR: " format)
00200 
00201 #define soap_error1(severity, format, param1) \
00202        php_error(severity, "SOAP-ERROR: " format, param1)
00203 
00204 #define soap_error2(severity, format, param1, param2) \
00205        php_error(severity, "SOAP-ERROR: " format, param1, param2)
00206 
00207 #define soap_error3(severity, format, param1, param2, param3) \
00208        php_error(severity, "SOAP-ERROR: " format, param1, param2, param3)
00209 
00210 #endif