$value){ $$name = $value; } echo <<
Enter SugarCRM Portal User Information (to configure this login to SugarCRM as an admin and go the administration panel then select a user from user management)
PORTAL NAME:PORTAL PASSWORD:
Use the name 'lead' and password 'lead' for portal lead generation
CONTACT NAME:
EOQ; if(!empty($portal_name)){ $portal_password = md5($portal_password); require_once('include/nusoap/nusoap.php'); //must also have the nusoap code on the Client Side. $soapclient = new nusoapclient($GLOBALS['sugar_config']['site_url'].'/soap.php'); //define the SOAP Client an echo 'LOGIN:
'; $result = $soapclient->call('portal_login',array('portal_auth'=>array('user_name'=>$portal_name,'password'=>$portal_password, 'version'=>'.01'),'user_name'=>$user_name, 'application_name'=>'SoapTestPortal')); 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 '

CREATE LEAD:
'; $result = $soapclient->call('portal_set_entry',array('session'=>$session , 'module_name'=>'Leads', 'name_value_list'=>array(array('name'=>'first_name', 'value'=>'Test'), array('name'=>'last_name', 'value'=>'Lead'), array('name'=>'portal_name', 'value'=>'portal_name'), array('name'=>'portal_app', 'value'=>'SoapTestPortal'), array('name'=>'description', 'value'=>'A lead created through webservices')))); 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('portal_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); } ?>