0
|
1 /*
|
|
2 wsdl.h
|
|
3
|
|
4 WSDL 1.1 and WSDL 2.0 schemas
|
|
5
|
|
6 --------------------------------------------------------------------------------
|
|
7 gSOAP XML Web services tools
|
|
8 Copyright (C) 2000-2013, Robert van Engelen, Genivia Inc. All Rights Reserved.
|
|
9 This software is released under one of the following licenses:
|
|
10 GPL or Genivia's license for commercial use.
|
|
11 --------------------------------------------------------------------------------
|
|
12 GPL license.
|
|
13
|
|
14 This program is free software; you can redistribute it and/or modify it under
|
|
15 the terms of the GNU General Public License as published by the Free Software
|
|
16 Foundation; either version 2 of the License, or (at your option) any later
|
|
17 version.
|
|
18
|
|
19 This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
20 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
21 PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
22
|
|
23 You should have received a copy of the GNU General Public License along with
|
|
24 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
|
25 Place, Suite 330, Boston, MA 02111-1307 USA
|
|
26
|
|
27 Author contact information:
|
|
28 engelen@genivia.com / engelen@acm.org
|
|
29 --------------------------------------------------------------------------------
|
|
30 A commercial use license is available from Genivia, Inc., contact@genivia.com
|
|
31 --------------------------------------------------------------------------------
|
|
32 */
|
|
33
|
|
34 //gsoapopt w
|
|
35
|
|
36 //gsoap wsdl schema documentation: WSDL 1.1/2.0 binding schema
|
|
37 //gsoap wsdl schema namespace: http://schemas.xmlsoap.org/wsdl/
|
|
38 //gsoap wsdl schema namespace2: http://www.w3.org/ns/wsdl
|
|
39 //gsoap wsdl schema elementForm: qualified
|
|
40 //gsoap wsdl schema attributeForm: unqualified
|
|
41
|
|
42 #import "imports.h"
|
|
43 #import "schema.h"
|
|
44 #import "soap.h"
|
|
45 #import "mime.h"
|
|
46 #import "dime.h"
|
|
47 #import "http.h"
|
|
48 #import "gwsdl.h"
|
|
49 #import "wsam.h"
|
|
50 #import "wsp.h"
|
|
51
|
|
52 class wsdl__definitions; // forward declaration
|
|
53
|
|
54 class wsdl__import
|
|
55 { public:
|
|
56 @xsd__anyURI namespace_;
|
|
57 @xsd__anyURI location;
|
|
58 private:
|
|
59 wsdl__definitions *definitionsRef;
|
|
60 public:
|
|
61 wsdl__import();
|
|
62 int preprocess(wsdl__definitions&);
|
|
63 int traverse(wsdl__definitions&);
|
|
64 void definitionsPtr(wsdl__definitions*);
|
|
65 wsdl__definitions *definitionsPtr() const;
|
|
66 };
|
|
67
|
|
68 class wsdl__types : public xs__schema // WSDL 2.0 <types> inlined schema
|
|
69 { public:
|
|
70 xsd__string documentation; // <wsdl:documentation>?
|
|
71 std::vector<xs__schema*> xs__schema_; // <xs:schema>*
|
|
72 public:
|
|
73 int preprocess(wsdl__definitions&);
|
|
74 int traverse(wsdl__definitions&);
|
|
75 };
|
|
76
|
|
77 class wsdl__part
|
|
78 { public:
|
|
79 @xsd__NMTOKEN name;
|
|
80 @xsd__QName element;
|
|
81 @xsd__QName type;
|
|
82 xsd__string documentation; // <wsdl:documentation>?
|
|
83 private:
|
|
84 xs__element *elementRef; // traverse() finds element
|
|
85 xs__simpleType *simpleTypeRef; // traverse() finds simpleType
|
|
86 xs__complexType *complexTypeRef; // traverse() finds complexType
|
|
87 public:
|
|
88 wsdl__part();
|
|
89 int traverse(wsdl__definitions&);
|
|
90 void elementPtr(xs__element*);
|
|
91 void simpleTypePtr(xs__simpleType*);
|
|
92 void complexTypePtr(xs__complexType*);
|
|
93 xs__element *elementPtr() const;
|
|
94 xs__simpleType *simpleTypePtr() const;
|
|
95 xs__complexType *complexTypePtr() const;
|
|
96 };
|
|
97
|
|
98 class wsdl__message
|
|
99 { public:
|
|
100 @xsd__NMTOKEN name;
|
|
101 xsd__string documentation; // <wsdl:documentation>?
|
|
102 std::vector<wsp__Policy> wsp__Policy_; // <wsp:Policy>*
|
|
103 std::vector<wsp__PolicyReference> wsp__PolicyReference_;// <wsp:PolicyReference>*
|
|
104 std::vector<wsdl__part> part; // <wsdl:part>*
|
|
105 public:
|
|
106 int traverse(wsdl__definitions&);
|
|
107 };
|
|
108
|
|
109 class wsdl__ioput
|
|
110 { public:
|
|
111 @xsd__NMTOKEN name;
|
|
112 @xsd__QName message;
|
|
113 @xsd__NMTOKEN messageLabel; // WSDL 2.0
|
|
114 @xsd__QName element; // WSDL 2.0
|
|
115 @xsd__anyURI wsa__Action;
|
|
116 @xsd__anyURI wsam__Action;
|
|
117 xsd__string documentation; // <wsdl:documentation>?
|
|
118 wsp__Policy *wsp__Policy_; // <wsp:Policy>?
|
|
119 wsp__PolicyReference *wsp__PolicyReference_; // <wsp:PolicyReference>?
|
|
120 private:
|
|
121 wsdl__message *messageRef; // traverse() finds message
|
|
122 xs__element *elementRef; // traverse() finds element WSDL 2.0
|
|
123 public:
|
|
124 wsdl__ioput();
|
|
125 int traverse(wsdl__definitions&);
|
|
126 void messagePtr(wsdl__message*);
|
|
127 wsdl__message *messagePtr() const;
|
|
128 void elementPtr(xs__element*);
|
|
129 xs__element *elementPtr() const;
|
|
130 };
|
|
131
|
|
132 class wsdl__fault
|
|
133 { public:
|
|
134 @xsd__NMTOKEN name;
|
|
135 @xsd__QName message;
|
|
136 @xsd__QName ref; // WSDL 2.0
|
|
137 @xsd__NMTOKEN messageLabel; // WSDL 2.0
|
|
138 @xsd__QName element; // WSDL 2.0
|
|
139 @xsd__anyURI wsa__Action;
|
|
140 @xsd__anyURI wsam__Action;
|
|
141 xsd__string documentation; // <wsdl:documentation>?
|
|
142 wsp__Policy *wsp__Policy_; // <wsp:Policy>?
|
|
143 wsp__PolicyReference *wsp__PolicyReference_; // <wsp:PolicyReference>?
|
|
144 private:
|
|
145 wsdl__message *messageRef; // traverse() finds message
|
|
146 xs__element *elementRef; // traverse() finds element WSDL 2.0
|
|
147 public:
|
|
148 wsdl__fault();
|
|
149 int traverse(wsdl__definitions&);
|
|
150 void messagePtr(wsdl__message*);
|
|
151 wsdl__message *messagePtr() const;
|
|
152 void elementPtr(xs__element*);
|
|
153 xs__element *elementPtr() const;
|
|
154 };
|
|
155
|
|
156 class wsdl__operation
|
|
157 { public:
|
|
158 @xsd__NMTOKEN name;
|
|
159 @xsd__anyURI pattern; // WSDL 2.0
|
|
160 @xsd__anyURI style; // WSDL 2.0
|
|
161 @xsd__string wrpc__signature; // WSDL 2.0
|
|
162 @xsd__string parameterOrder;
|
|
163 xsd__string documentation; // <wsdl:documentation>?
|
|
164 wsp__Policy *wsp__Policy_; // <wsp:Policy>?
|
|
165 wsp__PolicyReference *wsp__PolicyReference_; // <wsp:PolicyReference>?
|
|
166 $int __union1;
|
|
167 union wsdl__union_ioput // <wsdl:input>|<wsdl:output>
|
|
168 { wsdl__ioput *input;
|
|
169 wsdl__ioput *output;
|
|
170 } __ioput1;
|
|
171 $int __union2;
|
|
172 union wsdl__union_ioput __ioput2; // <wsdl:input>|<wsdl:output>
|
|
173 std::vector<wsdl__fault> fault; // <wsdl:fault>*
|
|
174 std::vector<wsdl__fault> infault; // <wsdl:infault>* WSDL 2.0
|
|
175 std::vector<wsdl__fault> outfault; // <wsdl:outfault>* WSDL 2.0
|
|
176 public:
|
|
177 int traverse(wsdl__definitions&);
|
|
178 };
|
|
179
|
|
180 class wsdl__portType // ... and WSDL 2.0 interface
|
|
181 { public:
|
|
182 @xsd__NMTOKEN name;
|
|
183 @xsd__QName extends; // WSDL 2.0
|
|
184 @xsd__anyURI styleDefault; // WSDL 2.0
|
|
185 xsd__string documentation; // <wsdl:documentation>?
|
|
186 wsp__Policy *wsp__Policy_; // <wsp:Policy>?
|
|
187 wsp__PolicyReference *wsp__PolicyReference_; // <wsp:PolicyReference>?
|
|
188 std::vector<wsdl__fault> fault; // <wsdl:fault>* WSDL 2.0
|
|
189 std::vector<wsdl__operation> operation; // <wsdl:operation>*
|
|
190 private:
|
|
191 wsdl__definitions *definitionsRef;
|
|
192 public:
|
|
193 wsdl__portType();
|
|
194 int traverse(wsdl__definitions&);
|
|
195 void definitionsPtr(wsdl__definitions*);
|
|
196 wsdl__definitions *definitionsPtr() const;
|
|
197 };
|
|
198
|
|
199 class wsdl__ext_ioput // binding extensibility element
|
|
200 { public:
|
|
201 @xsd__NMTOKEN name;
|
|
202 @xsd__NMTOKEN messageLabel; // WSDL 2.0
|
|
203 xsd__string documentation; // <wsdl:documentation>?
|
|
204 wsp__Policy *wsp__Policy_; // <wsp:Policy>?
|
|
205 wsp__PolicyReference *wsp__PolicyReference_; // <wsp:PolicyReference>?
|
|
206 dime__message *dime__message_; // <dime:message>?
|
|
207 soap__body *soap__body_; // <soap:body>?
|
|
208 xsd__string http__urlEncoded; // <http:urlEncoded>?
|
|
209 mime__multipartRelated *mime__multipartRelated_;// <mime:multipartRelated>?
|
|
210 mime__content *mime__content_; // <mime:content>?
|
|
211 mime__mimeXml *mime__mimeXml_; // <mime:mimeXml>?
|
|
212 std::vector<soap__header> soap__header_; // <soap:header>*
|
|
213 std::vector<wsoap__module> wsoap__module_; // <wsoap:module>* WSDL 2.0
|
|
214 std::vector<wsoap__header> wsoap__header_; // <wsoap:header>* WSDL 2.0
|
|
215 std::vector<whttp__header> whttp__header_; // <whttp:header>* WSDL 2.0
|
|
216 public:
|
|
217 int traverse(wsdl__definitions&);
|
|
218 };
|
|
219
|
|
220 class wsdl__ext_fault // binding extensibility element
|
|
221 { public:
|
|
222 @xsd__NMTOKEN name;
|
|
223 @xsd__QName ref; // WSDL 2.0
|
|
224 @xsd__NMTOKEN messageLabel; // WSDL 2.0
|
|
225 @xsd__QName wsoap__code; // WSDL 2.0
|
|
226 @xsd__QName wsoap__subcodes; // WSDL 2.0
|
|
227 xsd__string documentation; // <wsdl:documentation>?
|
|
228 wsp__Policy *wsp__Policy_; // <wsp:Policy>?
|
|
229 wsp__PolicyReference *wsp__PolicyReference_; // <wsp:PolicyReference>?
|
|
230 soap__fault *soap__fault_; // <soap:fault>?
|
|
231 std::vector<wsoap__module> wsoap__module_; // <wsoap:module>* WSDL 2.0
|
|
232 private:
|
|
233 wsdl__fault *faultRef;
|
|
234 public:
|
|
235 wsdl__ext_fault();
|
|
236 int traverse(wsdl__definitions&, wsdl__portType*);
|
|
237 void faultPtr(wsdl__fault*);
|
|
238 wsdl__fault *faultPtr() const;
|
|
239 };
|
|
240
|
|
241 class wsdl__ext_operation // binding extensibility element
|
|
242 { public:
|
|
243 @xsd__NMTOKEN name;
|
|
244 @xsd__QName ref; // WSDL 2.0
|
|
245 @xsd__anyURI wsoap__mep; // WSDL 2.0
|
|
246 @xsd__anyURI wsoap__action; // WSDL 2.0
|
|
247 @xsd__string whttp__method; // WSDL 2.0
|
|
248 @xsd__string whttp__location; // WSDL 2.0
|
|
249 xsd__string documentation; // <wsdl:documentation>?
|
|
250 wsp__Policy *wsp__Policy_; // <wsp:Policy>?
|
|
251 wsp__PolicyReference *wsp__PolicyReference_; // <wsp:PolicyReference>?
|
|
252 soap__operation *soap__operation_; // <soap:operation>?
|
|
253 http__operation *http__operation_; // <http:operation>?
|
|
254 wsdl__ext_ioput *input; // <wsdl:input>?
|
|
255 wsdl__ext_ioput *output; // <wsdl:output>?
|
|
256 std::vector<wsdl__ext_fault> fault; // <wsdl:fault>*
|
|
257 std::vector<wsdl__ext_fault> infault; // <wsdl:infault>* WSDL 2.0
|
|
258 std::vector<wsdl__ext_fault> outfault; // <wsdl:outfault>* WSDL 2.0
|
|
259 private:
|
|
260 wsdl__operation *operationRef; // traverse() finds operation
|
|
261 public:
|
|
262 wsdl__ext_operation();
|
|
263 int traverse(wsdl__definitions&, wsdl__portType*);
|
|
264 void operationPtr(wsdl__operation*);
|
|
265 wsdl__operation *operationPtr() const;
|
|
266 };
|
|
267
|
|
268 class wsdl__binding
|
|
269 { public:
|
|
270 @xsd__NMTOKEN name;
|
|
271 @xsd__QName type;
|
|
272 @xsd__anyURI type_; // WSDL 2.0
|
|
273 @xsd__QName interface_; // WSDL 2.0
|
|
274 @xsd__boolean whttp__cookies = false; // WSDL 2.0
|
|
275 @xsd__string wsoap__version; // WSDL 2.0
|
|
276 @xsd__anyURI wsoap__protocol; // WSDL 2.0
|
|
277 @xsd__anyURI wsoap__mepDefault; // WSDL 2.0
|
|
278 @xsd__string whttp__methodDefault; // WSDL 2.0
|
|
279 xsd__string documentation; // <wsdl:documentation>?
|
|
280 std::vector<wsp__Policy> wsp__Policy_; // <wsp:Policy>*
|
|
281 std::vector<wsp__PolicyReference> wsp__PolicyReference_;// <wsp:PolicyReference>*
|
|
282 soap__binding *soap__binding_; // <soap:binding>?
|
|
283 http__binding *http__binding_; // <http:binding>?
|
|
284 std::vector<wsoap__module> wsoap__module_; // <wsoap:module>* WSDL 2.0
|
|
285 std::vector<wsdl__ext_fault> fault; // <wsdl:fault>* WSDL 2.0
|
|
286 std::vector<wsdl__ext_operation> operation; // <wsdl:operation>*
|
|
287 private:
|
|
288 wsdl__portType *portTypeRef; // traverse() finds portType/interface
|
|
289 public:
|
|
290 wsdl__binding();
|
|
291 int traverse(wsdl__definitions&);
|
|
292 void portTypePtr(wsdl__portType*);
|
|
293 wsdl__portType *portTypePtr() const;
|
|
294 };
|
|
295
|
|
296 class wsdl__port // ... and WSDL 2.0 endpoint
|
|
297 { public:
|
|
298 @xsd__NMTOKEN name;
|
|
299 @xsd__QName binding;
|
|
300 @xsd__anyURI address; // WSDL 2.0
|
|
301 @xsd__NMTOKEN whttp__authenticationScheme; // WSDL 2.0
|
|
302 @xsd__NMTOKEN whttp__authenticationRealm; // WSDL 2.0
|
|
303 xsd__string documentation; // <wsdl:documentation>?
|
|
304 wsp__Policy *wsp__Policy_; // <wsp:Policy>?
|
|
305 wsp__PolicyReference *wsp__PolicyReference_; // <wsp:PolicyReference>?
|
|
306 wsa__EndpointReferenceType *wsa__EndpointReference;// <wsa:EndpointReference>?
|
|
307 soap__address *soap__address_; // <soap:address>?
|
|
308 http__address *http__address_; // <http:address>?
|
|
309 private:
|
|
310 wsdl__binding *bindingRef; // traverse() finds binding
|
|
311 public:
|
|
312 wsdl__port();
|
|
313 int traverse(wsdl__definitions&);
|
|
314 void bindingPtr(wsdl__binding*);
|
|
315 wsdl__binding *bindingPtr() const;
|
|
316 };
|
|
317
|
|
318 class wsdl__service
|
|
319 { public:
|
|
320 @xsd__NMTOKEN name;
|
|
321 @xsd__QName interface_; // WSDL 2.0
|
|
322 xsd__string documentation; // <wsdl:documentation>?
|
|
323 std::vector<wsp__Policy> wsp__Policy_; // <wsp:Policy>*
|
|
324 std::vector<wsp__PolicyReference> wsp__PolicyReference_;// <wsp:PolicyReference>*
|
|
325 std::vector<wsdl__port> port; // <wsdl:port>* WSDL 1.1
|
|
326 std::vector<wsdl__port> endpoint; // <wsdl:port>* WSDL 2.0
|
|
327 public:
|
|
328 int traverse(wsdl__definitions&);
|
|
329 };
|
|
330
|
|
331 class wsdl__definitions
|
|
332 { public:
|
|
333 @xsd__NMTOKEN name;
|
|
334 @xsd__anyURI targetNamespace = "";
|
|
335 @xsd__NMTOKEN version;
|
|
336 std::vector<wsdl__import> import; // <wsdl:import>*
|
|
337 xsd__string documentation; // <wsdl:documentation>?
|
|
338 xsd__string wsp__UsingPolicy; // <wsp:UsingPolcy>?
|
|
339 std::vector<wsp__Policy> wsp__Policy_; // <wsp:Policy>*
|
|
340 wsdl__types *types; // <wsdl:types>?
|
|
341 std::vector<wsdl__message> message; // <wsdl:message>*
|
|
342 std::vector<wsdl__portType> portType; // <wsdl:portType>* WSDL 1.1
|
|
343 std::vector<wsdl__portType> interface_; // <wsdl:interface>* WSDL 2.0
|
|
344 std::vector<wsdl__binding> binding; // <wsdl:binding>*
|
|
345 std::vector<wsdl__service> service; // <wsdl:service>*
|
|
346 std::vector<gwsdl__portType> gwsdl__portType_; // <gwsdl:portType>* For the moment, we will hardcode this which makes it easier to access. WSDL 1.1 does not allow this to be extended anyway
|
|
347 struct soap *soap;
|
|
348 private:
|
|
349 bool soap12;
|
|
350 bool updated;
|
|
351 char* location;
|
|
352 int redirs;
|
|
353 SetOfString builtinTypeSet;
|
|
354 SetOfString builtinElementSet;
|
|
355 SetOfString builtinAttributeSet;
|
|
356 public:
|
|
357 wsdl__definitions();
|
|
358 wsdl__definitions(struct soap*, const char*, const char*);
|
|
359 virtual ~wsdl__definitions();
|
|
360 int get(struct soap*); // gSOAP getter is triggered after parsing
|
|
361 int preprocess();
|
|
362 int traverse();
|
|
363 int read(int, char**);
|
|
364 int read(const char *cwd, const char*);
|
|
365 const char* sourceLocation();
|
|
366 int error();
|
|
367 void print_fault();
|
|
368 void builtinType(const char*);
|
|
369 void builtinTypes(const SetOfString&);
|
|
370 void builtinElement(const char*);
|
|
371 void builtinElements(const SetOfString&);
|
|
372 void builtinAttribute(const char*);
|
|
373 void builtinAttributes(const SetOfString&);
|
|
374 const SetOfString& builtinTypes() const;
|
|
375 const SetOfString& builtinElements() const;
|
|
376 const SetOfString& builtinAttributes() const;
|
|
377 friend ostream& operator<<(ostream&, const wsdl__definitions&);
|
|
378 friend istream& operator>>(istream&, wsdl__definitions&);
|
|
379 };
|
|
380
|
|
381 extern ostream &operator<<(ostream &o, const wsdl__definitions &e);
|
|
382 extern istream &operator>>(istream &i, wsdl__definitions &e);
|