Qore SalesforceSoapClient Module Reference  1.1
SalesforceSoapClient.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
2 // @file SalesforceSoapClient.qm Salesforce SOAP Client Definition Module
3 
4 /* SalesforceSoapClient.qm Copyright (C) 2015 - 2017 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 
26 
27 
80 namespace SalesforceSoapClient {
83 
90 
91 public:
92  private :
93  // mutex for atomic operations
94  Mutex lck();
95  // logged in flag
96  bool logged_in = False;
97 
98  // Salesforce.com username
99  string username;
100  // Salesforce.com user password
101  string password;
102  // Salesforce.com user token
103  string token;
104 
105  // Salesforce.com server URL
106  string serverurl;
107  // Salesforce.com session ID
108  string sessionid;
109 
110  // default SoapAction value
111  string soapaction = "default";
112 
113  // perform a logout when destroying the object
116  bool force_logout = False;
117 
118 public:
119 
120  public :
122  const AuthorizationHash = (
123  "username": True,
124  "password": True,
125  "token": True,
126  );
127 
129  const AuthorizationOpts = AuthorizationHash.keys();
130 
132  const RequiredOpts = AuthorizationOpts + (
133  "wsdl",
134  );
135 
136 public:
137 
139 
145  constructor(hash opts) ;
146 
147 
149 
151  destructor();
152 
153 
155 
156 private:
157  processOpts(hash opts);
158 public:
159 
160 
162  login();
163 
164 
166  logout();
167 
168 
170  disconnect();
171 
172 
174 
202  any callOperation(string operation, any args, *hash opts, *reference info);
203 
204 
206 
235 private:
236  any callIntern(string operation, any args, *hash opts, *reference info);
237 public:
238 
239 
241 
247  any call(string operation, any args, *hash header);
248 
249 
251 
267  any call(string operation, any args, reference info);
268 
269 
271 
288  any call(reference info, string operation, any args, *hash header);
289 
290 
291  nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, any arg, timeout min_ms = 1s);
292 
293 
294  nothing clearWarningQueue();
295 
296 
298 
303  any methodGate(string op, any arg);
304 
305 
306 
307 private:
308  logoutIntern();
309 public:
310 
311 
312  // must be called with the lock held
313 
314 private:
315  loginIntern();
316 public:
317 
318  };
319 
321 
349 class SalesforceSoapConnection : public SoapConnection {
350 
351 public:
352  public :
353  const Options = SoapConnection::Options + SalesforceSoapClient::AuthorizationHash;
354 
355 public:
356 
357  private :
359  hash cache;
360 
361 public:
362 
364 
373  constructor(string name, string desc, string url, bool monitor, *hash opts, hash urlh) ;
374 
375 
377  string getType();
378 
379 
381 
389 private:
390  SalesforceSoapClient getImpl(bool connect = True, *hash rtopts);
391 public:
392 
393 
395 
400 private:
401  WSDL::WebService getWsdl(string url);
402 public:
403 
404 
406 
407 private:
408  synchronized WSDL::WebService getWsdlFromCache(string path);
409 public:
410 
411 
413 
414 private:
415  WSDL::WebService getWebService(string url);
416 public:
417 
418 
420  hash getOptions();
421 
422 
424 
428  *hash getRuntimeOptions();
429 
430 
432  static SalesforceSoapConnection make(string name, string desc, string url, bool monitor, *hash opts, hash urlh);
433  };
434 };
const AuthorizationHash
authorization key required for logging in to Salesforce.com
Definition: SalesforceSoapClient.qm.dox.h:122
static SalesforceSoapConnection make(string name, string desc, string url, bool monitor, *hash opts, hash urlh)
static constructor
synchronized WSDL::WebService getWsdlFromCache(string path)
returns a WSDL::WebService object for the given path from the cache if possible, otherwise creates th...
main SalesforceSoapClient module namespace
Definition: SalesforceSoapClient.qm.dox.h:81
hash cache
cache of WebService objects keyed by file location
Definition: SalesforceSoapClient.qm.dox.h:359
SalesforceSoapClient getImpl(bool connect=True, *hash rtopts)
returns a SalesforceSoapClient object
constructor(string name, string desc, string url, bool monitor, *hash opts, hash urlh)
creates the SoapConnection object
WSDL::WebService getWsdl(string url)
returns a WSDL::WebService object for the given URL using a cache for local files ...
class for SOAP connections to the Salesforce.com SOAP API; returns an object of class SalesforceSoapC...
Definition: SalesforceSoapClient.qm.dox.h:349
WSDL::WebService getWebService(string url)
returns a WSDL::WebService object from the given URL
*hash getRuntimeOptions()
returns runtime options