Qore SoapClient Module Reference  0.5
SoapClient.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* SoapClient.qm Copyright (C) 2012 - 2022 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 }
37 
143 namespace SoapClient {
145 class SoapClient : public HTTPClient {
146 
147 public:
149  const Version = "0.2.5";
150 
152  const Headers = {"User-Agent": ("Qore-Soap-Client/" + SoapClient::Version)};
153 
155  const HTTPOptions = keys HttpConnection::ConnectionScheme.options;
156 
158 protected:
159  // web service definition
160  WSDL::WebService wsdl;
161  // service name
162  string svc;
163  string port;
164  string binding;
165  *string url_path;
166 
167  *code logc;
168  *code dbglogc;
169 
170  // send content encoding hash
171  *hash<auto> seh;
172 
173 public:
175 
177  string url;
179  hash headers = Headers;
180 
182 
188  const EncodingSupport = ...;
189 
190 
192  const CompressionThreshold = 1024;
193 
195 
208  constructor(hash<auto> h) ;
209 
210 
212 
231  hash<auto> getMsg(string operation, auto args, *hash<auto> soap_header, reference<auto> op, *hash<auto> http_header, *int xml_opts, *string soapaction);
232 
233 
235 
267  auto callOperation(string operation, auto args, *hash<auto> opts, *reference info);
268 
269 
271 
289  auto call(string operation, auto args, *hash<auto> soap_header, *hash<auto> http_header, *string binding);
290 
291 
293 
320  auto call(string operation, auto args, *reference info, *string binding);
321 
322 
324 
352  auto call(reference info, string operation, auto args, *hash<auto> soap_header, *hash<auto> http_header);
353 
354 
356 private:
357  auto makeCallIntern(*reference info, string operation, auto args, *hash<auto> opts);
358 public:
359 
360 
362 
374  auto methodGate(string op);
375 
376 
378  hash<auto> getType(string type, auto v);
379 
380 
383 
384 
386 
392  hash<auto> getInfo();
393 
394 
396 
411  setSendEncoding(string enc = 'auto');
412 
413 
415 
430  setContentEncoding(string enc = 'auto');
431 
432 
434 
448  addDefaultHeaders(hash<auto> h);
449 
450 
452 
465  hash<auto> getDefaultHeaders();
466 
467 
469 
482  *string getSendEncoding();
483 
484 
486  log(string msg);
487 
488 
490  dbglog(string msg);
491 
507 protected:
508  nothing msglog(hash<auto> msg);
509 public:
510 
511 };
512 
514 
530 class SoapConnection : public HttpBasedConnection {
531 
532 public:
533  hash<auto> real_opts;
534 
536  const ConnectionScheme = ...;
537 
538 
540 
548  constructor(string name, string description, string url, hash<auto> attributes = {}, hash<auto> options = {})
549  ;
550 
551 
553  string getType();
554 
555 
557 
561  *hash<auto> getRuntimeOptions();
562 
563 
565 
569  DataProvider::AbstractDataProvider getDataProvider();
570 
571 
573 
578 
579 
581 
588 protected:
589  SoapClient getImpl(bool connect = True, *hash<auto> rtopts);
590 public:
591 
592 
594 protected:
595  hash<ConnectionSchemeInfo> getConnectionSchemeInfoImpl();
596 public:
597 
598 };
599 };
setSendEncoding(string enc='auto')
change the data content encoding (compression) option for the object; see EncodingSupport for valid o...
hash< auto > getDefaultHeaders()
returns the hash of default headers to sent in all requests
auto callOperation(string operation, auto args, *hash< auto > opts, *reference info)
makes a server call with the given operation, arguments, options, and optional info hash reference an...
addDefaultHeaders(hash< auto > h)
adds default headers to each request; these headers will be sent in all requests but can be overridde...
hash< auto > getMsg(string operation, auto args, *hash< auto > soap_header, reference< auto > op, *hash< auto > http_header, *int xml_opts, *string soapaction)
returns a hash representing the serialized SOAP request for a given WSOperation
string url
target URL
Definition: SoapClient.qm.dox.h:177
setContentEncoding(string enc='auto')
sets the request and desired response encoding for the object; see EncodingSupport for valid options
auto call(string operation, auto args, *reference info, *string binding)
makes a server call with the given operation and arguments and returns the deserialized result
log(string msg)
sends a log message to the log closure or call reference, if any
*string getSendEncoding()
returns the current data content encoding (compression) object or nothing if no encoding option is se...
auto call(string operation, auto args, *hash< auto > soap_header, *hash< auto > http_header, *string binding)
makes a server call with the given operation and arguments and returns the deserialized result
dbglog(string msg)
sends a log message to the debug log closure or call reference, if any
hash< auto > getType(string type, auto v)
returns a hash that can be used to ensure serialization with the XSD type given as the type argument
auto methodGate(string op)
uses SoapClient::call() to transparently serialize the argument and make a call to the given operatio...
hash< auto > getInfo()
returns a hash of information about the current WSDL
WSDL::WebService getWebService()
returns the WSDL::WebService object associated with this object
nothing msglog(hash< auto > msg)
auto makeCallIntern(*reference info, string operation, auto args, *hash< auto > opts)
makes the call to the SOAP server and ensures that SOAP fault responses returned with a 500-series st...
auto call(reference info, string operation, auto args, *hash< auto > soap_header, *hash< auto > http_header)
makes a server call with the given operation and arguments and returns the deserialized result with a...
constructor(hash< auto > h)
creates the object based on a WSDL which is parsed to a WebService object which provides the basis fo...
class for SOAP connections; returns an object of class SoapClient for connecting to SOAP servers
Definition: SoapClient.qm.dox.h:530
DataProvider::AbstractDataProvider getDataProvider()
returns a data provider object for this connection
*hash< auto > getRuntimeOptions()
returns runtime options
hash< ConnectionSchemeInfo > getConnectionSchemeInfoImpl()
Returns the ConnectionSchemeInfo hash for this object.
bool hasDataProvider()
returns True as this connection returns a data provider with the getDataProvider() method
SoapClient getImpl(bool connect=True, *hash< auto > rtopts)
returns a SoapClient object
const ConnectionScheme
Connection entry info.
Definition: SoapClient.qm.dox.h:536
string getType()
returns "soap"
constructor(string name, string description, string url, hash< auto > attributes={}, hash< auto > options={})
creates the SoapConnection object
main SoapClient namespace
Definition: SoapClient.qm.dox.h:143