~ubuntu-branches/ubuntu/quantal/php5/quantal

« back to all changes in this revision

Viewing changes to ext/soap/php_sdl.h

  • Committer: Bazaar Package Importer
  • Author(s): Sean Finney
  • Date: 2009-07-01 09:12:10 UTC
  • mto: (0.9.1) (1.1.17 upstream)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: james.westby@ubuntu.com-20090701091210-go0h6506p62on17r
Tags: upstream-5.3.0
ImportĀ upstreamĀ versionĀ 5.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  +----------------------------------------------------------------------+
 
3
  | PHP Version 5                                                        |
 
4
  +----------------------------------------------------------------------+
 
5
  | Copyright (c) 1997-2009 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: php_sdl.h,v 1.37.2.3.2.2.2.2 2008/12/31 11:15:43 sebastian Exp $ */
 
21
 
 
22
#ifndef PHP_SDL_H
 
23
#define PHP_SDL_H
 
24
 
 
25
#define XSD_WHITESPACE_COLLAPSE 1
 
26
#define XSD_WHITESPACE_PRESERVE 1
 
27
#define XSD_WHITESPACE_REPLACE  1
 
28
 
 
29
typedef enum _sdlBindingType {
 
30
        BINDING_SOAP = 1,
 
31
        BINDING_HTTP = 2
 
32
} sdlBindingType;
 
33
 
 
34
typedef enum _sdlEncodingStyle {
 
35
        SOAP_RPC      = 1,
 
36
        SOAP_DOCUMENT = 2
 
37
} sdlEncodingStyle;
 
38
 
 
39
typedef enum _sdlRpcEncodingStyle {
 
40
        SOAP_ENCODING_DEFAULT = 0,
 
41
        SOAP_ENCODING_1_1     = 1,
 
42
        SOAP_ENCODING_1_2     = 2
 
43
} sdlRpcEncodingStyle;
 
44
 
 
45
typedef enum _sdlEncodingUse {
 
46
        SOAP_ENCODED = 1,
 
47
        SOAP_LITERAL = 2
 
48
} sdlEncodingUse;
 
49
 
 
50
typedef enum _sdlTransport {
 
51
        SOAP_TRANSPORT_HTTP = 1
 
52
} sdlTransport;
 
53
 
 
54
struct _sdl {
 
55
        HashTable  functions;        /* array of sdlFunction */
 
56
        HashTable *types;            /* array of sdlTypesPtr */
 
57
        HashTable *elements;         /* array of sdlTypesPtr */
 
58
        HashTable *encoders;         /* array of encodePtr */
 
59
        HashTable *bindings;         /* array of sdlBindings (key'd by name) */
 
60
        HashTable *requests;         /* array of sdlFunction (references) */
 
61
        HashTable *groups;           /* array of sdlTypesPtr */
 
62
        char      *target_ns;
 
63
        char      *source;
 
64
        zend_bool  is_persistent;
 
65
};
 
66
 
 
67
typedef struct sdlCtx {
 
68
        sdlPtr     sdl;
 
69
 
 
70
        HashTable  docs;             /* array of xmlDocPtr */
 
71
 
 
72
        HashTable  messages;         /* array of xmlNodePtr */
 
73
        HashTable  bindings;         /* array of xmlNodePtr */
 
74
        HashTable  portTypes;        /* array of xmlNodePtr */
 
75
        HashTable  services;         /* array of xmlNodePtr */
 
76
 
 
77
        HashTable *attributes;       /* array of sdlAttributePtr */
 
78
        HashTable *attributeGroups;  /* array of sdlTypesPtr */
 
79
} sdlCtx;
 
80
 
 
81
struct _sdlBinding {
 
82
        char           *name;
 
83
        char           *location;
 
84
        sdlBindingType  bindingType;
 
85
        void           *bindingAttributes; /* sdlSoapBindingPtr */
 
86
};
 
87
 
 
88
/* Soap Binding Specfic stuff */
 
