NAME

WWW::SFDC::Role::SessionConsumer - Provides a transparent interface to WWW::SFDC::SessionManager

VERSION

version 0.37

SYNOPSIS

    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;

ATTRIBUTES

session

This is a WWW::SFDC object, and is required when this module is constructed.

url

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.

METHODS

_call

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.

BUGS

Please report any bugs or feature requests at https://github.com/sophos/WWW-SFDC/issues.

SUPPORT

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

AUTHOR

Alexander Brett <alexander.brett@sophos.com> http://alexander-brett.co.uk

COPYRIGHT AND LICENSE

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.