Qore WSDL Module Reference  0.3.6
WSDL.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* WSDL.qm Copyright (C) 2012 - 2018 Qore Technologies, s.r.o.
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 */
24 
25 // make sure we have the required qore version
26 
27 // requires XML functionality
28 
29 // need mime definitions
30 
31 // do not use $ for vars
32 
33 // allow the use of the := weak reference assignment operator
34 
35 
36 
37 /*
38  WSDL classes
39  provides some minimal WSDL and XSD support for SOAP messaging used by the SoapClient class and the SoapHandler
40 
41  not complete, needs namespace verification, improved XSD support, element groups, etc
42 */
43 
129 namespace WSDL {
132  const version = "0.3.6";
133 
135  const SOAP_11_ENV = "http://schemas.xmlsoap.org/soap/envelope/";
137  const SOAP_12_ENV = "http://www.w3.org/2003/05/soap-envelope";
138 
140  const SOAP_11_NS = "http://schemas.xmlsoap.org/wsdl/soap/";
141 
143  const SOAP_12_NS = "http://schemas.xmlsoap.org/wsdl/soap12/";
144 
146  const XSD_NS = "http://www.w3.org/2001/XMLSchema";
148  const XSI_NS = "http://www.w3.org/2001/XMLSchema-instance";
149 
151  const HTTP_NS = "http://schemas.xmlsoap.org/wsdl/http/";
153  const MIME_NS = "http://schemas.xmlsoap.org/wsdl/mime/";
154 
156  const ENVELOPE_11_NS = (
157  "soapenv:Envelope": (
158  "^attributes^": (
159  "xmlns:soapenv": SOAP_11_ENV,
160  "xmlns:xsd": XSD_NS,
161  "xmlns:xsi": XSI_NS,
162  ),
163  ),
164  );
165 
167  const ENVELOPE_12_NS = (
168  "soapenv:Envelope": (
169  "^attributes^": (
170  "xmlns:soapenv": SOAP_12_ENV,
171  "xmlns:xsd": XSD_NS,
172  "xmlns:xsi": XSI_NS,
173  ),
174  ),
175  );
176 
178  const SoapUseMap = (
179  "encoded": True,
180  "literal": False,
181  );
182 
184  const SoapStyleMap = (
185  "document": True,
186  "rpc": False,
187  );
188 
190  const SOAP_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
191 
193  const any_type_map = (
194  Type::String : "string",
195  Type::Int : "long",
196  Type::Boolean : "boolean",
197  Type::Date : "dateTime",
198  Type::Float : "decimal",
199  Type::NothingType : "string",
200  Type::NullType : "string",
201  Type::Binary : "base64Binary",
202  );
203 
204  // error codes
205  const SOAP_SERIALIZATION_ERROR = "SOAP-SERIALIZATION-ERROR";
206  const SOAP_DESERIALIZATION_ERROR = "SOAP-DESERIALIZATION-ERROR";
207  const WSDL_ERROR = "WSDL-ERROR";
208 
210  const SOAP_TRANSPORT_HTTP = "http://schemas.xmlsoap.org/soap/http";
211 
213  const SOAP_TRANSPORT = (
214  SOAP_TRANSPORT_HTTP: True,
215  );
216 
218  const RANGE_SHORT = (-32768, 32767);
219 
221  const RANGE_INT = (-2147483648, 2147483647);
222 
223  // private global variables
224  extern bool global_compat_empty_string_is_nothing;
225  extern bool global_compat_allow_any_header;
226 
229 
230 
233 
234 };
235 
238 
239 public:
241  const SoapMimeTypes = (MimeTypeSoapXml, MimeTypeXml, MimeTypeXmlApp);
242 
243  static string getSoapMimeType12(bool soap12);
244 
246 
248  static data getFile(string fn, bool as_string = True);
249 
251 
253  static string getHTTP(string url, *string path, *HTTPClient hc, *hash<auto> headers, bool as_string = True);
254 
256 
258  static data getFTP(string url, string path, bool as_string = True);
259 
261 
264  static data getFileFromURL(string url, string def_protocol = "file", *HTTPClient http_client, *hash<auto> http_headers, bool as_string = True, *string def_path, *reference new_def_path);
265 
267 
270  static data getFileFromURL(string url, hash<auto> u, string def_protocol = "file", *HTTPClient http_client, *hash<auto> http_headers, bool as_string = False, *string def_path, *reference new_def_path);
271 
273  static WebService getWSDL(WebService wsdl);
274 
276 
279  static string getWSDL(string wsdl, *HTTPClient http_client, *hash<auto> http_headers, *reference new_def_path);
280 
282 
286  static WebService getWebServiceFromUrl(string url, *HTTPClient http_client, *hash<auto> http_headers);
287 
289  static hash<auto> parseMultiPartSOAPMessage(hash<auto> msg);
290 
292  static bool isSOAPMessage(hash<auto> msg);
293 
298  static *hash<auto> parseSOAPMessage(hash<auto> msg);
299 
300 
301 private:
302  static processHref(reference xmldata, string hr, hash<auto> parts);
303 public:
304 
305 
306 
307 private:
308  static substHref(reference xmldata, hash<auto> parts);
309 public:
310 
311 };
312 
313 // private, nmon-exported class
314 class WsdlLibPriv {
315 
316 public:
317  static bool isContentType(string ct, list<auto> MimeTypes);
318 
319  static checkContentType(string ct, list<auto> MimeTypes);
320 };
321 
324 
325 public:
326  static removeNS(reference v);
327 
328  static removeNS2(reference v);
329 };
330 
332 class WSDL::XsdData : public WSDL::XsdBase {
333 
334 public:
335  auto getValue(*hash<auto> mrh, auto val);
336 
337 };
338 
341 
342 public:
343  public :
344  // name of object
345  string name;
347  *string ns;
350 
351 public:
352 
353  constructor(string n_name, string n_ns);
354 
355 
356  constructor(reference e, *string desc_name);
357 
358 
359  string getName();
360 
361 
362  *string getInputNamespacePrefix();
363 
364 
365  bool hasRealName();
366 
367 };
368 
369 class WSDL::XsdAbstractType : public WSDL::XsdNamedData {
370 
371 public:
372  public :
374  Namespaces nsc;
375 
377  string ons;
378 
379 public:
380 
381  constructor(reference e, Namespaces nsc, *string desc_name) ;
382 
383 
384  constructor(string name, string ns, Namespaces nsc) ;
385 
386 
387 
388 private:
389  resolveNamespace();
390 public:
391 
392 
393  checkExtends(XsdAbstractType t, string ename);
394 
395 
396  string getNameWithNS();
397 
398 
399  bool isNillable();
400 
401 
402  bool isRequired();
403 
404 
405  bool requiresValue();
406 
407 
408  string getOutputNamespacePrefix();
409 
410 
411  abstract auto serialize(Namespaces nsc, auto val, *softbool omitType);
412  abstract auto deserialize(string en, hash<string, XsdAbstractType> tmap, *hash<auto> mrh, auto val);
413 };
414 
416 class WSDL::XsdBaseType : public WSDL::XsdAbstractType {
417 
418 public:
419  public :
420 
421 public:
422 
423  constructor(string t, Namespaces nsc, string ns = "xsd") ;
424 
425 
426  auto serialize(Namespaces nsc, auto val, *softbool omitType);
427 
428 
429  auto deserialize(string en, hash<string, XsdAbstractType> tmap, *hash<auto> mrh, auto val);
430 
431 };
432 
434 class WSDL::XsdArrayType : public WSDL::XsdAbstractType {
435 
436 public:
437  constructor(string t, Namespaces nsc) ;
438 
439 
440  auto serialize(Namespaces nsc, auto val, *softbool omitType);
441 
442 
443  auto deserialize(string en, hash<string, XsdAbstractType> tmap, *hash<auto> mrh, auto val);
444 
445 };
446 
449 
450 public:
451  public :
452  *hash<auto> typeinfo;
453  XsdAbstractType type;
454 
455 public:
456 
457  constructor(reference e) ;
458 
459 };
460 
463 
464 public:
465  public :
466  string use = "optional";
467 
468  const AllowedUseValues = (
469  "optional": True,
470  "required": True,
471  "prohibited": True,
472  );
473 
474 public:
475 
476  constructor(hash<auto> attr, Namespaces nsc, *XsdAbstractType n_type, XsdLateResolverHelper unresolved) ;
477 
478 
479  auto getValue(string val);
480 
481 };
482 
485 
486 public:
487  public :
488  int minOccurs = 1;
489  int maxOccurs = 1;
490  bool nillable = False;
491  // the resolved namespace URI for any reference
492  *string ref_ns;
493  // the source name for any reference
494  *string ref;
495  bool usedocns;
496 
497 public:
498 
499  constructor(hash<auto> e, Namespaces nsc, *XsdAbstractType n_type, XsdLateResolverHelper unresolved, bool n_usedocns) ;
500 
501 
502  assimilate(WSDL::XsdElement other);
503 
504 
505  bool isRequired();
506 
507 
508  bool isNillable();
509 
510 
511  auto serialize(Namespaces nsc, auto h, *softbool omitType, string key, string typename);
512 
513 
514 
515 private:
516  auto serializeAsIntern(Namespaces nsc, XsdAbstractType type, auto h, *softbool omitType, string key, string typename);
517 public:
518 
519 
520  auto deserialize(hash<string, XsdAbstractType> tmap, *hash<auto> mrh, auto val, bool present);
521 
522 };
523 
525 class WSDL::XsdSimpleType : public WSDL::XsdAbstractType {
526 
527 public:
528  public :
529  hash<auto> enum;
530  hash<auto> typeinfo;
531  XsdAbstractType type;
532  //any type;
533  bool usedocns;
534 
535 public:
536 
537  constructor(hash<auto> st, Namespaces nsc, XsdLateResolverHelper unresolved, bool n_usedocns, *string desc_name) ;
538 
539 
540  auto serialize(Namespaces nsc, auto val, *softbool omitType);
541 
542 
543  auto deserialize(string en, hash<string, XsdAbstractType> tmap, *hash<auto> mrh, auto val);
544 
545 };
546 
548 public hashdecl WSDL::ChoiceInfo {
549  hash<string, XsdElement> elementmap;
550  bool required;
551 };
552 
554 class WSDL::XsdComplexType : public WSDL::XsdAbstractType {
555 
556 public:
557  public :
558  *XsdArrayType array;
559  *string restriction;
560  *string extension;
561 
562  bool usedocns;
563 
564  hash<string, XsdElement> elementmap();
565  bool anyAttribute = False;
566 
567  bool nillable = False;
568  bool required = False;
569  bool requires_value = False;
570 
571  // attributes
572  hash<string, XsdAttribute> attrs();
573 
574  // any annotated documentation
575  *string documentation;
576 
577  // temporarily used to store type information to resolve simpleType
578  *hash<auto> simpleTypeInfo;
579  // simpleContent type
580  XsdAbstractType simpleType;
581 
582  // finalization flag
583  bool finalized = False;
584 
585  // multiple choice blocks
586  list<hash<ChoiceInfo>> choices();
587 
588 public:
589 
590  private :
592  string cx_type;
593 
594  const XET_ALL = "ALL";
595  const XET_CHOICE = "CHOICE";
596  const XET_SEQUENCE = "SEQUENCE";
597  const XET_SIMPLE = "SIMPLE";
598  const XET_NONE = "NONE";
599 
600 public:
601 
602  // ct can be NOTHING in case of an empty complex type
603  constructor(*hash<auto> ct, Namespaces nsc, XsdLateResolverHelper unresolved, bool n_usedocns, *string desc_name) ;
604 
605 
606  finalize(hash<string, XsdAbstractType> tmap, Namespaces nsc);
607 
608 
610  checkExtends(XsdAbstractType t, string ename);
611 
612 
613 
614 private:
615  parseData(hash<auto> d, XsdLateResolverHelper unresolved, Namespaces nsc);
616 public:
617 
618 
619 
620 private:
621  parseAttributes(reference d, XsdLateResolverHelper unresolved, Namespaces nsc);
622 public:
623 
624 
625  bool isNillable();
626 
627 
628  bool isRequired();
629 
630 
631  bool requiresValue();
632 
633 
634  bool isEmpty();
635 
636 
637 
638 private:
639  hash<string, XsdElement> parseElements(softlist<auto> el, XsdLateResolverHelper unresolved, Namespaces nsc, bool for_object = True);
640 public:
641 
642 
643 
644 private:
645  *hash<auto> serializeElement(Namespaces nsc, string key, XsdElement element, auto h, *softbool omitType);
646 public:
647 
648 
649  *hash<auto> serialize(Namespaces nsc, auto h, *softbool omitType);
650 
651 
652 
653 private:
654  hash<auto> serializeChoice(Namespaces nsc, hash<string, XsdElement> emap, hash<auto> h, *softbool omitType, bool all_members);
655 public:
656 
657 
658  *hash<auto> deserialize(string en, hash<string, XsdAbstractType> tmap, *hash<auto> mrh, auto oval);
659 
660 
661 
662 private:
663  *hash<auto> parseChoice(hash<auto> val, hash<string, XsdElement> emap, string en, hash<string, XsdAbstractType> tmap, *hash<auto> mrh, *bool required);
664 public:
665 
666 };
667 
670 
671 public:
672  public :
678  *string input_name;
680  *string output_name;
681 
684 
686  *string soapAction;
687 
689  hash<string, bool> reqh;
690 
692  hash<string, OperationalBinding> bindings;
693 
694 public:
695 
696  private :
698  hash<string, WSMessage> faults;
699 
700 public:
701 
703 
707  constructor(hash<auto> p, Namespaces nsc, *hash<auto> messages) ;
708 
709 
711  hash<string, WSMessage> getFaultMessages();
712 
713 
715  bool hasFault(string fault);
716 
717 
719  setDocStyleBinding(reference idocmap);
720 
721 
723  markRpcStyleBinding();
724 
725 
727  list<auto> getTopLevelRequestNames();
728 
729 
731 
739  OperationalBinding getBinding(*string bname);
740 
741 
743 
750  addBinding(WSDL::OperationalBinding b);
751 
752 
754 
770  hash<auto> serializeFault(*string fault, string faultmsg, auto h, *hash<auto> header, *string enc, *hash<auto> nsh, *int xml_opts, *string req_soapaction, *string bname);
771 
772 
774 
789  hash<auto> serializeRequest(auto h, *hash<auto> header, *string enc, *hash<auto> nsh, *int xml_opts, *string req_soapaction, *string bname);
790 
791 
793 
806  hash<auto> serializeResponse(auto h, *hash<auto> header, *string enc, *hash<auto> nsh, *bool soap12, *int xml_opts, *string bname);
807 
808 
810 
815  auto deserializeRequest(hash<auto> o, *string bname);
816 
817 
819 
824  auto deserializeResponse(hash<auto> o, *string bname);
825 
826 
831  *hash<auto> deserializeRequestPath(string path, *string bname);
832 
833 
835 
836 private:
837  static hash<auto> processNSValue(hash<auto> h);
838 public:
839 
840 
842 
844  bool isSoap12();
845 
846 
848 
850  string getTargetNS();
851 
852 };
853 
855 public hashdecl WSDL::ArgInfo {
857  string name;
858 
860  string part;
861 
863  XsdAbstractType type;
864 
867 };
868 
870 
877 
878 public:
879  public :
881  hash<string, hash<WSDL::ArgInfo>> args;
882 
885  hash<string, string> pmap;
886 
888  hash<string, XsdAbstractType> tmap;
889 
890  // keep a weak reference to the namespace map
891  Namespaces nsc;
892 
893 public:
894 
895  constructor(hash<auto> m, hash<string, hash<string, XsdElement>> emap, hash<string, XsdAbstractType> tmap, Namespaces nsc) ;
896 
897 
902  auto serializeRpcValue(string part, bool encoded, reference h, reference ons);
903 
904 
906 
914  *hash<auto> serializeRpc(*softlist<auto> parts, *WSDL::BindingMessageDescription msginfo, *MultiPartRelatedMessage mpm, string n_name, bool encoded, reference h, bool fault);
915 
916 
918 
926  *hash<auto> serializeDocument(*softlist<auto> parts, *WSDL::BindingMessageDescription msginfo, *MultiPartRelatedMessage mpm, bool encoded, reference h, bool fault);
927 
928 
930 
935  *hash<auto> deserializeRpc(*hash<auto> mrh, hash<auto> val, *string part);
936 
937 
938  *hash<auto> deserializeDocument(*hash<auto> mrh, auto val, *string parts);
939 
940 
942 
945  hash<auto> serializeAllPartData(*hash<auto> val);
946 
947 
949 
955  hash<auto> serializeData(Namespaces nsc, string key, *hash<auto> val);
956 
957 
959 
962  hash<auto> deserializeData(string part, hash<auto> val);
963 
964 
966 
969  hash<auto> deserializeAllPartData(hash<auto> val);
970 
971 
973 
980  private;
981 
982 
984  private;
985 
986 
987  string getSerializedKey(string part);
988 
989 
991 
993  string checkPart(string pname);
994 
995 };
996 
997 // private helper class for lazy name resolution
998 class WSDL::XsdLateResolverHelper {
999 
1000 public:
1001  private :
1002  list<object> l();
1003 
1004 public:
1005 
1006  constructor();
1007 
1008 
1009  add(object v);
1010 
1011 
1012  list<auto> getList();
1013 
1014 
1015  clearResolved();
1016 
1017 
1018  static bool isResolved(XsdTypedData t);
1019 
1020  static bool isResolved(XsdSimpleType t);
1021 
1022  static bool isResolved(XsdComplexType t);
1023 
1024  static bool isResolved(auto t);
1025 };
1026 
1029 
1030 public:
1031  public :
1032  bool docstyle;
1035  *string soapAction;
1036 
1037 public:
1038 
1039  constructor(string name, string ns, bool docstyle, *string soapAction, *WSDL::BindingMessageDescription input, *WSDL::BindingMessageDescription output) ;
1040 
1041 
1042  hash<auto> serializeMessage(WSOperation op, *WSMessage msg, bool request, bool soap12, auto h, *hash<auto> header, string enc = "UTF-8", *hash<auto> nsh, *int xml_opts, *string req_soapaction, *string faultmsg);
1043 
1044 
1045  auto deserializeMessage(WSOperation op, hash<auto> o, bool request);
1046 
1047 
1048  auto deserializeRequestPath(WSOperation op, string path);
1049 
1050 
1051  abstract hash<auto> serializeMessageImpl(WSOperation op, *WSMessage msg, bool request, bool soap12, auto h, *hash<auto> header, string enc, *hash<auto> nsh, *int xml_opts, *string req_soapaction, *string faultmsg);
1052 
1053  abstract auto deserializeMessageImpl(WSOperation op, hash<auto> o, bool request);
1054 
1055  abstract auto deserializeRequestPathImpl(WSOperation op, string path);
1056 };
1057 
1058 class WSDL::SoapBinding : public WSDL::OperationalBinding {
1059 
1060 public:
1061  public :
1062  string soapTransport;
1063 
1064 public:
1065 
1066  constructor(string name, string ns, bool docstyle, string soapTransport, *string soapAction, *WSDL::BindingMessageDescription input, *WSDL::BindingMessageDescription output) ;
1067 
1068 
1069  hash<auto> serializeMessageImpl(WSOperation op, *WSMessage msg, bool request, bool soap12, auto h, *hash<auto> header, string enc, *hash<auto> nsh, *int xml_opts, *string req_soapaction, *string faultmsg);
1070 
1071 
1072  private;
1073 
1074 
1075  auto deserializeMessageImpl(WSOperation op, hash<auto> o, bool request);
1076 
1077 
1079  private;
1080 
1081 
1082  hash<auto> deserializeRequestPathImpl(WSOperation op, string path);
1083 
1084 };
1085 
1086 class WSDL::HttpBinding : public WSDL::OperationalBinding {
1087 
1088 public:
1089  public :
1090  string httpMethod;
1091  string location;
1092 
1093 public:
1094 
1095  constructor(string name, string ns, bool docstyle, string httpMethod, string location, *string soapAction, *WSDL::BindingMessageDescription input, *WSDL::BindingMessageDescription output) ;
1096 
1097 
1098  hash<auto> serializeMessageImpl(WSOperation op, *WSMessage msg, bool request, bool soap12, auto h, *hash<auto> header, string enc, *hash<auto> nsh, *int xml_opts, *string req_soapaction, *string faultmsg);
1099 
1100 
1102  private;
1103 
1104 
1105  auto deserializeMessageImpl(WSOperation op, hash<auto> v, bool request);
1106 
1107 
1108  hash<auto> deserializeRequestPathImpl(WSOperation op, string path);
1109 
1110 };
1111 
1113 
1116 
1117 public:
1118  public :
1120 
1123  bool encoded;
1124 
1126  *string encodingStyle;
1127 
1129  *string ns;
1130 
1132  *list<auto> parts;
1133 
1134 public:
1135 
1136  constructor(bool encoded, *string encodingStyle, *string ns, *string parts);
1137 
1138 
1139  bool isMultipart();
1140 
1141 };
1142 
1145 
1146 public:
1147  public :
1149  string part;
1150 
1152 
1155  bool encoded;
1156 
1159 
1160 public:
1161 
1163  /*
1164  @param part message part name
1165  @param encoded if @ref Qore::True "True", then use = \c "encoded" (each message part references an abstract type using the \c type attribute), otherwise use = \c "literal" (each part references a concrete schema definition using either the \c element or \c type attribute)
1166  @param msg actual message
1167  */
1168  constructor(string part, bool encoded = False, WSMessage msg);
1169 
1170 };
1171 
1173 
1176 
1177 public:
1178  public :
1180  string part;
1181 
1182  // list of accepted content types (with "xxx/*")
1183  list<auto> acceptedContentTypes = ();
1184 
1185  // list of accepted specific content types
1186  list<auto> acceptedContentTypeSubtypes = ();
1187 
1189  bool formUrlEncoded = False;
1190 
1192  bool acceptAllContentTypes = False;
1193 
1194 public:
1195 
1196  addContentType(string type);
1197 
1198 };
1199 
1201 
1204 
1205 public:
1206  public :
1208 
1210  string part;
1211 
1212 public:
1213 
1214  constructor(string part);
1215 
1216 };
1217 
1220 
1221 public:
1222  public :
1225 
1227 
1229  *hash<auto> urlReplacement;
1230 
1232 
1243  bool urlEncoded = False;
1244 
1247 
1250 
1251 public:
1252 
1253  private:internal {
1255  list<BindingMessageHeaderDescription> headers = cast<list<BindingMessageHeaderDescription>>(());
1256  }
1257 
1258  addHeader(BindingMessageHeaderDescription hdr);
1259 
1260 
1262  bool hasHeaders();
1263 
1264 
1266  list<BindingMessageHeaderDescription> getHeaders();
1267 
1268 
1269  setUrlReplacement(string loc);
1270 
1271 };
1272 
1275 
1276 public:
1277  private:internal {
1278  string port;
1279 
1281 
1284  bool docstyle = True;
1285 
1286  *string httpMethod;
1287  *string soapTransport;
1288  }
1289 
1290  constructor(hash<auto> data, Namespaces nsc, reference portTypes, reference idocmap, *hash<auto> messages) ;
1291 
1292 
1294  private;
1295 
1296 
1297  string getPort();
1298 
1299 
1300  bool isSoapBinding();
1301 
1302 
1303  bool isHttpBinding();
1304 
1305 };
1306 
1307 // private namespace prefix redefinition class
1308 class WSDL::NamespacePrefixHelper {
1309 
1310 public:
1311  public :
1312 
1313 public:
1314 
1315  private :
1317  Namespaces nsc;
1318 
1319  // overriden prefixes
1320  hash<auto> h;
1321 
1322  // overridden target namespace
1323  bool targ_ns;
1324 
1325  // overridden default namespace
1326  bool def_ns;
1327 
1328 public:
1329 
1330  constructor(Namespaces nsc, *hash<auto> nsattr);
1331 
1332 
1333  destructor();
1334 
1335 
1336  save(string k, string v);
1337 
1338 };
1339 
1342 
1343 public:
1344  public :
1345  // options are here since this object is passed through all serialization and deserialization
1346  bool opt_empty_string_is_nothing = False;
1347  bool opt_allow_any_header = False;
1348 
1349 public:
1350 
1351  private :
1353  hash<string, string> ns = {
1354  "xsd": XSD_NS,
1355  };
1356 
1358  hash<string, string> nsr = {
1359  XSD_NS: "xsd",
1360  };
1361 
1363  hash<string, bool> xsd_schema = {
1364  "xsd": True,
1365  };
1366 
1368  hash<string, string> imap = {
1369  "xsd": XSD_NS,
1370  };
1371 
1373  hash<string, string> imapr = {
1374  XSD_NS: "xsd",
1375  };
1376 
1378  int nsn;
1379 
1381  bool hassoap11 = False;
1382 
1384  bool hassoap12 = False;
1385 
1387  *string target_ns;
1388 
1390  list<auto> nss = ();
1391 
1393  *string default_ns;
1394 
1396  list<auto> dss = ();
1397 
1399  hash<string, XsdBaseType> base_types;
1400 
1401 public:
1402 
1404  constructor(hash<auto> nsh, *Namespaces nsc);
1405 
1406 
1407  *string getDefaultNs();
1408 
1409 
1410  addNamespaces(hash<auto> nsh, *NamespacePrefixHelper nph);
1411 
1412 
1413  restorePrefixes(hash<auto> h);
1414 
1415 
1416 
1417 private:
1418  addNamespaceIntern(string ns, string val, *bool override);
1419 public:
1420 
1421 
1423  merge(Namespaces nsc);
1424 
1425 
1427  string getOutputNamespaceUri(string nsp);
1428 
1429 
1431  *hash<auto> getOutputNamespaceHash(*hash<auto> nsh);
1432 
1433 
1435  *string getTargetNamespaceUri();
1436 
1437 
1439  *string getNamespaceUri(*string nsp);
1440 
1441 
1443  pushTargetNamespace(string ns);
1444 
1445 
1447  popTargetNamespace();
1448 
1449 
1451  pushDefaultNamespace(string ns);
1452 
1453 
1455  popDefaultNamespace();
1456 
1457 
1459  string getOutputNamespacePrefix(string ns);
1460 
1461 
1463  string getTargetNamespaceInputPrefix();
1464 
1465 
1467 
1468 private:
1469  string registerNamespaceIntern(string n_ns);
1470 public:
1471 
1472 
1474  *hash<auto> getReferencedNamespaceMap();
1475 
1476 
1478  bool hasSoap11();
1479 
1480 
1482  bool hasSoap12();
1483 
1484 
1486  *bool isSchema(string ns);
1487 
1488 
1490  string getInputNamespaceUri(string nsa);
1491 
1492 
1493  bool doType(string t, reference<hash> typeinfo, reference<XsdAbstractType> rtype);
1494 
1495 
1496  hash<auto> getTypeHash(string t);
1497 
1498 
1499  XsdBaseType getBaseType(string t);
1500 
1501 
1503  string translateOutputNamespacePrefix(*string nsa);
1504 
1505 };
1506 
1507 // private functions
1508 XsdAbstractType tmap_get(hash<string, XsdAbstractType> tmap, string name);
1509 
1510 
1511 *XsdAbstractType tmap_try_get(hash<string, XsdAbstractType> tmap, string name);
1512 
1513 
1514 // private functions
1515 XsdElement emap_get(hash<string, hash<string, XsdElement>> emap, string ns, string name);
1516 
1517 
1518 *XsdElement emap_try_get(hash<string, hash<string, XsdElement>> emap, string ns, string name);
1519 
1520 
1522 public hashdecl WSDL::PortTypeInfo {
1523  hash<string, WSOperation> operations;
1524 };
1525 
1527 public hashdecl WSDL::ServiceInfo {
1529  string name;
1531  hash<string, hash> port;
1532 };
1533 
1535 public hashdecl WSDL::OperationInfo {
1537  string port;
1538 
1541 };
1542 
1544 
1547 
1548 public:
1549  public :
1551  string wsdl;
1552 
1555 
1557  list<string> wsdl_services();
1558 
1560  hash<string, XsdElement> idocmap();
1561 
1563  hash<string, hash<string, XsdElement>> emap();
1564 
1566  hash<string, WSMessage> messages();
1567 
1569  hash<string, XsdAbstractType> tmap();
1570 
1572  hash<string, hash<PortTypeInfo>> portType();
1573 
1575  *code try_import;
1576 
1578  *string def_path;
1579 
1580 public:
1581 
1582  private :
1583  // service definitions; name -> service info hash
1584  hash<string, hash<WSDL::ServiceInfo>> services();
1585 
1586  // service bindings; name -> Binding
1587  hash<string, Binding> binding();
1588 
1589 public:
1590 
1592 
1603  constructor(string str, *hash<auto> opts);
1604 
1605 
1607  WSDL::WSOperation getOperation(string opname);
1608 
1609 
1611  softlist<auto> getOperationNames();
1612 
1613 
1615  WSDL::WSOperation getPortTypeOperation(string ptname, string opname);
1616 
1617 
1619  WSDL::WSOperation getBindingOperation(*string bname, string opname);
1620 
1621 
1623 
1627  list<hash<OperationInfo>> listOperations();
1628 
1629 
1631 
1637  WSDL::Binding getBinding(string name);
1638 
1639 
1641 
1647  list<hash<WSDL::ServiceInfo>> listServices();
1648 
1649 
1651 
1660  hash<WSDL::ServiceInfo> getService(string name);
1661 
1662 
1664  hash<auto> getType(string name, auto v);
1665 
1666 
1667 
1668 private:
1669  XsdBaseType getBaseType(string t);
1670 public:
1671 
1672 
1673 
1674 private:
1675  resolveType(XsdSimpleType t);
1676 public:
1677 
1678 
1679 
1680 private:
1681  resolveType(XsdElement xe);
1682 public:
1683 
1684 
1685 
1686 private:
1687  resolveType(XsdAttribute xd);
1688 public:
1689 
1690 
1691 
1692 private:
1693  resolveType(XsdComplexType ct);
1694 public:
1695 
1696 
1697 
1698 private:
1699  XsdAbstractType resolveType(hash<auto> v);
1700 public:
1701 
1702 
1703  // parse XSD schema types
1704 
1705 private:
1706  parseTypes(*hash<auto> data, auto http_client, auto http_headers);
1707 public:
1708 
1709 
1710 
1711 private:
1712  parseMessages(*softlist<auto> message);
1713 public:
1714 
1715 
1716 
1717 private:
1718  parseService(*softlist<auto> svcs);
1719 public:
1720 
1721 
1722 
1723 private:
1724  parsePortType(*softlist<auto> data);
1725 public:
1726 
1727 
1728 
1729 private:
1730  parseBinding(*softlist<auto> bindings);
1731 public:
1732 
1733 
1735 
1737  bool isSoap12();
1738 
1739 
1741 
1743  string getWSDL();
1744 
1745 
1747 
1752  string getWSDL(string base_url);
1753 
1754 
1755 
1756 private:
1757  string getOperationParams(WSMessage msg);
1758 public:
1759 
1760 
1762 
1767  getReport(StringOutputStream stream, *string wsdl_name);
1768 
1769 
1771 
1775  string getReport(*string wsdl_name);
1776 
1777 };
1778 
1780 
1783 
1784 public:
1785  private :
1786  WebService ws;
1787  hash<auto> opts;
1788 
1789 public:
1790 
1791  const DefaultOpts = (
1792  "comments": False,
1793  "choices": False,
1794  "max_items": 3,
1795  );
1796 
1798 
1804  constructor(WebService ws, *hash<auto> opts);
1805 
1806 
1807 
1808 private:
1809  hash<auto> getTypeInfo(XsdBaseType t);
1810 public:
1811 
1812 
1813 
1814 private:
1815  hash<auto> getTypeInfo(XsdSimpleType t);
1816 public:
1817 
1818 
1819 
1820 private:
1821  hash<auto> getTypeInfo(XsdComplexType t);
1822 public:
1823 
1824 
1825  hash<auto> getMessage(XsdElement elem, *softlist<auto> comments);
1826 
1827 
1829 
1833  hash<auto> getMessage(string name);
1834 
1835 
1837 
1841  auto getMessage(WSMessage msg);
1842 
1843 };
WSMessage output
response message
Definition: WSDL.qm.dox.h:676
const SOAP_11_NS
SOAP 1.1 namespace URI.
Definition: WSDL.qm.dox.h:140
describes the message body for a SOAP operational binding message description
Definition: WSDL.qm.dox.h:1115
const ENVELOPE_11_NS
soap 1.1 envelope namespaces
Definition: WSDL.qm.dox.h:156
XSD typed data class.
Definition: WSDL.qm.dox.h:448
string part
specifies the name of the message part
Definition: WSDL.qm.dox.h:1180
string wsdl
the WSDL string
Definition: WSDL.qm.dox.h:1551
const version
this WSDL implementation version
Definition: WSDL.qm.dox.h:132
*code try_import
optional closure/call reference to try to resolve import declarations
Definition: WSDL.qm.dox.h:1575
hash< string, XsdBaseType > base_types
base type map
Definition: WSDL.qm.dox.h:1399
const SoapStyleMap
SOAP "style" to "document" mappings.
Definition: WSDL.qm.dox.h:184
string name
service name
Definition: WSDL.qm.dox.h:1529
const ENVELOPE_12_NS
soap 1.2 envelope namespaces
Definition: WSDL.qm.dox.h:167
WSMessage msg
a weak reference to the actual message
Definition: WSDL.qm.dox.h:1158
Namespaces nsc
namespace container
Definition: WSDL.qm.dox.h:1554
const SoapMimeTypes
Mime types recognized as SOAP messages.
Definition: WSDL.qm.dox.h:241
string cx_type
type of complexType object
Definition: WSDL.qm.dox.h:592
static data getFile(string fn, bool as_string=True)
retrieves a local file and returns the file&#39;s contents as a string
*list< auto > parts
indicates which parts appear somewhere within the SOAP Body portion of the message ...
Definition: WSDL.qm.dox.h:1132
web service operation class
Definition: WSDL.qm.dox.h:669
bool encoded
required attribute
Definition: WSDL.qm.dox.h:1155
const XSI_NS
XSI namespace URI.
Definition: WSDL.qm.dox.h:148
main WSDL namespace
Definition: WSDL.qm.dox.h:130
static data getFileFromURL(string url, string def_protocol="file", *HTTPClient http_client, *hash< auto > http_headers, bool as_string=True, *string def_path, *reference new_def_path)
retrieves a file from a URL
WSMessage input
request message
Definition: WSDL.qm.dox.h:674
describes MIME content information for SOAP operational binding message descriptions ...
Definition: WSDL.qm.dox.h:1175
namespace container class
Definition: WSDL.qm.dox.h:1341
const SOAP_12_NS
SOAP 1.2 namespace URI.
Definition: WSDL.qm.dox.h:143
base class with helper methods for XSD data processing
Definition: WSDL.qm.dox.h:323
class for XSD array types; currently only supports "binary"; used, for example with HTTP MultiPart me...
Definition: WSDL.qm.dox.h:434
Namespaces nsc
namespace container
Definition: WSDL.qm.dox.h:683
const XSD_NS
XSD namespace URI.
Definition: WSDL.qm.dox.h:146
*string soapAction
the SOAPAction header value to send with this operation
Definition: WSDL.qm.dox.h:686
*string default_ns
default namespace for unprefixed definitions
Definition: WSDL.qm.dox.h:1393
WSDL operation info.
Definition: WSDL.qm.dox.h:1535
*string encodingStyle
when encoded True, this is used to produce a concrete message by applying the specified encoding ...
Definition: WSDL.qm.dox.h:1126
message argument hash description
Definition: WSDL.qm.dox.h:855
*string target_ns
current target namespace
Definition: WSDL.qm.dox.h:1387
const SOAP_TRANSPORT
known/supported transports
Definition: WSDL.qm.dox.h:213
const SOAP_12_ENV
SOAP 1.2 envelope URI.
Definition: WSDL.qm.dox.h:137
const SoapUseMap
SOAP "use" to "encoded" mappings.
Definition: WSDL.qm.dox.h:178
base class for XSD classes with a "name" attribute
Definition: WSDL.qm.dox.h:340
string port
the name of the port defining the operation
Definition: WSDL.qm.dox.h:1537
bool encoded
required attribute
Definition: WSDL.qm.dox.h:1123
describes a mimeXml payload for a SOAP operational binding message description
Definition: WSDL.qm.dox.h:1203
static WebService getWebServiceFromUrl(string url, *HTTPClient http_client, *hash< auto > http_headers)
returns a WebService object from a URL and other optional arguments
WSDL port type hash.
Definition: WSDL.qm.dox.h:1522
class for WSDL bindings associated with a SOAP operation
Definition: WSDL.qm.dox.h:1028
hash< string, string > pmap
Definition: WSDL.qm.dox.h:885
hash< string, bool > reqh
a hash of top-level request names for this operation (depends on bindings)
Definition: WSDL.qm.dox.h:689
web service message class
Definition: WSDL.qm.dox.h:876
int nsn
integer providing a sequence for output namespace prefixes
Definition: WSDL.qm.dox.h:1378
complex type choice hash
Definition: WSDL.qm.dox.h:548
static *hash< auto > parseSOAPMessage(hash< auto > msg)
string part
unique part name
Definition: WSDL.qm.dox.h:860
hash< string, WSMessage > faults
fault messages keyed by fault name
Definition: WSDL.qm.dox.h:698
*WSDL::MimeXmlMessageDescription mimeXml
optional mimeXml message scription
Definition: WSDL.qm.dox.h:1249
*WSDL::BindingMessageBodyDescription body
the description of the message body
Definition: WSDL.qm.dox.h:1224
const SOAP_TRANSPORT_HTTP
SOAP HTTP transport URI.
Definition: WSDL.qm.dox.h:210
static string getHTTP(string url, *string path, *HTTPClient hc, *hash< auto > headers, bool as_string=True)
retrieves a file from a URL with HTTP and returns the file&#39;s contents as a string ...
hash< string, hash > port
port info
Definition: WSDL.qm.dox.h:1531
const RANGE_INT
range of "int" values (32 bits)
Definition: WSDL.qm.dox.h:221
const SOAP_11_ENV
SOAP 1.1 envelope URI.
Definition: WSDL.qm.dox.h:135
string name
the arg name
Definition: WSDL.qm.dox.h:857
main class representing a parsed WSDL file
Definition: WSDL.qm.dox.h:1546
WSDL::WSOperation operation
the operation object
Definition: WSDL.qm.dox.h:1540
*string ns
namespace; "only applies to content not explicitly defined by the abstract types" ...
Definition: WSDL.qm.dox.h:1129
class for XSD base types
Definition: WSDL.qm.dox.h:416
const HTTP_NS
HTTP namespace URI.
Definition: WSDL.qm.dox.h:151
XsdAbstractType type
type for the argument
Definition: WSDL.qm.dox.h:863
XSD attribute class.
Definition: WSDL.qm.dox.h:462
wsdl_set_global_compat_allow_any_header(softbool val)
sets the global_compat_allow_any_header variable to the given value to force the WSDL module to allow...
XSD element class.
Definition: WSDL.qm.dox.h:484
const SOAP_ENCODING
soap encoding URI
Definition: WSDL.qm.dox.h:190
string part
refers to a message part defining the concrete schema of the root XML element
Definition: WSDL.qm.dox.h:1210
static WebService getWSDL(WebService wsdl)
returns the argument
*WSDL::BindingContentDescription content
optional content-type descriptions
Definition: WSDL.qm.dox.h:1246
*string def_path
default path for retrieving XSD references
Definition: WSDL.qm.dox.h:1578
WSDL service info hash.
Definition: WSDL.qm.dox.h:1527
XSD simple type class.
Definition: WSDL.qm.dox.h:525
string part
message part name
Definition: WSDL.qm.dox.h:1149
XsdElement element
element for the argument
Definition: WSDL.qm.dox.h:866
static data getFTP(string url, string path, bool as_string=True)
retrieves a file from a URL with the FTP protocol and returns the file&#39;s contents as binary or string...
wsdl_set_global_compat_empty_string_is_nothing(softbool val)
sets the global_compat_empty_string_is_nothing variable to the given value to force the WSDL module t...
describes a SOAP message header for a SOAP operational binding message description ...
Definition: WSDL.qm.dox.h:1144
class for WSDL bindings
Definition: WSDL.qm.dox.h:1274
XSD complex type class.
Definition: WSDL.qm.dox.h:554
hash< string, OperationalBinding > bindings
params per associated binding; key = binding name; value = OperationalBinding object ...
Definition: WSDL.qm.dox.h:692
const any_type_map
mapping from Qore types to xsd types for xsd type "anyType"
Definition: WSDL.qm.dox.h:193
static hash< auto > parseMultiPartSOAPMessage(hash< auto > msg)
takes a hash representation of a SOAP message and handles multipart messages, checks the content-type...
*hash< auto > urlReplacement
a hash of URL replacement values keyed by part name, values are URI paths
Definition: WSDL.qm.dox.h:1229
descriptive_name
descriptive name flag
Definition: WSDL.qm.dox.h:349
hash< string, XsdAbstractType > tmap
type map
Definition: WSDL.qm.dox.h:888
base class for XSD data classes
Definition: WSDL.qm.dox.h:332
helper class implementing sample message generation
Definition: WSDL.qm.dox.h:1782
const MIME_NS
MIME namespace URI.
Definition: WSDL.qm.dox.h:153
static bool isSOAPMessage(hash< auto > msg)
returns True is the message has a SOAP mime type
const RANGE_SHORT
range of "short" values (16 bits)
Definition: WSDL.qm.dox.h:218
contains helper methods for retrieving WSDLs from a URL
Definition: WSDL.qm.dox.h:237
hash< string, hash< WSDL::ArgInfo > > args
args keys are part names for types reps. element names for element. Definition must provide unique va...
Definition: WSDL.qm.dox.h:881
*string input_name
request message name
Definition: WSDL.qm.dox.h:678
describes an input or output message in a SOAP operational binding
Definition: WSDL.qm.dox.h:1219
*string output_name
response message name
Definition: WSDL.qm.dox.h:680
*string ns
input namespace prefix (if any given)
Definition: WSDL.qm.dox.h:347