89
struct _sdlSoapBinding {
 
90
        sdlEncodingStyle  style;
 
91
        sdlTransport      transport; /* not implemented yet */
 
92
};
 
93
 
 
94
typedef struct _sdlSoapBindingFunctionHeader {
 
95
        char                *name;
 
96
        char                *ns;
 
97
        sdlEncodingUse       use;
 
98
        sdlTypePtr           element;
 
99
        encodePtr            encode;
 
100
        sdlRpcEncodingStyle  encodingStyle; /* not implemented yet */
 
101
        HashTable           *headerfaults;  /* array of sdlSoapBindingFunctionHeaderPtr */
 
102
} sdlSoapBindingFunctionHeader, *sdlSoapBindingFunctionHeaderPtr;
 
103
 
 
104
typedef struct _sdlSoapBindingFunctionFault {
 
105
        char                *ns;
 
106
        sdlEncodingUse       use;
 
107
        sdlRpcEncodingStyle  encodingStyle; /* not implemented yet */
 
108
} sdlSoapBindingFunctionFault, *sdlSoapBindingFunctionFaultPtr;
 
109
 
 
110
struct _sdlSoapBindingFunctionBody {
 
111
        char                *ns;
 
112
        sdlEncodingUse       use;
 
113
        sdlRpcEncodingStyle  encodingStyle;  /* not implemented yet */
 
114
        HashTable           *headers;        /* array of sdlSoapBindingFunctionHeaderPtr */
 
115
};
 
116
 
 
117
struct _sdlSoapBindingFunction {
 
118
        char                       *soapAction;
 
119
        sdlEncodingStyle            style;
 
120
 
 
121
        sdlSoapBindingFunctionBody  input;
 
122
        sdlSoapBindingFunctionBody  output;
 
123
};
 
124
 
 
125
struct _sdlRestrictionInt {
 
126
        int   value;
 
127
        char  fixed;
 
128
};
 
129
 
 
130
struct _sdlRestrictionChar {
 
131
        char *value;
 
132
        char  fixed;
 
133
};
 
134
 
 
135
struct _sdlRestrictions {
 
136
        HashTable *enumeration;              /* array of sdlRestrictionCharPtr */
 
137
        sdlRestrictionIntPtr minExclusive;
 
138
        sdlRestrictionIntPtr minInclusive;
 
139
        sdlRestrictionIntPtr maxExclusive;
 
140
        sdlRestrictionIntPtr maxInclusive;
 
141
        sdlRestrictionIntPtr totalDigits;
 
142
        sdlRestrictionIntPtr fractionDigits;
 
143
        sdlRestrictionIntPtr length;
 
144
        sdlRestrictionIntPtr minLength;
 
145
        sdlRestrictionIntPtr maxLength;
 
146
        sdlRestrictionCharPtr whiteSpace;
 
147
        sdlRestrictionCharPtr pattern;
 
148
};
 
149
 
 
150
typedef enum _sdlContentKind {
 
151
        XSD_CONTENT_ELEMENT,
 
152
        XSD_CONTENT_SEQUENCE,
 
153
        XSD_CONTENT_ALL,
 
154
        XSD_CONTENT_CHOICE,
 
155
        XSD_CONTENT_GROUP_REF,
 
156
        XSD_CONTENT_GROUP,
 
157
        XSD_CONTENT_ANY
 
158
} sdlContentKind;
 
159
 
 
160
 
 
161
typedef struct _sdlContentModel sdlContentModel, *sdlContentModelPtr;
 
162
 
 
163
struct _sdlContentModel {
 
164
        sdlContentKind kind;
 
165
        int min_occurs;
 
166
        int max_occurs;
 
167
        union {
 
168
                sdlTypePtr          element;      /* pointer to element */
 
169
                sdlTypePtr          group;        /* pointer to group */
 
170
                HashTable          *content;      /* array of sdlContentModel for sequnce,all,choice*/
 
171
                char               *group_ref;    /* reference to group */
 
172
        } u;
 
173
};
 
