1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| 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. |
+----------------------------------------------------------------------+
| Authors: Brad Lafountain <rodif_bl@yahoo.com> |
| Shane Caraveo <shane@caraveo.com> |
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#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"
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
#include "ext/session/php_session.h"
#endif
#include "ext/standard/php_smart_str.h"
#include "php_ini.h"
#include "SAPI.h"
#include <libxml/parser.h>
#include <libxml/xpath.h>
#ifndef PHP_HAVE_STREAMS
# error You lose - must be compiled against PHP 4.3.0 or later
#endif
#ifndef PHP_WIN32
# define TRUE 1
# define FALSE 0
# define stricmp strcasecmp
#endif
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;
typedef struct _sdlBinding sdlBinding, *sdlBindingPtr;
typedef struct _sdlSoapBinding sdlSoapBinding, *sdlSoapBindingPtr;
typedef struct _sdlSoapBindingFunction sdlSoapBindingFunction, *sdlSoapBindingFunctionPtr;
typedef struct _sdlSoapBindingFunctionBody sdlSoapBindingFunctionBody, *sdlSoapBindingFunctionBodyPtr;
typedef struct _soapMapping soapMapping, *soapMappingPtr;
#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"
struct _soapMapping {
zval *to_xml;
zval *to_zval;
};
struct _soapHeader;
typedef struct _soap_server_object {
zend_object zo;
sdlPtr sdl;
char *uri;
int version;
HashTable *class_map;
HashTable *typemap;
int features;
xmlCharEncodingHandlerPtr encoding;
struct _soap_functions {
HashTable *ft;
int functions_all;
} soap_functions;
struct _soap_class {
zend_class_entry *ce;
zval **argv;
int argc;
int persistance;
} soap_class;
zval *soap_object;
int type;
char *actor;
struct _soapHeader **soap_headers_ptr;
int send_errors;
} soap_server_object;
typedef struct _soap_client_object {
zend_object zo;
sdlPtr sdl;
char *uri;
int version;
HashTable *class_map;
HashTable *typemap;
int features;
xmlCharEncodingHandlerPtr encoding;
int style;
int use;
char *location;
char *login;
char *password;
long digest;
long digest_nc;
char *digest_realm;
char *digest_algorithm;
char *digest_nonce;
char *digest_qop;
char *digest_opaque;
char *proxy_host;
long proxy_port;
char *proxy_login;
char *proxy_password;
char *user_agent;
long connection_timeout;
long compression;
php_stream_context *stream_context;
php_stream *stream;
php_url *url;
zend_bool use_proxy;
zend_bool exceptions;
zend_bool trace;
char *last_request_headers;
char *last_request;
char *last_response_headers;
char *last_response;
zval *default_headers;
zval *cookies;
zval *fault;
} soap_client_object;
#define SOAP_CLASS 1
#define SOAP_FUNCTIONS 2
#define SOAP_OBJECT 3
#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
#define SOAP_1_1 1
#define SOAP_1_2 2
#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"
#define SOAP_COMPRESSION_ACCEPT 0x20
#define SOAP_COMPRESSION_GZIP 0x00
#define SOAP_COMPRESSION_DEFLATE 0x10
#define SOAP_AUTHENTICATION_BASIC 0
#define SOAP_AUTHENTICATION_DIGEST 1
#define SOAP_SINGLE_ELEMENT_ARRAYS (1<<0)
#define SOAP_WAIT_ONE_WAY_CALLS (1<<1)
#define SOAP_USE_XSI_ARRAY_TYPE (1<<2)
#define WSDL_CACHE_NONE 0x0
#define WSDL_CACHE_DISK 0x1
#define WSDL_CACHE_MEMORY 0x2
#define WSDL_CACHE_BOTH 0x3
ZEND_BEGIN_MODULE_GLOBALS(soap)
HashTable defEncNs; /* mapping of default namespaces to prefixes */
HashTable defEnc;
HashTable defEncIndex;
HashTable *typemap;
int cur_uniq_ns;
int soap_version;
sdlPtr sdl;
zend_bool use_soap_error_handler;
char* error_code;
zval* error_object;
long cache;
char* cache_dir;
long cache_ttl;
long cache_limit;
HashTable *mem_cache;
xmlCharEncodingHandlerPtr encoding;
HashTable *class_map;
int features;
HashTable wsdl_cache;
int cur_uniq_ref;
HashTable *ref_map;
ZEND_END_MODULE_GLOBALS(soap)
#ifdef PHP_WIN32
#define PHP_SOAP_API __declspec(dllexport)
#else
#define PHP_SOAP_API
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
extern zend_module_entry soap_module_entry;
#define soap_module_ptr &soap_module_entry
#define phpext_soap_ptr soap_module_ptr
ZEND_EXTERN_MODULE_GLOBALS(soap)
#ifdef ZTS
# define SOAP_GLOBAL(v) TSRMG(soap_globals_id, zend_soap_globals *, v)
#else
# define SOAP_GLOBAL(v) (soap_globals.v)
#endif
extern zend_class_entry* soap_var_class_entry;
zval* add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC);
#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)
char* soap_unicode_to_string(UChar *ustr, int ustr_len TSRMLS_DC);
void soap_decode_string(zval *ret, char* str TSRMLS_DC);
char* soap_encode_string(zval *data, int* len TSRMLS_DC);
char* soap_encode_string_ex(zend_uchar type, zstr data, int len TSRMLS_DC);
#endif
|