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
zabahzabah 

Multi-Dim Array Errors from SOAP

Hello:

We recently moved our web server from a simple solution to rackspace.  We now have the latest PEAR, SOAP, and PHP packages.  However, SOAP calls to Salesforce are returning poorly formatted arrays.  A call that would return a list of four contacts in one array on our old server is returning the four contacts nested in a multi-dim array on the new server.  Has anyone seen this before?  Any help would be much appreciated as I've searched all over this board and the web to find some hints, but found none.  I've attached sample query results below.  Thanks.

Old Server Results for all contacts in Goleta, CA:
Array
(
[0] => stdClass Object
(
[type] => Contact
[Id] => 00330000002jE3WAAU
[Name] => Susan Rudnicki
[MailingCity] => Goleta
)

[1] => stdClass Object
(
[type] => Contact
[Id] => 00330000002jGWQAA2
[Name] => Eric Heidner
[MailingCity] => Goleta
)

[2] => stdClass Object
(
[type] => Contact
[Id] => 00330000002jFfyAAE
[Name] => Mark Krilanovich
[MailingCity] => Goleta
)

[3] => stdClass Object
(
[type] => Contact
[Id] => 00330000002jFJTAA2
[Name] => Adam Gilberti
[MailingCity] => Goleta
)

)


New Server Results for all contacts in Goleta, CA:
Array
(
[0] => Array
(
[0] => Array
(
[0] => stdClass Object
(
[type] => Contact
[Id] => 00330000002jE3WAAU
[Name] => Susan Rudnicki
[MailingCity] => Goleta
)

[1] => stdClass Object
(
[type] => Contact
[Id] => 00330000002jGWQAA2
[Name] => Eric Heidner
[MailingCity] => Goleta
)

)

[1] => stdClass Object
(
[type] => Contact
[Id] => 00330000002jFfyAAE
[Name] => Mark Krilanovich
[MailingCity] => Goleta
)

)

[1] => stdClass Object
(
[type] => Contact
[Id] => 00330000002jFJTAA2
[Name] => Adam Gilberti
[MailingCity] => Goleta
)

)

Tran ManTran Man
Can you list the version # of each?


HotchHotch
Hi,

I'm also involved in this problem as the CEO of the company that zabah is doing the work for.
Perl version 5.8.5
SOAP version 5.2.5
PHP version 5.2.5

I hope this is what you need to help us figure this problem out.

Richard Hotchkiss
Gvox
Tran ManTran Man
Could you post some code snippets including the query?.


zabahzabah
Here's the code that I'm using. Thanks for any advice you can give.

$oSC = new SalesforceClient();

$result = $oSC->login(USERNAME, PASSWORD);

$strSession = $result->sessionId;
$strSFUrl = $result->serverUrl;

$oClient = new SalesforceClient($strSession);
$oClient->_endpoint = $strSFUrl;

$query_str = "
SELECT id, name, MailingCity
FROM Contact
WHERE MailingCity = 'Goleta'
";

$LIMIT = 25;
$result = $oClient->query($query_str, $LIMIT);
$records = $result->records;

print_r($records);

Message Edited by zabah on 02-06-2008 04:52 AM
Tran ManTran Man
Are you using the Salesforce PHP toolkit?  Because that is the one that is recommended since we (salesforce.com) maintain it.