• Perl
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 17
    Replies
HI ,
  We are using www::salesforce module to connect to salesforce , We successfully connected to
salesforce after changing the https:// to http://  in the $SF_PROXY
But now our program aborts saying
 
500 Connect failed: connect: Connection refused; Connection refused at //pkgs/linux/intel/perlmods_intcrm/5.8.8.rhas3.x86/lib/site_perl//5.8.8/WWW/Salesforce.pm line 673
(I have attached the trace at the end)
this line number corresponds to get_Seession_header .
 
the code in salesforce.pm at the error line #673
my $r = $client->call(
            $method => SOAP::Data->prefix( $SF_PREFIX )
                ->name( 'searchString' => $in{'searchString'} )
                ->type( 'xsd:string' ),
            $self->get_session_header()
 
Could anyone  please help me to fix this issue
 
THanks,
Prasanna
Please find the trace:

SOAP::Transport::new: ()

SOAP::Serializer::new: ()

SOAP::Deserializer::new: ()

SOAP::Parser::new: ()

SOAP::Lite::new: ()

SOAP::Lite::new: ()

SOAP::Deserializer::new: ()

SOAP::Parser::new: ()

SOAP::Deserializer::DESTROY: ()

SOAP::Serializer::new: ()

SOAP::Transport::HTTP::Client::new: ()

SOAP::Serializer::DESTROY: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Lite::call: ()

SOAP::Serializer::envelope: ()

SOAP::Serializer::envelope: login SOAP::Data=HASH(0x83939a8) SOAP::Data=HASH(0x835cbbc)

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x84b522c)

SOAP::Transport::HTTP::Client::send_receive: POST http://www.salesforce.com/services/Soap/u/8.0 HTTP/1.1

Accept: text/xml

