SoapClient.qm.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
/* SoapClient.qm Copyright (C) 2012 - 2018 Qore Technologies, s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
// make sure we have the required qore version
// requires XML functionality
// requires the WSDL module
// need mime definitions
// provides a connection class
// do not use $ for vars
// do not ignore argument errors
// require type declarations
// enable all warnings
namespace SoapClient {
class SoapClient : public HTTPClient {
public:
const Version = "0.2.5";
const Headers = ("User-Agent": ("Qore-Soap-Client/" + SoapClient::Version));
const HTTPOptions = ("connect_timeout", "http_version", "max_redirects", "proxy", "timeout");
private :
// web service definition
WSDL::WebService wsdl;
// service name
string svc;
string port;
string binding;
*string url_path;
*code logc;
*code dbglogc;
// send content encoding hash
*hash seh;
public:
public :
string url;
hash headers = Headers;
const EncodingSupport = (
"gzip": (
"ce": "gzip",
"func": \gzip(),
),
"bzip2": (
"ce": "bzip2",
"func": \bzip2(),
),
"deflate": (
"ce": "deflate",
"func": \compress(),
),
"identity": (
"ce": NOTHING,
),
);
const CompressionThreshold = 1024;
public:
constructor(hash h) ;
hash getMsg(string operation, any args, *hash header, reference op, *hash nsh, *int xml_opts, *string soapaction);
any callOperation(string operation, any args, *hash opts, *reference info);
any call(string operation, any args, *hash header, *hash nsh, *string binding);
any call(string operation, any args, *reference info, *string binding);
any call(reference info, string operation, any args, *hash header, *hash nsh);
private;
any methodGate(string op);
hash getType(string type, any v);
WSDL::WebService getWebService();
hash getInfo();
setSendEncoding(string enc = "auto");
setContentEncoding(string enc = "auto");
addDefaultHeaders(hash h);
hash getDefaultHeaders();
*string getSendEncoding();
log(string msg);
dbglog(string msg);
private:
nothing msglog(hash msg);
public:
};
class SoapConnection : public HttpBasedConnection {
public:
public :
hash real_opts;
public:
public :
const Options = HttpConnection::Options + (
"content_encoding": True,
"service": True,
"port": True,
"send_encoding": True,
"target_url": True,
"wsdl": True,
);
public:
constructor(string name, string desc, string url, bool monitor, *hash n_opts, hash urlh) ;
string getType();
*hash getRuntimeOptions();
private:
SoapClient getImpl(bool connect = True, *hash rtopts);
public:
hash getOptions();
*hash getDefaultOptions();
static SoapConnection make(string name, string desc, string url, bool monitor, *hash opts, hash urlh);
};
};
SoapClient::SoapConnection::getDefaultOptions
*hash getDefaultOptions()
returns default options
SoapClient::SoapConnection::constructor
constructor(string name, string desc, string url, bool monitor, *hash n_opts, hash urlh)
creates the SoapConnection object
SoapClient::SoapConnection::getType
string getType()
returns "soap"
SoapClient::SoapConnection::getOptions
hash getOptions()
gets options
WSDL::WebService
SoapClient::SoapConnection::getRuntimeOptions
*hash getRuntimeOptions()
returns runtime options
SoapClient
main SoapClient namespace
Definition: SoapClient.qm.dox.h:122
SoapClient::SoapConnection
class for SOAP connections; returns an object of class SoapClient for connecting to SOAP servers ...
Definition: SoapClient.qm.dox.h:518
SoapClient::SoapConnection::getImpl
SoapClient getImpl(bool connect=True, *hash rtopts)
returns a SoapClient object
SoapClient::SoapClient::url
string url
target URL
Definition: SoapClient.qm.dox.h:157
SoapClient::SoapConnection::make
static SoapConnection make(string name, string desc, string url, bool monitor, *hash opts, hash urlh)
static constructor