php_soap.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2016 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
  16. | Shane Caraveo <shane@caraveo.com> |
  17. | Dmitry Stogov <dmitry@zend.com> |
  18. +----------------------------------------------------------------------+
  19. */
  20. /* $Id$ */
  21. #ifndef PHP_SOAP_H
  22. #define PHP_SOAP_H
  23. #include "php.h"
  24. #include "php_globals.h"
  25. #include "ext/standard/info.h"
  26. #include "ext/standard/php_standard.h"
  27. #if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
  28. #include "ext/session/php_session.h"
  29. #endif
  30. #include "ext/standard/php_smart_str.h"
  31. #include "php_ini.h"
  32. #include "SAPI.h"
  33. #include <libxml/parser.h>
  34. #include <libxml/xpath.h>
  35. #ifndef PHP_HAVE_STREAMS
  36. # error You lose - must be compiled against PHP 4.3.0 or later
  37. #endif
  38. #ifndef PHP_WIN32
  39. # define TRUE 1
  40. # define FALSE 0
  41. # define stricmp strcasecmp
  42. #endif
  43. extern int le_url;
  44. typedef struct _encodeType encodeType, *encodeTypePtr;
  45. typedef struct _encode encode, *encodePtr;
  46. typedef struct _sdl sdl, *sdlPtr;
  47. typedef struct _sdlRestrictionInt sdlRestrictionInt, *sdlRestrictionIntPtr;
  48. typedef struct _sdlRestrictionChar sdlRestrictionChar, *sdlRestrictionCharPtr;
  49. typedef struct _sdlRestrictions sdlRestrictions, *sdlRestrictionsPtr;
  50. typedef struct _sdlType sdlType, *sdlTypePtr;
  51. typedef struct _sdlParam sdlParam, *sdlParamPtr;
  52. typedef struct _sdlFunction sdlFunction, *sdlFunctionPtr;
  53. typedef struct _sdlAttribute sdlAttribute, *sdlAttributePtr;
  54. typedef struct _sdlBinding sdlBinding, *sdlBindingPtr;
  55. typedef struct _sdlSoapBinding sdlSoapBinding, *sdlSoapBindingPtr;
  56. typedef struct _sdlSoapBindingFunction sdlSoapBindingFunction, *sdlSoapBindingFunctionPtr;
  57. typedef struct _sdlSoapBindingFunctionBody sdlSoapBindingFunctionBody, *sdlSoapBindingFunctionBodyPtr;
  58. typedef struct _soapMapping soapMapping, *soapMappingPtr;
  59. typedef struct _soapService soapService, *soapServicePtr;
  60. #include "php_xml.h"
  61. #include "php_encoding.h"
  62. #include "php_sdl.h"
  63. #include "php_schema.h"
  64. #include "php_http.h"
  65. #include "php_packet_soap.h"
  66. struct _soapMapping {
  67. zval *to_xml;
  68. zval *to_zval;
  69. };
  70. struct _soapHeader;
  71. struct _soapService {
  72. sdlPtr sdl;
  73. struct _soap_functions {
  74. HashTable *ft;
  75. int functions_all;
  76. } soap_functions;
  77. struct _soap_class {
  78. zend_class_entry *ce;
  79. zval **argv;
  80. int argc;
  81. int persistance;
  82. } soap_class;
  83. zval *soap_object;
  84. HashTable *typemap;
  85. int version;
  86. int type;
  87. char *actor;
  88. char *uri;
  89. xmlCharEncodingHandlerPtr encoding;
  90. HashTable *class_map;
  91. int features;
  92. struct _soapHeader **soap_headers_ptr;
  93. int send_errors;
  94. };
  95. #define SOAP_CLASS 1
  96. #define SOAP_FUNCTIONS 2
  97. #define SOAP_OBJECT 3
  98. #define SOAP_FUNCTIONS_ALL 999
  99. #define SOAP_MAP_FUNCTION 1
  100. #define SOAP_MAP_CLASS 2
  101. #define SOAP_PERSISTENCE_SESSION 1
  102. #define SOAP_PERSISTENCE_REQUEST 2
  103. #define SOAP_1_1 1
  104. #define SOAP_1_2 2
  105. #define SOAP_ACTOR_NEXT 1
  106. #define SOAP_ACTOR_NONE 2
  107. #define SOAP_ACTOR_UNLIMATERECEIVER 3
  108. #define SOAP_1_1_ACTOR_NEXT "http://schemas.xmlsoap.org/soap/actor/next"
  109. #define SOAP_1_2_ACTOR_NEXT "http://www.w3.org/2003/05/soap-envelope/role/next"
  110. #define SOAP_1_2_ACTOR_NONE "http://www.w3.org/2003/05/soap-envelope/role/none"
  111. #define SOAP_1_2_ACTOR_UNLIMATERECEIVER "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"
  112. #define SOAP_COMPRESSION_ACCEPT 0x20
  113. #define SOAP_COMPRESSION_GZIP 0x00
  114. #define SOAP_COMPRESSION_DEFLATE 0x10
  115. #define SOAP_AUTHENTICATION_BASIC 0
  116. #define SOAP_AUTHENTICATION_DIGEST 1
  117. #define SOAP_SINGLE_ELEMENT_ARRAYS (1<<0)
  118. #define SOAP_WAIT_ONE_WAY_CALLS (1<<1)
  119. #define SOAP_USE_XSI_ARRAY_TYPE (1<<2)
  120. #define WSDL_CACHE_NONE 0x0
  121. #define WSDL_CACHE_DISK 0x1
  122. #define WSDL_CACHE_MEMORY 0x2
  123. #define WSDL_CACHE_BOTH 0x3
  124. /* New SOAP SSL Method Constants */
  125. #define SOAP_SSL_METHOD_TLS 0
  126. #define SOAP_SSL_METHOD_SSLv2 1
  127. #define SOAP_SSL_METHOD_SSLv3 2
  128. #define SOAP_SSL_METHOD_SSLv23 3
  129. ZEND_BEGIN_MODULE_GLOBALS(soap)
  130. HashTable defEncNs; /* mapping of default namespaces to prefixes */
  131. HashTable defEnc;
  132. HashTable defEncIndex;
  133. HashTable *typemap;
  134. int cur_uniq_ns;
  135. int soap_version;
  136. sdlPtr sdl;
  137. zend_bool use_soap_error_handler;
  138. char* error_code;
  139. zval* error_object;
  140. char cache;
  141. char cache_mode;
  142. char cache_enabled;
  143. char* cache_dir;
  144. long cache_ttl;
  145. long cache_limit;
  146. HashTable *mem_cache;
  147. xmlCharEncodingHandlerPtr encoding;
  148. HashTable *class_map;
  149. int features;
  150. HashTable wsdl_cache;
  151. int cur_uniq_ref;
  152. HashTable *ref_map;
  153. ZEND_END_MODULE_GLOBALS(soap)
  154. #ifdef ZTS
  155. #include "TSRM.h"
  156. #endif
  157. extern zend_module_entry soap_module_entry;
  158. #define soap_module_ptr &soap_module_entry
  159. #define phpext_soap_ptr soap_module_ptr
  160. ZEND_EXTERN_MODULE_GLOBALS(soap)
  161. #ifdef ZTS
  162. # define SOAP_GLOBAL(v) TSRMG(soap_globals_id, zend_soap_globals *, v)
  163. #else
  164. # define SOAP_GLOBAL(v) (soap_globals.v)
  165. #endif
  166. extern zend_class_entry* soap_var_class_entry;
  167. zval* add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC);
  168. #define soap_error0(severity, format) \
  169. php_error(severity, "SOAP-ERROR: " format)
  170. #define soap_error1(severity, format, param1) \
  171. php_error(severity, "SOAP-ERROR: " format, param1)
  172. #define soap_error2(severity, format, param1, param2) \
  173. php_error(severity, "SOAP-ERROR: " format, param1, param2)
  174. #define soap_error3(severity, format, param1, param2, param3) \
  175. php_error(severity, "SOAP-ERROR: " format, param1, param2, param3)
  176. #endif