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
jmarinchakjmarinchak 

Need help with Perl interface

I'm using the WWW::Salesforce::Simple module and I can login and read objects but, I can't create anything.
 
My code is:
use strict;
use WWW::Salesforce::Simple;
use SOAP::Lite +trace => 'debug';
my $sforce = WWW::Salesforce::Simple->new(
        'username' => $ARGV[0],
        'password' => $ARGV[1]
);
my %j_task = (type => 'Task', Subject => "Contact Jeff", Description => "Description Placeholder");
$sforce->create(%j_task);
 
The output is:
C:\Perl>perl create_lead.pl username password
SOAP::Transport::HTTP::Client::send_receive: POST
https://www.salesforce.com/services/Soap/u/8.0
Accept: text/xml
Accept: multipart/*
Content-Length: 584
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP=ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="
http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><namesp1:login xmlns:namesp1="urn:partner.soap.sforce.com"><username xsi:type="xsd:string">username</username><password xsi:type="xsd:string">password</password></namesp1:login></SOAP-ENV:Body></SOAP-ENV:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error
Connection: close
Date: Fri, 23 Mar 2007 22:35:32 GMT
Server:
Content-Length: 615
Content-Type: text/xml; charset=utf-8
Client-Date: Fri, 23 Mar 2007 22:35:28 GMT
Client-Peer: 204.14.234.33:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign
International Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign
Client-SSL-Cert-Subject: /C=US/ST=California/L=San Francisco/O=Salesforce.com, I
nc./OU=Applications/OU=Terms of use at
www.verisign.com/rpa (c)00/CN=www.salesforce.com
Client-SSL-Cipher: RC4-MD5
Client-SSL-Warning: Peer certificate not verified
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>sf:INVALID_LOGIN</faultcode><faultstring>INVALID_LOGIN: Invalid username or password or locked out.</faultstring><detail><sf:faultxsi:type="sf:LoginFault"><sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode><sf:exceptionMessage>
Invalid username or password or locked out.</sf:exceptionMessage></sf:fault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
INVALID_LOGIN: Invalid username or password or locked out. at create_lead.pl line 6
Can't call method "create" without a package or object reference at create_lead.pl line 15.
jmarinchakjmarinchak

I figured it out.  It looks like I did not have the salesforce::simple module installed completely. 

I also noticed that the output I posted shows that I was not even passing the correct username/password so I couldn't log on.