$value){ $$name = $value; } echo <<
Enter SugarCRM User Information - this is the same info entered when logging into sugarcrm
USER NAME:USER PASSWORD:
EOQ; if(!empty($user_name)){ $offset = 0; if(isset($_REQUEST['offset'])){ $offset = $_REQUEST['offset'] + 20; echo $offset; } require_once('include/nusoap/nusoap.php'); //must also have the nusoap code on the ClientSide. $soapclient = new nusoapclient($GLOBALS['sugar_config']['site_url'].'/soap.php'); //define the SOAP Client an echo 'LOGIN:
'; $result = $soapclient->call('login',array('user_auth'=>array('user_name'=>$user_name,'password'=>md5($user_password), 'version'=>'.01'), 'application_name'=>'SoapTest')); echo 'HERE IS ERRORS:
'; echo $soapclient->error_str; echo '

HERE IS RESPONSE:
'; echo $soapclient->response; echo '

HERE IS RESULT:
'; echo print_r($result); $session = $result['id']; echo '

GET Case fields:
'; $result = $soapclient->call('get_module_fields',array('session'=>$session , 'module_name'=>'Cases')); echo 'HERE IS ERRORS:
'; echo $soapclient->error_str; echo '

HERE IS RESPONSE:
'; echo $soapclient->response; echo '

HERE IS RESULT:
'; echo print_r($result); echo '

Update a portal user fields:
'; $result = $soapclient->call('update_portal_user',array('session'=>$session,'portal_name'=>'dan','name_value_list'=>array(array('name'=>'email1', 'value'=>'Dan_Aarons@example.com')))); echo 'HERE IS ERRORS:
'; echo $soapclient->error_str; echo '

HERE IS RESPONSE:
'; echo $soapclient->response; echo '

HERE IS RESULT:
'; echo print_r($result); echo '

Get list of contacts:
'; $result = $soapclient->call('get_entry_list',array('session'=>$session,'module_name'=>'Contacts','query'=>'','order_by'=>'contacts.last_name asc','offset'=>$offset, 'select_fields'=>array(), 'max_results'=>'5')); echo 'HERE IS ERRORS:
'; echo $soapclient->error_str; echo '

HERE IS RESPONSE:
'; echo $soapclient->response; echo '

HERE IS RESULT:
'; echo print_r($result); echo '

LOGOUT:
'; $result = $soapclient->call('logout',array('session'=>$session)); echo 'HERE IS ERRORS:
'; echo $soapclient->error_str; echo '

HERE IS RESPONSE:
'; echo $soapclient->response; echo '

HERE IS RESULT:
'; echo print_r($result); } ?>