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
JacksonPJacksonP 

Perl-INVALID_BATCH_SIZE: Unknown batch size nul

use Salesforce;
use SOAP::Lite +trace => 'debug';

my $user="jacksxxxxxxxxx\@gmail.com";
my $pass="Susan123RfxxxxxxxxxxxxEQDV2js";

my $service = new Salesforce::SforceService;
my $port = $service->get_port_binding('Soap');
$port->login('username' => $user,'password' => $pass)
|| die "Could not login to salesforce.com";

my $result = $port->query("SELECT Id, Name, BillingCity FROM Account",3);

---------------------

No matter how I set the query I continue to get an error back.

SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error

SOAP Debug below, continues to point to an invalid batch size which I don't think is true since I set it to all kinds of numbers including not setting it at all.
---------------------

510900D80000000LuLV!AQgAQJOTPgyn7B3NGKkm2R1z4D.b.ZiUY4VUswSIUX_WoohZHQc0G3
1mMPcsFffZtn10nOZOZVXMS8NIgcX0PiP3PScHM.Xjons>mesp2:query xmlns:namesp2="urn:partner.soap.sforce.com">amesp2:query>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error
Date: Fri, 05 Dec 2008 22:08:02 GMT
Server:
Content-Type: text/xml; charset=utf-8
Client-Date: Fri, 05 Dec 2008 22:08:02 GMT
Client-Peer: 204.14.234.109: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. LIABILI
TY LTD.(c)97 VeriSign
Client-SSL-Cert-Subject: /C=US/ST=California/L=San Francisco/O=Salesforce.com, I
nc./OU=Applications/CN=na6-api.salesforce.com
Client-SSL-Cipher: RC4-MD5
Client-SSL-Warning: Peer certificate not verified
Client-Transfer-Encoding: chunked


s:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSc
hema-instance">


soapenv:Server
INVALID_BATCH_SIZE: Unknown batch size null


INVALID_BATCH_SIZE
Unknown batch size null




JacksonPJacksonP
Is this the wrong place to post these kinds of questions? I'd be happy to post some place else if so.

I do need to get some answers going here though.

Can anyone assist?
SuperfellSuperfell
I don't know how the perl tools work, but you appear to be sending null at the batchSize in the queryOptions soap header. You should either not send the header or set it to an actual numerical value. Can you get a capture of your actual request ?
JacksonPJacksonP
Thanks Simon, I've searched high and lo, so far no luck.

Here is the complete transaction including login at the start:

C:\Perl Files\SFDC>perl test.pl
SOAP::Transport::HTTP::Client::send_receive: POST https://www.salesforce.com/ser
vices/Soap/u/4.0
Accept: text/xml
Accept: multipart/*
Content-Length: 608
Content-Type: text/xml; charset=utf-8
SOAPAction: ""

xxxx8@gmail.com
Suxxxx3RfA44QuF7I97QlJr0KEQDV2jsmesp1:login>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Date: Tue, 09 Dec 2008 23:11:49 GMT
Server:
Content-Length: 647
Content-Type: text/xml; charset=utf-8
Client-Date: Tue, 09 Dec 2008 23:11:49 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. LIABILI
TY 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.salesfo
rce.com
Client-SSL-Cipher: RC4-MD5
Client-SSL-Warning: Peer certificate not verified


s:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSc
hema-instance">



https://na6-api.salesforce.com/services/Soap/u/4.0/510900D8000000
0LuLV
510900D80000000LuLV!AQgAQCXCyhKfNIIT_KI_3qVbqqjN5D0za5Iqa4jlu2lNo
cF.PI82_WgRwJ4Yhm75zGtNgFlmeYoaL1NTp5zEWeHZXxi0HDDy
00580000001mJYMAA2




SOAP::Transport::HTTP::Client::send_receive: POST https://na6-api.salesforce.com
/services/Soap/u/4.0/510900D80000000LuLV
Accept: text/xml
Accept: multipart/*
Content-Length: 769
Content-Type: text/xml; charset=utf-8
SOAPAction: ""

510900D80000000LuLV!AQgAQCXCyhKfNIIT_KI_3qVbqqjN5D0za5Iqa4jlu2lNocF.PI82_W
gRwJ4Yhm75zGtNgFlmeYoaL1NTp5zEWeHZXxi0HDDyons>mesp2:query xmlns:namesp2="urn:partner.soap.sforce.com">amesp2:query>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error
Date: Tue, 09 Dec 2008 23:11:49 GMT
Server:
Content-Type: text/xml; charset=utf-8
Client-Date: Tue, 09 Dec 2008 23:11:49 GMT
Client-Peer: 204.14.234.109: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. LIABILI
TY LTD.(c)97 VeriSign
Client-SSL-Cert-Subject: /C=US/ST=California/L=San Francisco/O=Salesforce.com, I
nc./OU=Applications/CN=na6-api.salesforce.com
Client-SSL-Cipher: RC4-MD5
Client-SSL-Warning: Peer certificate not verified
Client-Transfer-Encoding: chunked


s:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSc
hema-instance">


soapenv:Server
INVALID_BATCH_SIZE: Unknown batch size null


INVALID_BATCH_SIZE
Unknown batch size null






C:\Perl Files\SFDC>


And the complete code:

use Salesforce;
use SOAP::Lite +trace => 'debug';
use Data::Dumper;

my $user="jxxxxxx8\@gmail.com";
my $pass="Suxxx123RfA44QuFxxxxxEQDV2js";

my $service = new Salesforce::SforceService;
my $port = $service->get_port_binding('Soap');
$port->login('username' => $user,'password' => $pass)
|| die "Could not login to salesforce.com";

#as you can see from the trace, login works fine, I can't seem to make any queries work however, see next line. I have the batch size here set to 2000, or so I think...

my $result = $port->query("select * from opportunity",2000);

-Steve
JacksonPJacksonP
I'm a little slow but I see why you asked for the full transaction trace. This site is eating the HTML code so you are only seeing part of the message. I have "ignore HTML" enabled, WYSIWYG on/off, no matter it seems to keep munging the post.

That said, I'd be happy to mail it to you OOB.

-Jack
SuperfellSuperfell
Use the SRC button.
SuperfellSuperfell
So the request has this in it, which'll cause the problem. Not sure why the 2000 isn't getting passed through.

<QueryOpti
ons><batchSize xsi:null="1"/></QueryOptions>
JacksonPJacksonP
Yes -- I'm at a loss why. It seems to work on some other folks examples here formatted the same. IS it possible I have hit a bug?
JacksonPJacksonP
Some good news, doing a search in this format works great. There is something up with query...




use Salesforce;
use SOAP::Lite +trace => 'debug';
use Data::Dumper;

my $user="xxxx\@gmail.com";
my $pass="Sxxxxx7I97QlJr0KEQDV2js";

my $service = new Salesforce::SforceService;
my $port = $service->get_port_binding('Soap');
$port->login('username' => $user,'password' => $pass)
|| die "Could not login to salesforce.com";

my $result = $port->search('searchString' => 'find {3500} in phone fields returning contact(id, phone,

firstname, lastname), lead(id, phone, firstname, lastname), account(id, phone, name)');


foreach my $elem ($result->valueof('//searchResponse/result/searchRecords/record'))
{

print "$elem->{Id}, = $elem->{Phone}\n";
}