Accept: multipart/*

Accept: application/soap

Content-Length: 538

Content-Type: text/xml; charset=utf-8

SOAPAction: ""

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><login xmlns="urn:partner.soap.sforce.com"><username xsi:type="xsd:string">"username"</username><password xsi:type="xsd:string">"password"</password></login></soap:Body></soap:Envelope>

SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x879f024)

SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK

Date: Tue, 23 Sep 2008 07:35:29 GMT

Server:

Content-Length: 1305

Content-Type: text/xml; charset=utf-8

Client-Date: Tue, 23 Sep 2008 07:35:29 GMT

Client-Peer: 204.14.234.33:80

Client-Response-Num: 1

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><loginResponse><result><passwordExpired>false</passwordExpired><serverUrl>https://eu0-api.salesforce.com/services/Soap/u/8.0/440400D200000000CXT</serverUrl><sessionId>440400D200000000CXT!AREAQLmu82GqZ9K5KSLFUBa2S83PMblXGEbU6..vCDzroi6GTJ9expfmJ0YsOVHdpEKFEJUqTdxoBhSYZ5rDpb1Mp08Acumk</sessionId><userId>00520000000nkSBAAY</userId><userInfo><accessibilityMode>false</accessibilityMode><currencySymbol>$</currencySymbol><licenseType>Salesforce</licenseType><organizationId>00D200000000CXTEA2</organizationId><organizationMultiCurrency>false</organizationMultiCurrency><organizationName>E*TRADE</organizationName><profileId>00e20000000hFVLAA2</profileId><roleId xsi:nil="true"/><userDefaultCurrencyIsoCode xsi:nil="true"/><userEmail>"username"</userEmail><userFullName>US APAC</userFullName><userId>00520000000nkSBAAY</userId><userLanguage>en_US</userLanguage><userLocale>en_GB</userLocale><userName>"username"</userName><userTimeZone>Europe/London</userTimeZone><userUiSkin>Theme2</userUiSkin></userInfo></result></loginResponse></soapenv:Body></soapenv:Envelope>

SOAP::Deserializer::deserialize: ()

SOAP::Parser::decode: ()

SOAP::SOM::new: ()

SOAP::SOM::DESTROY: ()

SOAP::Lite::DESTROY: ()

SOAP::Deserializer::DESTROY: ()

SOAP::Parser::DESTROY: ()

SOAP::Transport::DESTROY: ()

SOAP::Transport::HTTP::Client::DESTROY: ()

SOAP::Serializer::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

aiya connected

SOAP::Lite::new: ()

SOAP::Deserializer::new: ()

SOAP::Parser::new: ()

SOAP::Deserializer::DESTROY: ()

SOAP::Serializer::new: ()

SOAP::Transport::HTTP::Client::new: ()

SOAP::Serializer::DESTROY: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Lite::call: ()

SOAP::Serializer::envelope: ()

SOAP::Data::new: ()

SOAP::Serializer::envelope: SOAP::Data=HASH(0x835cbd4) SOAP::Data=HASH(0x835cd00)

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x8874b78)

SOAP::Transport::HTTP::Client::send_receive: POST https://eu0-api.salesforce.com/services/Soap/u/8.0/440400D200000000CXT HTTP/1.1

Accept: text/xml

Accept: multipart/*

Accept: application/soap

Content-Length: 809

Content-Type: text/xml; charset=utf-8

SOAPAction: ""

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><sforce:SessionHeader xmlns:sforce="urn:partner.soap.sforce.com"><sessionId xsi:type="xsd:string">440400D200000000CXT!AREAQLmu82GqZ9K5KSLFUBa2S83PMblXGEbU6..vCDzroi6GTJ9expfmJ0YsOVHdpEKFEJUqTdxoBhSYZ5rDpb1Mp08Acumk</sessionId></sforce:SessionHeader></soap:Header><soap:Body><sforce:search xmlns:sforce="urn:partner.soap.sforce.com"><sforce:searchString xsi:type="xsd:string">SELECT Id,Name FROM Account</sforce:searchString></sforce:search></soap:Body></soap:Envelope>

SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x886fab0)

SOAP::Transport::HTTP::Client::send_receive: 500 Connect failed: connect: Connection refused; Connection refused

Content-Type: text/plain

Client-Date: Tue, 23 Sep 2008 07:35:30 GMT

Client-Warning: Internal response

500 Connect failed: connect: Connection refused; Connection refused

SOAP::Deserializer::deserialize: ()

SOAP::Parser::decode: ()

500 Connect failed: connect: Connection refused; Connection refused at /etrade/pkgs/linux/intel/perlmods_intcrm/5.8.8.rhas3.x86/lib/site_perl//5.8.8/WWW/Salesforce.pm line 673

SOAP::Lite::DESTROY: ()

SOAP::Deserializer::DESTROY: ()

SOAP::Parser::DESTROY: ()

SOAP::Serializer::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Transport::DESTROY: ()

SOAP::Transport::HTTP::Client::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Parser::DESTROY: ()

SOAP::Transport::DESTROY: ()

SOAP::Serializer::DESTROY: ()

SOAP::Deserializer::DESTROY: ()

SOAP::Lite::DESTROY: ()

  • September 23, 2008
  • Like
  • 0
All , I am new to salesforce , We are trying to connect to salesforce from PERL using WWW::Salesforce::Simple;
 
I am getting the following error when i run the code
500 Server closed connection without sending any data back at //pkgs/linux/intel/perl/5.8.8.rhas3.x86/lib/site_perl/5.8.8/WWW/Salesforce.pm line 469
 
But we are able to connec to the salesforce site using the same username and password and also we are able to ping the salesforce site from the unix machine.
 
Is there any steps i should follow before coding , i used the steps mentioned in http://www.oreillynet.com/pub/a/network/2006/11/27/using-the-salesforcecom-api.html  , Do i need to put any wsdl file in the perl path , if yes can you tell me where should i place the wsdl file and the steps to connect to salesforce.
 
Thanks,
Prasanna
  • September 17, 2008
  • Like
  • 0
Hi,

I am a bit of an amateur coder so please forgive my ignorance.

I am trying to have the results of a sub query returned in Perl.

my $result = $sforce->do_query("Select FirstName,Account.Name,LastName,Title,Description,(SELECT Note.Body,Note.Title FROM Contact.Notes where Note.title like '%resume%') From Contact where FirstName like '%abcd%'");

    foreach my $row (@$result) {
      print $row->{FirstName}.";".$row->{LastName}.";".$row->{Notes}.";\n";
    ...
I get this:
abcde;test;QueryResult=HASH(0x...)

How do I get the results of the query, i.e. the Note Body and Note Title now?

Thanks!
HI ,
  We are using www::salesforce module to connect to salesforce , We successfully connected to
salesforce after changing the https:// to http://  in the $SF_PROXY
But now our program aborts saying
 
500 Connect failed: connect: Connection refused; Connection refused at //pkgs/linux/intel/perlmods_intcrm/5.8.8.rhas3.x86/lib/site_perl//5.8.8/WWW/Salesforce.pm line 673
(I have attached the trace at the end)
this line number corresponds to get_Seession_header .
 
the code in salesforce.pm at the error line #673
my $r = $client->call(
            $method => SOAP::Data->prefix( $SF_PREFIX )
                ->name( 'searchString' => $in{'searchString'} )
                ->type( 'xsd:string' ),
            $self->get_session_header()
 
Could anyone  please help me to fix this issue
 
THanks,
Prasanna
Please find the trace:

SOAP::Transport::new: ()

SOAP::Serializer::new: ()

SOAP::Deserializer::new: ()

SOAP::Parser::new: ()

SOAP::Lite::new: ()

SOAP::Lite::new: ()

SOAP::Deserializer::new: ()

SOAP::Parser::new: ()

SOAP::Deserializer::DESTROY: ()

SOAP::Serializer::new: ()

SOAP::Transport::HTTP::Client::new: ()

SOAP::Serializer::DESTROY: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Lite::call: ()

SOAP::Serializer::envelope: ()

SOAP::Serializer::envelope: login SOAP::Data=HASH(0x83939a8) SOAP::Data=HASH(0x835cbbc)

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x84b522c)

SOAP::Transport::HTTP::Client::send_receive: POST http://www.salesforce.com/services/Soap/u/8.0 HTTP/1.1

Accept: text/xml

Accept: multipart/*

Accept: application/soap

Content-Length: 538

Content-Type: text/xml; charset=utf-8

SOAPAction: ""

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><login xmlns="urn:partner.soap.sforce.com"><username xsi:type="xsd:string">"username"</username><password xsi:type="xsd:string">"password"</password></login></soap:Body></soap:Envelope>

SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x879f024)

SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK

Date: Tue, 23 Sep 2008 07:35:29 GMT

Server:

Content-Length: 1305

Content-Type: text/xml; charset=utf-8

Client-Date: Tue, 23 Sep 2008 07:35:29 GMT

Client-Peer: 204.14.234.33:80

Client-Response-Num: 1

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><loginResponse><result><passwordExpired>false</passwordExpired><serverUrl>https://eu0-api.salesforce.com/services/Soap/u/8.0/440400D200000000CXT</serverUrl><sessionId>440400D200000000CXT!AREAQLmu82GqZ9K5KSLFUBa2S83PMblXGEbU6..vCDzroi6GTJ9expfmJ0YsOVHdpEKFEJUqTdxoBhSYZ5rDpb1Mp08Acumk</sessionId><userId>00520000000nkSBAAY</userId><userInfo><accessibilityMode>false</accessibilityMode><currencySymbol>$</currencySymbol><licenseType>Salesforce</licenseType><organizationId>00D200000000CXTEA2</organizationId><organizationMultiCurrency>false</organizationMultiCurrency><organizationName>E*TRADE</organizationName><profileId>00e20000000hFVLAA2</profileId><roleId xsi:nil="true"/><userDefaultCurrencyIsoCode xsi:nil="true"/><userEmail>"username"</userEmail><userFullName>US APAC</userFullName><userId>00520000000nkSBAAY</userId><userLanguage>en_US</userLanguage><userLocale>en_GB</userLocale><userName>"username"</userName><userTimeZone>Europe/London</userTimeZone><userUiSkin>Theme2</userUiSkin></userInfo></result></loginResponse></soapenv:Body></soapenv:Envelope>

SOAP::Deserializer::deserialize: ()

SOAP::Parser::decode: ()

SOAP::SOM::new: ()

SOAP::SOM::DESTROY: ()

SOAP::Lite::DESTROY: ()

SOAP::Deserializer::DESTROY: ()

SOAP::Parser::DESTROY: ()

SOAP::Transport::DESTROY: ()

SOAP::Transport::HTTP::Client::DESTROY: ()

SOAP::Serializer::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

aiya connected

SOAP::Lite::new: ()

SOAP::Deserializer::new: ()

SOAP::Parser::new: ()

SOAP::Deserializer::DESTROY: ()

SOAP::Serializer::new: ()

SOAP::Transport::HTTP::Client::new: ()

SOAP::Serializer::DESTROY: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Lite::call: ()

SOAP::Serializer::envelope: ()

SOAP::Data::new: ()

SOAP::Serializer::envelope: SOAP::Data=HASH(0x835cbd4) SOAP::Data=HASH(0x835cd00)

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Data::new: ()

SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x8874b78)

SOAP::Transport::HTTP::Client::send_receive: POST https://eu0-api.salesforce.com/services/Soap/u/8.0/440400D200000000CXT HTTP/1.1

Accept: text/xml

Accept: multipart/*

Accept: application/soap

Content-Length: 809

Content-Type: text/xml; charset=utf-8

SOAPAction: ""

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><sforce:SessionHeader xmlns:sforce="urn:partner.soap.sforce.com"><sessionId xsi:type="xsd:string">440400D200000000CXT!AREAQLmu82GqZ9K5KSLFUBa2S83PMblXGEbU6..vCDzroi6GTJ9expfmJ0YsOVHdpEKFEJUqTdxoBhSYZ5rDpb1Mp08Acumk</sessionId></sforce:SessionHeader></soap:Header><soap:Body><sforce:search xmlns:sforce="urn:partner.soap.sforce.com"><sforce:searchString xsi:type="xsd:string">SELECT Id,Name FROM Account</sforce:searchString></sforce:search></soap:Body></soap:Envelope>

SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x886fab0)

SOAP::Transport::HTTP::Client::send_receive: 500 Connect failed: connect: Connection refused; Connection refused

Content-Type: text/plain

Client-Date: Tue, 23 Sep 2008 07:35:30 GMT

Client-Warning: Internal response

500 Connect failed: connect: Connection refused; Connection refused

SOAP::Deserializer::deserialize: ()

SOAP::Parser::decode: ()

500 Connect failed: connect: Connection refused; Connection refused at /etrade/pkgs/linux/intel/perlmods_intcrm/5.8.8.rhas3.x86/lib/site_perl//5.8.8/WWW/Salesforce.pm line 673

SOAP::Lite::DESTROY: ()

SOAP::Deserializer::DESTROY: ()

SOAP::Parser::DESTROY: ()

SOAP::Serializer::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Transport::DESTROY: ()

SOAP::Transport::HTTP::Client::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Data::DESTROY: ()

SOAP::Parser::DESTROY: ()

SOAP::Transport::DESTROY: ()

SOAP::Serializer::DESTROY: ()

SOAP::Deserializer::DESTROY: ()

SOAP::Lite::DESTROY: ()

  • September 23, 2008
  • Like
  • 0
All , I am new to salesforce , We are trying to connect to salesforce from PERL using WWW::Salesforce::Simple;
 
I am getting the following error when i run the code
500 Server closed connection without sending any data back at //pkgs/linux/intel/perl/5.8.8.rhas3.x86/lib/site_perl/5.8.8/WWW/Salesforce.pm line 469
 
But we are able to connec to the salesforce site using the same username and password and also we are able to ping the salesforce site from the unix machine.
 
Is there any steps i should follow before coding , i used the steps mentioned in http://www.oreillynet.com/pub/a/network/2006/11/27/using-the-salesforcecom-api.html  , Do i need to put any wsdl file in the perl path , if yes can you tell me where should i place the wsdl file and the steps to connect to salesforce.
 
Thanks,
Prasanna
  • September 17, 2008
  • Like
  • 0
Hi

I downloaded the module Salesforce-0.57 & also WWW-Salesforce-0.082, with installing it into, directly use the modules in the sample script and tring to login.
But it fails.
I don't know what i am missing out.

Could any body please help me.

We i went through the documents on developer.force.com i can see the step for java and .net only.
If any body got links or documents for Perl, will help me great.

Thanks
Balaji
Hi
 
 Please find the following steps, I have done this for installing the Plerl Module(WWW-Salesforce-0.082).
 
Kindly check the following error message.
 
=============================================================
C:\perl\lib\WWW-Salesforce-0.082>perl Makefile.PL
Several tests need to be run in order to test the Salesforce Perl module.
You MUST supply a Saleforce username and password in order to proceed.
All tests will fail if you do not provide a valid username and password.
This username and password combination is used ONLY for testing purposes.
Enter user name:  xxxxxx.xxxx@xxxx.xxx
Enter password:  xxxxxx
Writing Makefile for WWW::Salesforce
=============================================================
C:\perl\lib\WWW-Salesforce-0.082>nmake
Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.
=============================================================
C:\perl\lib\WWW-Salesforce-0.082>nmake test
Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.
        C:\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'bl
ib\lib', 'blib\arch')" t/*.t
t/WWW-Salesforce....ok 1/29500 Can't locate object method "new" via package "LWP
::Protocol::https::Socket" at C:\perl\lib\WWW-Salesforce-0.082\blib\lib/WWW/Sale
sforce.pm line 468
# Looks like you planned 29 tests but only ran 1.
# Looks like your test died just after 1.
t/WWW-Salesforce....dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 2-29
        Failed 28/29 tests, 3.45% okay
Failed Test        Stat Wstat Total Fail  List of Failed
-------------------------------------------------------------------------------
t/WWW-Salesforce.t  255 65280    29   56  2-29
Failed 1/1 test scripts. 28/29 subtests failed.
Files=1, Tests=29,  1 wallclock secs ( 0.00 cusr +  0.00 csys =  0.00 CPU)
Failed 1/1 test programs. 28/29 subtests failed.
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0xff'
Stop.
C:\perl\lib\WWW-Salesforce-0.082>
=============================================================
 
Please reply me asap.
 
Thanks & Regards
C.G.Yuvaraj
 
Greetings All,

I am trying to update accounts using the WWW::Salesforce module in Perl, but I am not having any success.  I am able to query successfully and get results.  I can execute update commands without seeing errors, but the records never update.  For example:

-----------------------------
use WWW::Salesforce::Simple;
use SOAP::Lite;

print "Connecting to salesforce...\n";
my $sf = WWW::Salesforce->login( username => 'XX', password => 'XX' );
print "  Done.\n";

$sf::Constants::TYPES{Account}->{Account_Export__c} = 'xsd:boolean';

my $query = "SELECT id,Name,account_export__c, business_id__c, billingstate FROM Account WHERE id = '0014000000GNmKmAAL'" ;

print "Running query...\n";
my $result = $sf->query('query' => $query);
print "Loop results\n";

foreach my $elem ($result->valueof('//queryResponse/result/records'))
{
    @idstring = map{$_}(@{$elem->{id}});
     my ($id1, $id2) = splice(@{$elem->{Id}},0,2);
    print "QUERY RESULT: $elem->{id} $id1 : $elem->{Name} :  $elem->{BillingState}  : $elem->{Business_ID__c} : $elem->{Account_Export__c}\n";
   
    $uphash{type} = "Account";
    $uphash{id} = $id1;
    $uphash->{Name} = "WLV - Parasol Bar";
    $uphash->{"Account_Export__c"} = false;
   
    $upres = $sf->update(%uphash);
    print "UPDATE RESULT: $upres \n";
   
}

print "    Done.\n";


------

Here is the script output:
Connecting to salesforce...
  Done.
Running query...
Loop results
QUERY RESULT: ARRAY(0x1cd4ec8) 0014000000GNmKmAAL : Parasol Bar :  NV : a1234 : true
UPDATE RESULT: 1
    Done.

-------

So the update command returns 1, but the record does not actually get updated.  I have also tried hardcoding the id just for testing like this:
$uphash{id} = "0014000000GNmKmAAL";

because a number of posts I saw revolved around bad Ids, but it still does not work.  I am connecting as a Salesforce Administrator user and I checked all my rights so that should not be an issue.

Any assitance would be greatly appreciated.

Thanks,
Bob


Hi all,
I would like to automate the attachment of files(to opportunites) in SF.
since I have almost  300 files to be attached to different opportunities on a monthly basis.
  • The files(in zip format) are residing my client system(PC).
  • I need to attach these files to required opportunities.
Kindly share your ideas, suggestions and code snippets on this.
 
Thanks in advance,
Krishna
 
I want to upgrade to the new version of the toolkit.  My plan would be to do that and also to use a 12.0 WSDL.  Fine so far.

However, this will be for an AppExchange application and the app has a Web Tab that currently passes the variable {!API.Partner_Server_URL_90} and I use that when establishing a Session connection.

Questions:

1)  If I keep everything in my code as-is, do I need to have all my users upgrade a new web tab to use {!API_Partner_Server_URL_120}?  What would happen if I used the new toolkit and WSDL, but the endpoint was {!API.Partner_Server_URL_90}?  Would it work fine until I made a call that the 9.0 server couldn't understand?

2)  Getting all of the users to upgrade their AppExchange app is not likely and I'd rather not code for 2 scenarios.  Suppose I were to ignore the information coming in the URL string.  How could I go about crafting the URL to act as the endpoint?  Is it always https://SERVER.salesforce.com/services/Soap/u/API_VERSION, where SERVER would be something I could determine by parsing the URL from the customer and API_VERSION would be 12.0 currently?

When I output the URL for my current connection, I get https://na2.salesforce.com/services/Soap/u/9.0/4c2400D300000000G66.  That last part contains an Org ID, but there is some info on the front.  How would I go about crafting this part?

Thanks
  • February 14, 2008
  • Like
  • 0
My perl code login works fine as long as I specify any Salesforce version up to version 6.  However if I specify version 7 or greater, I get the error "The userid/password combination used is not valid".    In other words, login works if I specify this:        
   $request = new HTTP::Request ('POST', 'https://na1.salesforce.com/services/Soap/c/6.0');
while login fails if I specify this:
   $request = new HTTP::Request ('POST', 'https://na1.salesforce.com/services/Soap/c/7.0');

Login XML:

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
    <soapenv:Body>
        <urn:login>
            <urn:username>$USERNAME</urn:username>
            <urnassword>$PASSWORD</urnassword>
        </urn:login>
    </soapenv:Body>
</soapenv:Envelope>

Header info:

    $request->header('User-Agent' => 'Mozilla/4.0');
    $request->header('Content_Type' => 'text/xml; charset=utf-8');
    $request->header('Host' => 'na1.salesforce.com');
    $request->header('SOAPAction' => "");
    $request->header('Expect' => "100-continue");

Has anyone seen this, and if so, how was it solved?

Thanks
  • February 05, 2008
  • Like
  • 0
Hi,
 
   I wrote a very simple perl script to access some information from Salesforce. The script works well in my desktop but it doesn't work in the server. The server platform is Windows 2000 Terminal. Below is the error message, anyone can give me a hint??
 
500 Can't locate object method "new" via package "LWP::Protocol::https::Socket"
(perhaps you forgot to load "LWP::Protocol::https::Socket"?) at C:/Perl/site/lib
/Salesforce.pm line 52
 
thanks,
-Florence
  • November 14, 2007
  • Like
  • 0
I am adapting Tony Stubblebine's example to do a simple update of a Lead record.
I can query the database, and insert new records.  When I attempt to update a
record that's there already, I get the message

  Expected a hash with key 'type' as first argument at soaptest6.pl line 49

from the statement
    $sfresult = $sforce->update(%lead);

I dumped out the hash: it has a key "type" which I inserted first, but it's a hash, right, the keys come back in random order, and PostalCode comes back first. 

I must be missing something simple.  Clue please.

  • March 20, 2007
  • Like
  • 0