WWW::SFDC::Role::SessionConsumer - Provides a transparent interface to WWW::SFDC::SessionManager
version 0.37
package Example; use Moo; with "WWW::SFDC::Role::Session"; sub _extractURL { # this is a required method. $_[0] is self, as normal. # $_[1] is the loginResult hash, which has a serverUrl as # well as a metadataServerUrl defined. return $_[1]->{serverUrl}; } # uri is a required property, containing the default namespace # for the SOAP request. has 'uri', is => 'ro', default => 'urn:partner.soap.salesforce.com'; sub doSomething { my $self = shift; # this uses the above-defined uri and url, and generates # a new sessionId upon an INVALID_SESSION_ID error: return $self->_call('method', @_); } 1;
This is a WWW::SFDC object, and is required when this module is constructed.
The API endpoint URL for the consuming module. For instance, for the metadata API, this will contain /m/, and for the tooling API will contain /T/. This is constructed using the _extractURL method in the consuming object, which is required.
/m/
/T/
The consuming class can use $self-_call(@params);> - this will handle calling the underlying session with the correct URI and URL. The URI is defined in the consuming class.
$self-
Please report any bugs or feature requests at https://github.com/sophos/WWW-SFDC/issues.
You can find documentation for this module with the perldoc command.
perldoc WWW::SFDC::Role::Session
You can also look for information at https://github.com/sophos/WWW-SFDC
Alexander Brett <alexander.brett@sophos.com> http://alexander-brett.co.uk
This software is Copyright (c) 2015 by Sophos Limited https://www.sophos.com/.
This is free software, licensed under:
The MIT (X11) License
The full text of the license can be found in the LICENSE file included with this distribution.
To install WWW::SFDC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::SFDC
CPAN shell
perl -MCPAN -e shell install WWW::SFDC
For more information on module installation, please visit the detailed CPAN module installation guide.