2004-01-29 17:27:06 +08:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| PHP Version 5 |
|
|
|
|
+----------------------------------------------------------------------+
|
2012-01-01 21:15:04 +08:00
|
|
|
| Copyright (c) 1997-2012 The PHP Group |
|
2004-01-29 17:27:06 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 20:51:34 +08:00
|
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
2004-01-29 17:27:06 +08:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
|
|
| available through the world-wide-web at the following url: |
|
2006-01-01 20:51:34 +08:00
|
|
|
| http://www.php.net/license/3_01.txt |
|
2004-01-29 17:27:06 +08:00
|
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@php.net so we can mail you a copy immediately. |
|
|
|
|
+----------------------------------------------------------------------+
|
2004-01-29 19:51:11 +08:00
|
|
|
| Authors: Brad Lafountain <rodif_bl@yahoo.com> |
|
|
|
|
| Shane Caraveo <shane@caraveo.com> |
|
|
|
|
| Dmitry Stogov <dmitry@zend.com> |
|
2004-01-29 17:27:06 +08:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
/* $Id$ */
|
|
|
|
|
2002-07-08 07:03:43 +08:00
|
|
|
#ifndef PHP_SOAP_H
|
|
|
|
#define PHP_SOAP_H
|
|
|
|
|
|
|
|
#include "php.h"
|
|
|
|
#include "php_globals.h"
|
|
|
|
#include "ext/standard/info.h"
|
|
|
|
#include "ext/standard/php_standard.h"
|
2005-06-17 06:35:11 +08:00
|
|
|
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
|
2002-07-08 07:03:43 +08:00
|
|
|
#include "ext/session/php_session.h"
|
2005-06-17 06:35:11 +08:00
|
|
|
#endif
|
2002-07-08 07:03:43 +08:00
|
|
|
#include "ext/standard/php_smart_str.h"
|
|
|
|
#include "php_ini.h"
|
|
|
|
#include "SAPI.h"
|
|
|
|
#include <libxml/parser.h>
|
|
|
|
#include <libxml/xpath.h>
|
|
|
|
|
2003-03-05 22:23:56 +08:00
|
|
|
#ifndef PHP_HAVE_STREAMS
|
|
|
|
# error You lose - must be compiled against PHP 4.3.0 or later
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef PHP_WIN32
|
2002-07-08 07:03:43 +08:00
|
|
|
# define TRUE 1
|
|
|
|
# define FALSE 0
|
|
|
|
# define stricmp strcasecmp
|
|
|
|
#endif
|
|
|
|
|
2004-04-02 19:12:44 +08:00
|
|
|
extern int le_url;
|
|
|
|
|
2002-07-08 07:03:43 +08:00
|
|
|
typedef struct _encodeType encodeType, *encodeTypePtr;
|
|
|
|
typedef struct _encode encode, *encodePtr;
|
|
|
|
|
|
|
|
typedef struct _sdl sdl, *sdlPtr;
|
|
|
|
typedef struct _sdlRestrictionInt sdlRestrictionInt, *sdlRestrictionIntPtr;
|
|
|
|
typedef struct _sdlRestrictionChar sdlRestrictionChar, *sdlRestrictionCharPtr;
|
|
|
|
typedef struct _sdlRestrictions sdlRestrictions, *sdlRestrictionsPtr;
|
|
|
|
typedef struct _sdlType sdlType, *sdlTypePtr;
|
|
|
|
typedef struct _sdlParam sdlParam, *sdlParamPtr;
|
|
|
|
typedef struct _sdlFunction sdlFunction, *sdlFunctionPtr;
|
|
|
|
typedef struct _sdlAttribute sdlAttribute, *sdlAttributePtr;
|
2002-08-07 11:03:09 +08:00
|
|
|
typedef struct _sdlBinding sdlBinding, *sdlBindingPtr;
|
|
|
|
typedef struct _sdlSoapBinding sdlSoapBinding, *sdlSoapBindingPtr;
|
|
|
|
typedef struct _sdlSoapBindingFunction sdlSoapBindingFunction, *sdlSoapBindingFunctionPtr;
|
|
|
|
typedef struct _sdlSoapBindingFunctionBody sdlSoapBindingFunctionBody, *sdlSoapBindingFunctionBodyPtr;
|
2002-07-08 07:03:43 +08:00
|
|
|
|
|
|
|
typedef struct _soapMapping soapMapping, *soapMappingPtr;
|
|
|
|
typedef struct _soapService soapService, *soapServicePtr;
|
|
|
|
|
|
|
|
#include "php_xml.h"
|
|
|
|
#include "php_encoding.h"
|
|
|
|
#include "php_sdl.h"
|
|
|
|
#include "php_schema.h"
|
|
|
|
#include "php_http.h"
|
|
|
|
#include "php_packet_soap.h"
|
|
|
|
|
2004-01-10 02:22:03 +08:00
|
|
|
struct _soapMapping {
|
2006-09-20 21:42:52 +08:00
|
|
|
zval *to_xml;
|
|
|
|
zval *to_zval;
|
2002-07-08 07:03:43 +08:00
|
|
|
};
|
|
|
|
|
2006-03-21 20:04:55 +08:00
|
|
|
struct _soapHeader;
|
|
|
|
|
2004-01-10 02:22:03 +08:00
|
|
|
struct _soapService {
|
2002-07-08 07:03:43 +08:00
|
|
|
sdlPtr sdl;
|
|
|
|
|
2004-01-10 02:22:03 +08:00
|
|
|
struct _soap_functions {
|
2002-07-08 07:03:43 +08:00
|
|
|
HashTable *ft;
|
|
|
|
int functions_all;
|
|
|
|
} soap_functions;
|
|
|
|
|
2004-01-10 02:22:03 +08:00
|
|
|
struct _soap_class {
|
2002-07-08 07:03:43 +08:00
|
|
|
zend_class_entry *ce;
|
|
|
|
zval **argv;
|
|
|
|
int argc;
|
|
|
|
int persistance;
|
|
|
|
} soap_class;
|
|
|
|
|
2006-08-24 14:18:30 +08:00
|
|
|
zval *soap_object;
|
|
|
|
|
2006-09-20 21:42:52 +08:00
|
|
|
HashTable *typemap;
|
2004-02-04 00:44:57 +08:00
|
|
|
int version;
|
2004-02-03 00:19:39 +08:00
|
|
|
int type;
|
|
|
|
char *actor;
|
|
|
|
char *uri;
|
2004-08-11 00:11:41 +08:00
|
|
|
xmlCharEncodingHandlerPtr encoding;
|
2004-11-16 20:07:32 +08:00
|
|
|
HashTable *class_map;
|
2006-02-02 19:41:45 +08:00
|
|
|
int features;
|
2006-03-21 20:04:55 +08:00
|
|
|
struct _soapHeader **soap_headers_ptr;
|
2007-09-05 19:20:45 +08:00
|
|
|
int send_errors;
|
2002-07-08 07:03:43 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#define SOAP_CLASS 1
|
|
|
|
#define SOAP_FUNCTIONS 2
|
2006-08-24 14:18:30 +08:00
|
|
|
#define SOAP_OBJECT 3
|
2002-07-08 07:03:43 +08:00
|
|
|
#define SOAP_FUNCTIONS_ALL 999
|
|
|
|
|
|
|
|
#define SOAP_MAP_FUNCTION 1
|
|
|
|
#define SOAP_MAP_CLASS 2
|
|
|
|
|
|
|
|
#define SOAP_PERSISTENCE_SESSION 1
|
|
|
|
#define SOAP_PERSISTENCE_REQUEST 2
|
|
|
|
|
2004-01-08 23:27:50 +08:00
|
|
|
#define SOAP_1_1 1
|
|
|
|
#define SOAP_1_2 2
|
|
|
|
|
2004-02-04 00:44:57 +08:00
|
|
|
#define SOAP_ACTOR_NEXT 1
|
|
|
|
#define SOAP_ACTOR_NONE 2
|
|
|
|
#define SOAP_ACTOR_UNLIMATERECEIVER 3
|
|
|
|
|
|
|
|
#define SOAP_1_1_ACTOR_NEXT "http://schemas.xmlsoap.org/soap/actor/next"
|
|
|
|
|
|
|
|
#define SOAP_1_2_ACTOR_NEXT "http://www.w3.org/2003/05/soap-envelope/role/next"
|
|
|
|
#define SOAP_1_2_ACTOR_NONE "http://www.w3.org/2003/05/soap-envelope/role/none"
|
|
|
|
#define SOAP_1_2_ACTOR_UNLIMATERECEIVER "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"
|
|
|
|
|
2004-02-25 22:04:41 +08:00
|
|
|
#define SOAP_COMPRESSION_ACCEPT 0x20
|
|
|
|
#define SOAP_COMPRESSION_GZIP 0x00
|
|
|
|
#define SOAP_COMPRESSION_DEFLATE 0x10
|
|
|
|
|
2005-02-02 18:34:39 +08:00
|
|
|
#define SOAP_AUTHENTICATION_BASIC 0
|
|
|
|
#define SOAP_AUTHENTICATION_DIGEST 1
|
|
|
|
|
2006-02-02 19:41:45 +08:00
|
|
|
#define SOAP_SINGLE_ELEMENT_ARRAYS (1<<0)
|
2007-03-20 17:52:14 +08:00
|
|
|
#define SOAP_WAIT_ONE_WAY_CALLS (1<<1)
|
|
|
|
#define SOAP_USE_XSI_ARRAY_TYPE (1<<2)
|
2006-02-02 19:41:45 +08:00
|
|
|
|
2006-04-19 18:48:54 +08:00
|
|
|
#define WSDL_CACHE_NONE 0x0
|
|
|
|
#define WSDL_CACHE_DISK 0x1
|
|
|
|
#define WSDL_CACHE_MEMORY 0x2
|
|
|
|
#define WSDL_CACHE_BOTH 0x3
|
|
|
|
|
2002-07-08 07:03:43 +08:00
|
|
|
ZEND_BEGIN_MODULE_GLOBALS(soap)
|
2004-02-06 19:56:03 +08:00
|
|
|
HashTable defEncNs; /* mapping of default namespaces to prefixes */
|
|
|
|
HashTable defEnc;
|
|
|
|
HashTable defEncIndex;
|
2006-09-20 21:42:52 +08:00
|
|
|
HashTable *typemap;
|
2004-01-26 17:51:07 +08:00
|
|
|
int cur_uniq_ns;
|
|
|
|
int soap_version;
|
|
|
|
sdlPtr sdl;
|
|
|
|
zend_bool use_soap_error_handler;
|
2004-02-11 21:53:50 +08:00
|
|
|
char* error_code;
|
|
|
|
zval* error_object;
|
2008-01-10 00:45:48 +08:00
|
|
|
char cache;
|
|
|
|
char cache_mode;
|
|
|
|
char cache_enabled;
|
2004-02-10 21:41:21 +08:00
|
|
|
char* cache_dir;
|
|
|
|
long cache_ttl;
|
2006-04-19 18:48:54 +08:00
|
|
|
long cache_limit;
|
|
|
|
HashTable *mem_cache;
|
2004-08-11 00:11:41 +08:00
|
|
|
xmlCharEncodingHandlerPtr encoding;
|
2004-11-16 20:07:32 +08:00
|
|
|
HashTable *class_map;
|
2006-02-02 19:41:45 +08:00
|
|
|
int features;
|
2006-04-10 07:35:51 +08:00
|
|
|
HashTable wsdl_cache;
|
2007-04-02 21:43:08 +08:00
|
|
|
int cur_uniq_ref;
|
|
|
|
HashTable *ref_map;
|
2002-07-08 07:03:43 +08:00
|
|
|
ZEND_END_MODULE_GLOBALS(soap)
|
2004-01-13 23:58:01 +08:00
|
|
|
|
2003-03-14 10:08:30 +08:00
|
|
|
#ifdef ZTS
|
|
|
|
#include "TSRM.h"
|
|
|
|
#endif
|
2002-07-08 07:03:43 +08:00
|
|
|
|
2004-01-09 22:23:35 +08:00
|
|
|
extern zend_module_entry soap_module_entry;
|
|
|
|
#define soap_module_ptr &soap_module_entry
|
2004-01-13 23:58:01 +08:00
|
|
|
#define phpext_soap_ptr soap_module_ptr
|
2004-01-09 22:23:35 +08:00
|
|
|
|
2004-02-05 17:28:09 +08:00
|
|
|
ZEND_EXTERN_MODULE_GLOBALS(soap)
|
2002-07-08 07:03:43 +08:00
|
|
|
|
|
|
|
#ifdef ZTS
|
|
|
|
# define SOAP_GLOBAL(v) TSRMG(soap_globals_id, zend_soap_globals *, v)
|
|
|
|
#else
|
|
|
|
# define SOAP_GLOBAL(v) (soap_globals.v)
|
|
|
|
#endif
|
|
|
|
|
2004-01-06 00:44:01 +08:00
|
|
|
extern zend_class_entry* soap_var_class_entry;
|
2002-07-08 07:03:43 +08:00
|
|
|
|
2004-01-06 00:44:01 +08:00
|
|
|
zval* add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC);
|
2002-07-08 07:03:43 +08:00
|
|
|
|
2004-05-05 18:31:26 +08:00
|
|
|
#define soap_error0(severity, format) \
|
|
|
|
php_error(severity, "SOAP-ERROR: " format)
|
|
|
|
|
|
|
|
#define soap_error1(severity, format, param1) \
|
|
|
|
php_error(severity, "SOAP-ERROR: " format, param1)
|
|
|
|
|
|
|
|
#define soap_error2(severity, format, param1, param2) \
|
|
|
|
php_error(severity, "SOAP-ERROR: " format, param1, param2)
|
|
|
|
|
|
|
|
#define soap_error3(severity, format, param1, param2, param3) \
|
|
|
|
php_error(severity, "SOAP-ERROR: " format, param1, param2, param3)
|
|
|
|
|
2002-07-08 07:03:43 +08:00
|
|
|
#endif
|