174
 
 
175
typedef enum _sdlTypeKind {
 
176
        XSD_TYPEKIND_SIMPLE,
 
177
        XSD_TYPEKIND_LIST,
 
178
        XSD_TYPEKIND_UNION,
 
179
        XSD_TYPEKIND_COMPLEX,
 
180
        XSD_TYPEKIND_RESTRICTION,
 
181
        XSD_TYPEKIND_EXTENSION
 
182
} sdlTypeKind;
 
183
 
 
184
typedef enum _sdlUse {
 
185
        XSD_USE_DEFAULT,
 
186
        XSD_USE_OPTIONAL,
 
187
        XSD_USE_PROHIBITED,
 
188
        XSD_USE_REQUIRED
 
189
} sdlUse;
 
190
 
 
191
typedef enum _sdlForm {
 
192
        XSD_FORM_DEFAULT,
 
193
        XSD_FORM_QUALIFIED,
 
194
        XSD_FORM_UNQUALIFIED
 
195
} sdlForm;
 
196
 
 
197
struct _sdlType {
 
198
        sdlTypeKind         kind;
 
199
        char               *name;
 
200
        char               *namens;
 
201
        char                nillable;
 
202
        HashTable          *elements;             /* array of sdlTypePtr */
 
203
        HashTable          *attributes;           /* array of sdlAttributePtr */
 
204
        sdlRestrictionsPtr  restrictions;
 
205
        encodePtr           encode;
 
206
        sdlContentModelPtr  model;
 
207
        char               *def;
 
208
        char               *fixed;
 
209
        char               *ref;
 
210
        sdlForm             form;
 
211
};
 
212
 
 
213
struct _sdlParam {
 
214
        int        order;
 
215
        sdlTypePtr element;
 
216
        encodePtr  encode;
 
217
        char      *paramName;
 
218
};
 
219
 
 
220
typedef struct _sdlFault {
 
221
        char      *name;
 
222
        HashTable *details;            /* array of sdlParamPtr */
 
223
        void      *bindingAttributes;  /* sdlSoapBindingFunctionFaultPtr */
 
224
} sdlFault, *sdlFaultPtr;
 
225
 
 
226
struct _sdlFunction {
 
227
        char               *functionName;
 
228
        char               *requestName;
 
229
        char               *responseName;
 
230
        HashTable          *requestParameters;  /* array of sdlParamPtr */
 
231
        HashTable          *responseParameters; /* array of sdlParamPtr (this should only be one) */
 
232
        struct _sdlBinding *binding;
 
233
        void               *bindingAttributes;  /* sdlSoapBindingFunctionPtr */
 
234
        HashTable          *faults;             /* array of sdlFaultPtr */
 
235
};
 
236
 
 
237
typedef struct _sdlExtraAttribute {
 
238
        char *ns;
 
239
        char *val;
 
240
} sdlExtraAttribute, *sdlExtraAttributePtr;
 
241
 
 
242
struct _sdlAttribute {
 
243
        char      *name;
 
244
        char      *namens;
 
245
        char      *ref;
 
246
        char      *def;
 
247
        char      *fixed;
 
248
        sdlForm    form;
 
249
        sdlUse     use;
 
250
        HashTable *extraAttributes;                     /* array of sdlExtraAttribute */
 
251
        encodePtr  encode;
 
252
};
 
253
 
 
254
 
 
255
sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC);
 
256
 
 
257
encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const xmlChar *type);
 
258
encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type);
 
259
encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat, int len);
 
260
 
 
261
sdlBindingPtr get_binding_from_type(sdlPtr sdl, int type);
 
262
sdlBindingPtr get_binding_from_name(sdlPtr sdl, char *name, char *ns);
 
263
 
 
264
void delete_sdl(void *handle);
 
265
void delete_sdl_impl(void *handle);
 
266
 
 
267
#endif