summaryrefslogtreecommitdiff
path: root/ext/soap/php_sdl.h
blob: f644efa3f09757b7f1d260c7f4bdc33433f401d5 (plain)
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
#ifndef PHP_SDL_H
#define PHP_SDL_H

#define XSD_WHITESPACE_COLLAPSE 1
#define XSD_WHITESPACE_PRESERVE 1
#define XSD_WHITESPACE_REPLACE 1

#define BINDING_SOAP 1
#define BINDING_HTTP 2

#define SOAP_RPC 1
#define SOAP_DOCUMENT 2

#define SOAP_ENCODED 1
#define SOAP_LITERAL 2

struct _sdl {
	HashTable	docs;				/* pointer to the parsed xml file */
	HashTable functions;	/* array of sdlFunction */
	HashTable *types;			/* array of sdlTypesPtr */
	HashTable *encoders;	/* array of encodePtr */
	HashTable *bindings;	/* array of sdlBindings (key'd by name) */
	char *target_ns;
	char *source;
};

struct _sdlBinding {
	char *name;
	char *location;
	int bindingType;
	void *bindingAttributes; /* sdlSoapBindingPtr */
};

/* Soap Binding Specfic stuff */
struct _sdlSoapBinding {
	char *transport;
	int style;
};

struct _sdlSoapBindingFunctionBody {
	char *ns;
	int use;
	char *parts;			/* not implemented yet */
	char *encodingStyle;	/* not implemented yet */
};

struct _sdlSoapBindingFunction {
	char *soapAction;
	int style;

	sdlSoapBindingFunctionBody input;
	sdlSoapBindingFunctionBody output;
	sdlSoapBindingFunctionBody falut;
};

/* HTTP Binding Specfic stuff */
/*********** not implemented yet ************
struct _sdlHttpBinding
{
	int holder;
};
*********************************************/

struct _sdlRestrictionInt {
	int value;
	char fixed;
	char *id;
};

struct _sdlRestrictionChar {
	char *value;
	char fixed;
	char *id;
};

struct _sdlRestrictions {
	HashTable *enumeration;				/* array of sdlRestrictionCharPtr */
	sdlRestrictionIntPtr minExclusive;
	sdlRestrictionIntPtr minInclusive;
	sdlRestrictionIntPtr maxExclusive;
	sdlRestrictionIntPtr maxInclusive;
	sdlRestrictionIntPtr totalDigits;
	sdlRestrictionIntPtr fractionDigits;
	sdlRestrictionIntPtr length;
	sdlRestrictionIntPtr minLength;
	sdlRestrictionIntPtr maxLength;
	sdlRestrictionCharPtr whiteSpace;
	sdlRestrictionCharPtr pattern;
};

struct _sdlType {
	char *name;
	char *namens;
	int nillable;
	int min_occurs;
	int max_occurs;
	HashTable *elements;				/* array of sdlTypePtr */
	HashTable *attributes;				/* array of sdlAttributePtr */
	sdlRestrictionsPtr restrictions;
	encodePtr encode;
};

struct _sdlParam {
	int order;
	encodePtr encode;
	char *paramName;
};

struct _sdlFunction {
	char *functionName;
	char *requestName;
	char *responseName;
	HashTable *requestParameters;		/* array of sdlParamPtr */
	HashTable *responseParameters;		/* array of sdlParamPtr (this should only be one) */
	struct _sdlBinding* binding;
//	int bindingType;
	void* bindingAttributes; /* sdlSoapBindingFunctionPtr */
};

struct _sdlAttribute {
	char *def;
	char *fixed;
	char *form;
	char *id;
	char *name;
	char *ref;
	char *type;
	char *use;
	HashTable *extraAttributes;			/* array of xmlNodePtr */
};

sdlPtr get_sdl(char *uri);

encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const char *type);
encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type);
encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat);
encodePtr get_create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, const char *type);
encodePtr create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, const char *type);

sdlBindingPtr get_binding_from_type(sdlPtr sdl, int type);
sdlBindingPtr get_binding_from_name(sdlPtr sdl, char *name, char *ns);

xmlNodePtr sdl_guess_convert_xml(encodeType enc, zval* data, int style);
zval *sdl_guess_convert_zval(encodeType enc, xmlNodePtr data);

void delete_sdl(void *handle);
void delete_type(void *type);
void delete_attribute(void *attribute);
void delete_mapping(void *data);
#endif