Hi,
My set up is the following
Sugar on Demand 5.2 Professional
Website where I make the call to sugar from LAMP with php 5.2.5
I can successfully create a record with set_entry as long as I set only one field. If I attempt to set 2 fields like in the below example it fails with the error below… Any ideas of what’s wrong?
Thanks!
<?php
require_once('inc/sugarConfig.php');
$client = new SoapClient($sugar_config['url'] . 'soap.php?wsdl');
$result = $client->login(array('user_name'=>$sugar_config['user'],'password'=> md5($sugar_config['pass']), 'version'=>'1.0'),'soapleadcapture');
/**
* CHECK FOR ERRORS
*/
if(is_object($result))$result =objectToArray($result);
printf("\n\nLogin in process\n\n");
if($result['error']['number'] != 0)die($result['error']['description']);
/**
* GET THE SESSION ID WE WILL BE USING FOR THE REST OF THE TRANSACTIONS
*/
$session_id = $result['id'];
$user_id = $client->get_user_id($session_id);
printf("\n Session Id is :".$session_id." user Id is: ".$user_id."\n\n");
// create a new lead record and grab its ID
// this one works fine
//$response = $client->set_entry($session_id, 'Leads', array(array("name" => 'last_name',"value" => 'mimi')));
// this one fails…
$response = $client->set_entry($session_id, 'Leads', array(array("name" => 'last_name',"value" => 'mimi'),array("name" => 'first_name',"value" => 'lilie')));
var_dump($response);
/**
* DISCONNECT FROM SUGAR
*/
$client->logout($session_id);
?>
Fatal error: Uncaught SoapFault exception: [HTTP] Internal Server Error in /home/th/public_html/temp/soap.php:43 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://th...', 'http://www.th...', 1, 0) #1 [internal function]: SoapClient->__call('set_entry', Array) #2 /home/th/public_html/temp/soap.php(43): SoapClient->set_entry('sj658hmic1au1sb...', 'Leads', Array) #3 {main} thrown


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks