Qore SoapClient Module Reference  0.2.5
SoapClient.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* SoapClient.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 // requires the WSDL module
30 
31 // need mime definitions
32 
33 // provides a connection class
34 
35 // do not use $ for vars
36 
37 // do not ignore argument errors
38 
39 // require type declarations
40 
41 // enable all warnings
42 
43 
121 namespace SoapClient {
124 class SoapClient : public HTTPClient {
125 
126 public:
128  const Version = "0.2.5";
129 
131  const Headers = ("User-Agent": ("Qore-Soap-Client/" + SoapClient::Version));
132 
134  const HTTPOptions = ("connect_timeout", "http_version", "max_redirects", "proxy", "timeout");
135 
137  private :
138  // web service definition
139  WSDL::WebService wsdl;
140  // service name
141  string svc;
142  string port;
143  string binding;
144  *string url_path;
145 
146  *code logc;
147  *code dbglogc;
148 
149  // send content encoding hash
150  *hash seh;
151 
152 public:
154 
155  public :
157  string url;
159  hash headers = Headers;
160 
162 
168  const EncodingSupport = (
169  "gzip": (
170  "ce": "gzip",
171  "func": \gzip(),
172  ),
173  "bzip2": (
174  "ce": "bzip2",
175  "func": \bzip2(),
176  ),
177  "deflate": (
178  "ce": "deflate",
179  "func": \compress(),
180  ),
181  "identity": (
182  "ce": NOTHING,
183  ),
184  );
185 
187  const CompressionThreshold = 1024;
188 
189 public:
190 
192 
205  constructor(hash h) ;
206 
207 
209 
228  hash getMsg(string operation, any args, *hash header, reference op, *hash nsh, *int xml_opts, *string soapaction);
229 
230 
232 
264  any callOperation(string operation, any args, *hash opts, *reference info);
265 
266 
268 
282  any call(string operation, any args, *hash header, *hash nsh, *string binding);
283 
284 
286 
309  any call(string operation, any args, *reference info, *string binding);
310 
311 
313 
340  any call(reference info, string operation, any args, *hash header, *hash nsh);
341 
342 
344  private;
345 
346 
348 
358  any methodGate(string op);
359 
360 
362  hash getType(string type, any v);
363 
364 
366  WSDL::WebService getWebService();
367 
368 
370 
376  hash getInfo();
377 
378 
380 
395  setSendEncoding(string enc = "auto");
396 
397 
399 
414  setContentEncoding(string enc = "auto");
415 
416 
418 
432  addDefaultHeaders(hash h);
433 
434 
436 
449  hash getDefaultHeaders();
450 
451 
453 
466  *string getSendEncoding();
467 
468 
470  log(string msg);
471 
472 
474  dbglog(string msg);
475 
492 private:
493  nothing msglog(hash msg);
494 public:
495 
496  };
497 
499 
518 class SoapConnection : public HttpBasedConnection {
519 
520 public:
521  public :
522  hash real_opts;
523 
524 public:
525 
526  public :
527  const Options = HttpConnection::Options + (
528  "content_encoding": True,
529  "service": True,
530  "port": True,
531  "send_encoding": True,
532  "target_url": True,
533  "wsdl": True,
534  );
535 
536 public:
537 
539 
546  constructor(string name, string desc, string url, bool monitor, *hash n_opts, hash urlh) ;
547 
548 
550  string getType();
551 
552 
554 
558  *hash getRuntimeOptions();
559 
560 
562 
570 private:
571  SoapClient getImpl(bool connect = True, *hash rtopts);
572 public:
573 
574 
576  hash getOptions();
577 
578 
580  *hash getDefaultOptions();
581 
582 
584  static SoapConnection make(string name, string desc, string url, bool monitor, *hash opts, hash urlh);
585  };
586 };
*hash getDefaultOptions()
returns default options
constructor(string name, string desc, string url, bool monitor, *hash n_opts, hash urlh)
creates the SoapConnection object
string getType()
returns "soap"
hash getOptions()
gets options
*hash getRuntimeOptions()
returns runtime options
main SoapClient namespace
Definition: SoapClient.qm.dox.h:122
class for SOAP connections; returns an object of class SoapClient for connecting to SOAP servers ...
Definition: SoapClient.qm.dox.h:518
SoapClient getImpl(bool connect=True, *hash rtopts)
returns a SoapClient object
string url
target URL
Definition: SoapClient.qm.dox.h:157
static SoapConnection make(string name, string desc, string url, bool monitor, *hash opts, hash urlh)
static constructor