SalesforceSoapClient::SalesforceSoapConnection Class Reference

class for SOAP connections to the Salesforce.com SOAP API; returns an object of class SalesforceSoapClient More...

Inherits SoapConnection.

## Public Member Functions

| constructor (string name, string desc, string url, bool monitor, *hash opts, hash urlh)
| creates the SoapConnection object More...
string | getType ()
| returns `"sfsoap"`
hash | getOptions ()
| gets options
*hash | getRuntimeOptions ()
| returns runtime options More...

## Static Public Member Functions

static SalesforceSoapConnection | make (string name, string desc, string url, bool monitor, *hash opts, hash urlh)
| static constructor

## Private Member Functions

SalesforceSoapClient | getImpl (bool connect=True, *hash rtopts)
| returns a SalesforceSoapClient object More...
WSDL::WebService | getWsdl (string url)
| returns a WSDL::WebService object for the given URL using a cache for local files More...
synchronized WSDL::WebService | getWsdlFromCache (string path)
| returns a WSDL::WebService object for the given path from the cache if possible, otherwise creates the object and populates the cache
WSDL::WebService | getWebService (string url)
| returns a WSDL::WebService object from the given URL

## Private Attributes

hash | cache
| cache of WebService objects keyed by file location

## Detailed Description

class for SOAP connections to the Salesforce.com SOAP API; returns an object of class SalesforceSoapClient

supports the following static initialization options:

- `"connect_timeout"`: connection timeout to use in milliseconds
- `"content_encoding"`: this sets the send encoding (if the `"send_encoding"` option is not set) and the requested response encoding; for possible values, see EncodingSupport
- `"force_logout"`: forces a logout when the SalesforceSoapClient object is destroyed; this should normally be False to allow for the session to remain valid
- `"http_version"`: HTTP version to use (`"1.0"` or `"1.1"`, defaults to `"1.1"`)
- `"max_redirects"`: maximum redirects to support
- `"password"`: Salesforce.com password
- `"port"`: in case multiple port entries are found in the WSDL, give the one to be used here
- `"portType"`: in case multiple portType entries are found in the WSDL, give the one to be used here
- `"proxy"`: proxy URL to use
- `"send_encoding"`: a send data encoding option or the value `"auto"` which means to use automatic encoding; if not present defaults to no content-encoding on sent message bodies
- `"target_url"`: overrides the URL in the WSDL (mapped to `"url"` in the SoapClient::constructor() argument)
- `"token"`: Salesforce.com user API token
- `"timeout"`: transfer timeout to use in milliseconds
- `"username"`: Salesforce.com username
- `"wsdl"`: overrides the WSDL URL provided by the connection URL; `"wsdl"` values with a `"file://"` scheme are subject to environment variable substitution

See also
  SalesforceSoapClient::constructor(hash) for more information on the above options

Note
  - additionally supports the following runtime options in getImpl() for connection logging:
    - `"log"`: a closure accepting a single string for logging
    - `"dbglog"`: a closure taking a single string for detailed technical connection logging
  - the following options are required:
    - `"username"`: (required) Salesforce.com username
    - `"password"`: (required) Salesforce.com password
    - `"token"`: (required) Salesforce.com user API token

## Member Function Documentation

## constructor()

SalesforceSoapClient::SalesforceSoapConnection::constructor | ( | string | name,
|  | string | desc,
|  | string | url,
|  | bool | monitor,
|  | *hash | opts,
|  | hash | urlh
| ) |  |

creates the SoapConnection object

Parameters

  name | the name of the connection
  desc | connection description
  url | connection URL
  monitor | monitoring flag
  opts | connection options
  urlh | broken down URL hash (as returned by Qore::parse_url())

Exceptions

  SALESFORCE-SOAP-ERROR | missing one or more of the required options: `"username"`, `"password"`, or `"token"`

## getImpl()

SalesforceSoapClient SalesforceSoapClient::SalesforceSoapConnection::getImpl | ( | bool | connect = `True`,
|  | *hash | rtopts
| ) |  |

private

returns a SalesforceSoapClient object

Parameters

  connect | if True, then SalesforceSoapClient::login() is called

  rtopts

  an optional hash providing two runtime options for connection logging:
  - `"log"`: a closure accepting a single string for logging
  - `"dbglog"`: a closure taking a single string for detailed technical connection logging

Returns
  an SalesforceSoapClient object

## getRuntimeOptions()

*hash SalesforceSoapClient::SalesforceSoapConnection::getRuntimeOptions | ( |  | ) |

returns runtime options

Returns
  a hash with the following keys reflecting support for the corresponding runtime options in getImpl() for connection logging:
  - `"log"`: a closure accepting a single string for logging
  - `"dbglog"`: a closure taking a single string for detailed technical connection logging

## getWsdl()

WSDL::WebService SalesforceSoapClient::SalesforceSoapConnection::getWsdl | ( | string | url | ) |

private

returns a WSDL::WebService object for the given URL using a cache for local files

Parameters

  url | the URL of the WSDL

Returns
  a WSDL::WebService object corresponding to the WSDL URL