+ Start a Discussion
Ron HessRon Hess 

Sfdc.pm

I've been using this as a basis for developing simple scripts to locate duplicates , verify key fields are filled in properly ( I would love a lookup field type ! ) and integerate with our production system for auditing data.

It's not well documented or packaged for CPAN type install (yet) but you may get some ideas.

I just drop this in ...perl/site/lib/Sfdc.pm to get started

you may also need to install Date::Calc from CPAN to get conversions to and from sforce date formats

enjoy

Josh M.Josh M.

Ron,

Thx for posting this code. I�m in the process of evaluating means of integration to SFDC and Perl is one of our options.

I have a few questions:

I assume you are running on a win environment (ActiveState).

Where did you get XMLRPC::Lite?

From what I gathrered it is part of SOAP::Lite, which I have installed⬦ but I get an error on the use XMLRPC.

And also... where to place Sfdc::Serializer? (A sub-dir under perl/site/lib?)

Thx in advance,

Josh

adamgadamg
Have you tried using SOAP::Lite directly w/the 2.0 WSDL?  (Via SOAP as opposed to XML-RPC).  I have been meaning to give that a shot, and given the AXIS compatability fixes hope that it would be reasonable straight forward.
andyandy
Using a very slightly modified version of your Sfdc.pm (I removed the calls to the Registry since I'm working on a Mac), I'm able to execute the following script:

----------
#!/usr/bin/perl -w

use Sfdc;

$username = 'andy@genuinelyuseful.com';
$password = 'argle';

my $login = Sfdc::call('sfdc.login', username => $username, password => $password);

print "Found it.\n";
----------

My password obviously isn't "argle", but you get the picture. Anyhow, it runs but I always get the following error:

1112 fault user not valid

Any help would be greatly appreciated.

Regards,
Andy
DevAngelDevAngel

Hi andy,

At a minimum you will need to make the following change:

my $proxy = 'http://www.salesforce.com/servlet/sales.servlet.Api';   #was 'http://ssl.salesforce.com/servlet/sales.servlet.Api';
my $client = 'LiuwguKtTjU5BwgMCgsMDQ4PcHFycwAj'; # probably not needed
my $sfdcversion = 1.5;  # default version is lowest
sub apiversion { $sfdcversion = shift; } # allow version to be set

You will probably want to change the version to 1.9 or 2.0 also.  After successfully logging in, you will be resetting my $proxy to the server_url returned from the login call.

andyandy
I changed the version to 1.9 and the URL as specified. After executing it, I get the following response:

----------
method
< ?xml version="1.0" encoding="UTF-8"?>
< methodCall>
< methodName>sfdc.login< /methodName>
< params>
< param>< value>< struct>
< member>< name>username< /name>< value>andy@genuinelyuseful.com< /value>< /member>
< member>< name>client< /name>< value>LiuwguKtTjU5BwgMCgsMDQ4PcHFycwAj< /value>< /member>
< member>< name>password< /name>< value>argle< /value>< /member>
< member>< name>version< /name>< value>< string>1.9< /string>< /value>< /member>
< /struct>< /value>< /param>< /params>< /methodCall>
failed
----------

Again, "argle" has been changed to protect the innocent. I also have to put a space after every "
Help?!?

- Andy

Message Edited by andy on 08-05-2003 03:29 PM

Message Edited by andy on 08-05-2003 03:33 PM

andyandy
Any chance we could get you to post an example of logging in and doing a simple query using SOAP::Lite? I'm fairly new to this and am having trouble getting it working and would LOVE an example since there aren't any code samples using Perl anywhere on the site.

All the best,
Andy
Josh M.Josh M.

I started messing with SOAP::Lite but have no sample code.

I actually turn to Java to get some things done quickly.

It�s a pity there isn�t much more Perl code here.

Josh

adamgadamg
We don't have any specific plans yet for Perl samples, but I would expect to see some stuff from us around the next release.  In the meantime, if anyone has even half-baked SOAP::Lite Perl samples, I'd be happy to help polish them up.
Ron HessRon Hess

sorry for the delay getting back to this message board

XMLPRC::Lite was in the active state install i believe, if not everything else i get came from CPan

I just put SFDC::serializer in my perl/site/lib directory

I haven't tried to use the perl SOAP stuff directly with sforce (yet...)

Ron HessRon Hess

not yet, but it sounds like fun, will try this soon