Qore SoapClient Module Reference  0.4
SoapClient.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* SoapClient.qm Copyright (C) 2012 - 2019 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 
28 // do not use $ for vars
29 
30 // do not ignore argument errors
31 
32 // require type declarations
33 
34 // enable all warnings
35 
36 
126 namespace SoapClient {
129 class SoapClient : public HTTPClient {
130 
131 public:
133  const Version = "0.2.5";
134 
136  const Headers = ("User-Agent": ("Qore-Soap-Client/" + SoapClient::Version));
137 
139  const HTTPOptions = ("connect_timeout", "http_version", "max_redirects", "proxy", "timeout");
140 
142 protected:
143  // web service definition
144  WSDL::WebService wsdl;
145  // service name
146  string svc;
147  string port;
148  string binding;
149  *string url_path;
150 
151  *code logc;
152  *code dbglogc;
153 
154  // send content encoding hash
155  *hash<auto> seh;
156 
157 public:
159 
161  string url;
163  hash headers = Headers;
164 
166 
172  const EncodingSupport = (
173  "gzip": (
174  "ce": "gzip",
175  "func": \gzip(),
176  ),
177  "bzip2": (
178  "ce": "bzip2",
179  "func": \bzip2(),
180  ),
181  "deflate": (
182  "ce": "deflate",
183  "func": \compress(),
184  ),
185  "identity": (
186  "ce": NOTHING,
187  ),
188  );
189 
191  const CompressionThreshold = 1024;
192 
194 
207  constructor(hash<auto> h) ;
208 
209 
211 
230  hash<auto> getMsg(string operation, auto args, *hash<auto> soap_header, reference<auto> op, *hash<auto> http_header, *int xml_opts, *string soapaction);
231 
232 
234 
266  auto callOperation(string operation, auto args, *hash<auto> opts, *reference info);
267 
268 
270 
288  auto call(string operation, auto args, *hash<auto> soap_header, *hash<auto> http_header, *string binding);
289 
290 
292 
319  auto call(string operation, auto args, *reference info, *string binding);
320 
321 
323 
351  auto call(reference info, string operation, auto args, *hash<auto> soap_header, *hash<auto> http_header);
352 
353 
355 private:
356  auto makeCallIntern(*reference info, string operation, auto args, *hash<auto> opts);
357 public:
358 
359 
361 
373  auto methodGate(string op);
374 
375 
377  hash<auto> getType(string type, auto v);
378 
379 
381  WSDL::WebService getWebService();
382 
383 
385 
391  hash<auto> getInfo();
392 
393 
395 
410  setSendEncoding(string enc = 'auto');
411 
412 
414 
429  setContentEncoding(string enc = 'auto');
430 
431 
433 
447  addDefaultHeaders(hash<auto> h);
448 
449 
451 
464  hash<auto> getDefaultHeaders();
465 
466 
468 
481  *string getSendEncoding();
482 
483 
485  log(string msg);
486 
487 
489  dbglog(string msg);
490 
506 protected:
507  nothing msglog(hash<auto> msg);
508 public:
509 
510  };
511 
513 
532 class SoapConnection : public HttpBasedConnection {
533 
534 public:
535  hash<auto> real_opts;
536 
537  const Options = HttpConnection::Options + {
538  "content_encoding": True,
539  "service": True,
540  "port": True,
541  "send_encoding": True,
542  "target_url": True,
543  "wsdl": True,
544  };
545 
547 
556  deprecated
557  constructor(string name, string desc, string url, bool monitor, *hash<auto> n_opts, hash<auto> urlh)
558  ;
559 
560 
562 
570  constructor(string name, string description, string url, hash<auto> attributes = {}, hash<auto> options = {})
571  ;
572 
573 
574 private:
575  constructorInit();
576 public:
577 
578 
580  string getType();
581 
582 
584 
588  *hash<auto> getRuntimeOptions();
589 
590 
592 
599 protected:
600  SoapClient getImpl(bool connect = True, *hash<auto> rtopts);
601 public:
602 
603 
605  hash<auto> getOptions();
606 
607 
609  *hash<auto> getDefaultOptions();
610 
611 
613 
617  DataProvider::AbstractDataProvider getDataProvider();
618 
619 
621 
625  bool hasDataProvider();
626 
627 
629 
631  deprecated
632  static SoapConnection make(string name, string desc, string url, bool monitor, *hash<auto> opts, hash<auto> urlh);
633  };
634 };
SoapClient::SoapConnection::getDataProvider
DataProvider::AbstractDataProvider getDataProvider()
returns a data provider object for this connection
SoapClient::SoapConnection::getDefaultOptions
*hash< auto > getDefaultOptions()
returns default options
SoapClient::SoapConnection::getRuntimeOptions
*hash< auto > getRuntimeOptions()
returns runtime options
SoapClient::SoapConnection::getOptions
hash< auto > getOptions()
gets options
SoapClient::SoapConnection::getType
string getType()
returns "soap"
WSDL::WebService
SoapClient::SoapConnection::make
static deprecated SoapConnection make(string name, string desc, string url, bool monitor, *hash< auto > opts, hash< auto > urlh)
DEPRECATED: static constructor.
SoapClient::SoapConnection::getImpl
SoapClient getImpl(bool connect=True, *hash< auto > rtopts)
returns a SoapClient object
SoapClient::SoapConnection::constructor
deprecated constructor(string name, string desc, string url, bool monitor, *hash< auto > n_opts, hash< auto > urlh)
DEPRECATED: creates the SoapConnection object.
SoapClient::SoapConnection::hasDataProvider
bool hasDataProvider()
returns True as this connection returns a data provider with the getDataProvider() method
SoapClient
main SoapClient namespace
Definition: SoapClient.qm.dox.h:127
SoapClient::SoapConnection
class for SOAP connections; returns an object of class SoapClient for connecting to SOAP servers
Definition: SoapClient.qm.dox.h:532
SoapClient::SoapClient::url
string url
target URL
Definition: SoapClient.qm.dox.h:161