function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jay EcklesJay Eckles 

trouble getting started with Perl WWW::Salesforce::Simple

#!/usr/bin/perl
use WWW::Salesforce::Simple ;

my $sforce = WWW::Salesforce::Simple->new( username => 'user@domain.com',
                                           password => 'pas$w@rd!' );
print "Connection result: $sforce\n" ;

 I'm unable to get the basic code above to work.  When I run it, either on Linux or on Windows, I get the following message:

Incorrect parameter at /path/to/perl5/lib/perl5/SOAP/Lite.pm line 1993

I'm using EPIC to debug.  The failure is occuring at line 482 of Salesforce.pm:

 

 

    $self->{'sf_sid'}       = $r->valueof('//loginResponse/result/sessionId');

 My debugger shows that there is a value for //loginResponse/result/sessionId.  The valueof function is calling the match method which is calling the _traverse method.  _traverse is recursive, but line 1993 of Lite.pm prevents the recursion tree from gong more than 10 levels deep, which is where my code dies out.

 

I can't, however, quite follow the logic of the _traverse function. Is there a bug there?

 

Best Answer chosen by Admin (Salesforce Developers) 
cajcaj

This is a known issue (https://rt.cpan.org/Public/Bug/Display.html?id=78692) exhibited in the most recent version (0.715) of the SOAP Lite perl module which Salesforce Simple has a dependency. Rather than modifying the source code of the Salesforce Simple module, a better option would be to downgrade to the previous SOAP Lite module version (0.714).

 

sudo cpan -I MKUTTER/SOAP-Lite-0.714.tar.gz

 

All Answers

Jay EcklesJay Eckles

Still have not figured anything out.  Emailed Fred Moyer.  Found out that if I dig into the data structure of the response object directly I can replace the valueof calls and at least get my data and get going with my development, but I'm a little worried about future module upgrades that might change the data structure.

DShahinDShahin

I'm having the exact same issue, but haven't been able to login yet.

Is there any known fix for this, or has WWW::Salesforce been abandoned?

 

dan shahin

Jay EcklesJay Eckles

My interim solution has been to replace all instances of 

valueof( "//a/b/c" ) 

 with

{"_content"}[4]{"Body"}{"a"}{"b"}{"c"}

 In Salesforce.pm and Salesforce/Simple.pm.

 

That's kludgy, but it works.

 

Have not heard back from Fred.

makiwmakiw

I patched SOAP/Lite.pm line 1993 from:

  die "Incorrect parameter" unless $itself =~/^\d$/;

to

  die "Incorrect parameter" unless $itself =~/^\d+$/;

 

cajcaj

This is a known issue (https://rt.cpan.org/Public/Bug/Display.html?id=78692) exhibited in the most recent version (0.715) of the SOAP Lite perl module which Salesforce Simple has a dependency. Rather than modifying the source code of the Salesforce Simple module, a better option would be to downgrade to the previous SOAP Lite module version (0.714).

 

sudo cpan -I MKUTTER/SOAP-Lite-0.714.tar.gz

 

This was selected as the best answer