Mulga has asked for the wisdom of the Perl Monks concerning the following question:

Monks,

Hope all is well. I would very much appreciate any wisdom you can provide on using the salesforce.pm module.

I am using the code below and it fails with :

Incorrect parameter at c:/Perl64/site/lib/SOAP/Lite.pm line 1993.

Any help would be greatly appreciated

#!/usr/bin/perl use strict; use WWW::Salesforce::Simple ; $WWW::Salesforce::SF_PROXY = 'https://test.salesforce.com/services/Soa +p/u/8.0'; my $sf = WWW::Salesforce::Simple->new( username => 'uid@domain.trial.sandbox1', password => 'password' . 'atoken'); unless ($sf) { warn("failed sf connection"); }

Kind Regards

Paul

Replies are listed 'Best First'.
Re: Help with Salesforce.pm module
by NetWallah (Canon) on May 21, 2013 at 05:03 UTC
    It is die-ing at this line:
    sub _traverse { my ($self, $pointer, $itself, $path, @path) = @_; die "Incorrect parameter" unless $itself =~/^\d+$/; ...
    A Stack trace would help. Try to run it under the perl debugger:
    perl -d <your-program-name> # At the prompt, enter "c" (without the quotes), then <enter>.

                 "I'm fairly sure if they took porn off the Internet, there'd only be one website left, and it'd be called 'Bring Back the Porn!'"
            -- Dr. Cox, Scrubs

      Many thanks for reposnding.

      I get the following from the debugger

      Incorrect parameter at c:/Perl64/site/lib/SOAP/Lite.pm line 1993. at c:/Perl64/site/lib/SOAP/Lite.pm line 1993 SOAP::SOM::_traverse('SOAP::SOM=HASH(0x4cfbde8)', 'ARRAY(0x4cf +79a0)', 10, '', 'loginResponse ', 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm li +ne 2037 SOAP::SOM::_traverse_tree('SOAP::SOM=HASH(0x4cfbde8)', 'ARRAY( +0x4cf7260)', '', 'loginRespons e', 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm l +ine 2025 SOAP::SOM::_traverse('SOAP::SOM=HASH(0x4cfbde8)', 'ARRAY(0x4cf +7290)', 5, '', 'loginResponse' , 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm lin +e 2037 SOAP::SOM::_traverse_tree('SOAP::SOM=HASH(0x4cfbde8)', 'ARRAY( +0x4cf6c18)', '', 'loginRespons e', 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm l +ine 2025 SOAP::SOM::_traverse('SOAP::SOM=HASH(0x4cfbde8)', 'ARRAY(0x4cf +6f30)', 1, '', 'loginResponse' , 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm lin +e 2037 SOAP::SOM::_traverse_tree('SOAP::SOM=HASH(0x4cfbde8)', 'ARRAY( +0x4cf7dd8)', '', 'loginRespons e', 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm l +ine 2025 SOAP::SOM::_traverse('SOAP::SOM=HASH(0x4cfbde8)', 'ARRAY(0x4cf +6ea0)', 1, '', 'loginResponse' , 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm lin +e 2037 SOAP::SOM::_traverse_tree('SOAP::SOM=HASH(0x4cfbde8)', 'ARRAY( +0x4cf7be0)', '', 'loginRespons e', 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm l +ine 2025 SOAP::SOM::_traverse('SOAP::SOM=HASH(0x4cfbde8)', 'ARRAY(0x4cf +6d08)', 1, '', 'loginResponse' , 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm lin +e 2037 SOAP::SOM::_traverse_tree('SOAP::SOM=HASH(0x4cfbde8)', 'ARRAY( +0x4cf7ef8)', '', 'loginRespons e', 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm l +ine 2025 SOAP::SOM::_traverse('SOAP::SOM=HASH(0x4cfbde8)', 'ARRAY(0x4cf +6e10)', 1, '', 'loginResponse' , 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm lin +e 1985 SOAP::SOM::match('SOAP::SOM=HASH(0x4cfbde8)', '//loginResponse +/result/sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm line 1910 SOAP::SOM::valueof('SOAP::SOM=HASH(0x4cfbde8)', '//loginRespon +se/result/sessionId') called a t c:/Perl64/site/lib/WWW/Salesforce.pm line 505 WWW::Salesforce::login('WWW::Salesforce::Simple', 'username', +'uid@domain.trial.sandbox 1', 'password', 'passwordtoken') called at c:/Perl64/site/lib/WWW/Sale +sforce/S imple.pm line 19 WWW::Salesforce::Simple::new('WWW::Salesforce::Simple', 'usern +ame', 'uid@domain.trial.s andbox1', 'password', 'passwordtoken') called at test-salesforce-03-cp +an.pl li ne 17
        In case you did not notice frieduck's (++) response below - I think he is on the right track.

        This problem is described on CPAN as Bug#78692, and is resolved in version 0.716 of SOAP-Lite.

                     "I'm fairly sure if they took porn off the Internet, there'd only be one website left, and it'd be called 'Bring Back the Porn!'"
                -- Dr. Cox, Scrubs

Re: Help with Salesforce.pm module
by Anonymous Monk on May 21, 2013 at 07:02 UTC
Re: Help with Salesforce.pm module
by frieduck (Hermit) on May 21, 2013 at 13:37 UTC

    That looks like a bug that was fixed in the latest version of SOAP-Lite. From the changelog:

     ! #78692 / #84724 / #83715 Sending large object (many levels deep) throws error Incorrect parameter

      Added Carp::Always as suggested.

      It doesn't appear to have given anything more

      main::(test-salesforce-03-cpan.pl:7): 7: my $uid = 'uid@domain.trial.sandbox1'; DB<1> c Incorrect parameter at c:/Perl64/site/lib/SOAP/Lite.pm line 1993. SOAP::SOM::_traverse('SOAP::SOM=HASH(0x4960d10)', 'ARRAY(0x495 +e8e8)', 10, '', 'loginResponse ', 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm li +ne 2037 SOAP::SOM::_traverse_tree('SOAP::SOM=HASH(0x4960d10)', 'ARRAY( +0x495e1a8)', '', 'loginRespons e', 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm l +ine 2025 SOAP::SOM::_traverse('SOAP::SOM=HASH(0x4960d10)', 'ARRAY(0x495 +e1d8)', 5, '', 'loginResponse' , 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm lin +e 2037 SOAP::SOM::_traverse_tree('SOAP::SOM=HASH(0x4960d10)', 'ARRAY( +0x495db60)', '', 'loginRespons e', 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm l +ine 2025 SOAP::SOM::_traverse('SOAP::SOM=HASH(0x4960d10)', 'ARRAY(0x495 +de78)', 1, '', 'loginResponse' , 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm lin +e 2037 SOAP::SOM::_traverse_tree('SOAP::SOM=HASH(0x4960d10)', 'ARRAY( +0x495ed20)', '', 'loginRespons e', 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm l +ine 2025 SOAP::SOM::_traverse('SOAP::SOM=HASH(0x4960d10)', 'ARRAY(0x495 +dde8)', 1, '', 'loginResponse' , 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm lin +e 2037 SOAP::SOM::_traverse_tree('SOAP::SOM=HASH(0x4960d10)', 'ARRAY( +0x495eb28)', '', 'loginRespons e', 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm l +ine 2025 SOAP::SOM::_traverse('SOAP::SOM=HASH(0x4960d10)', 'ARRAY(0x495 +dc50)', 1, '', 'loginResponse' , 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm lin +e 2037 SOAP::SOM::_traverse_tree('SOAP::SOM=HASH(0x4960d10)', 'ARRAY( +0x495ee40)', '', 'loginRespons e', 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm l +ine 2025 SOAP::SOM::_traverse('SOAP::SOM=HASH(0x4960d10)', 'ARRAY(0x495 +dd58)', 1, '', 'loginResponse' , 'result', 'sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm lin +e 1985 SOAP::SOM::match('SOAP::SOM=HASH(0x4960d10)', '//loginResponse +/result/sessionId') called at c:/Perl64/site/lib/SOAP/Lite.pm line 1910 SOAP::SOM::valueof('SOAP::SOM=HASH(0x4960d10)', '//loginRespon +se/result/sessionId') called a t c:/Perl64/site/lib/WWW/Salesforce.pm line 505 WWW::Salesforce::login('WWW::Salesforce::Simple', 'username', +'uid@domain.trial.sandbox 1', 'password', 'passwordtoken') called at c:/Perl64/site/lib/WWW/Sale +sforce/S imple.pm line 19 WWW::Salesforce::Simple::new('WWW::Salesforce::Simple', 'usern +ame', 'uid@domain.trial.s andbox1', 'password', 'passwordtoken') called at test-salesforce-03-cp +an.pl li ne 17 Debugged program terminated. Use q to quit or R to restart,
        um, carp::always is not for inside the debugger