Hello all! iam glad to have found this site, very clear tutorials and answers... thnx Mike!
I have a little issue that i havent been able to fix:
I have this script that was fully working in a previous server but stopped when we moved the application to a lunar pages server
.
The thing is that this server required a custom SOAP configration through the .htaccessfile and the php.ini file... according to the steps I have installed the SOAP module as its supposed to...
But when i run the script $loginResult allways comes false here is what i have:
PHP Code:
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
ini_set("soap.wsdl_cache_enabled", "0");
require_once ('includes/soapclient/SforcePartnerClient.php');
require_once ('includes/soapclient/SforceHeaderOptions.php');
if ( isset($_POST['process']) && $_POST['process'] == 1)
{
login();
}
function login()
{
$wsdl = 'includes/soapclient/partner.wsdl.xml';
$username = $_POST["txtUser"];
$password = $_POST["txtPwd"];
try {
//connect to salesforce
session_start();
$client = new SforcePartnerClient();
$client->createConnection($wsdl);
$loginResult = $client->login($username, $password);
if (!$loginResult) {
exit("<strong>Login failed for user <code>$username</code>. The script is being terminated. <strong>");
}else{
$_SESSION['location'] = $client->getLocation();
$_SESSION['sessionId'] = $client->getSessionId();
$_SESSION['wsdl'] = $wsdl;
$_SESSION['usr'] = $username;
$_SESSION['pwd'] = $password;
header ("Location: welcome.php");
}
} catch (Exception $e) {
echo '<br><br> Caught exception: ', $e->getMessage(), "\n";
echo '<div align="center"><font color="#FF0000">Invalid Username or Password, please try again </font></div>';
}
}
and these are the messages i get:
Notice: Use of undefined constant SOAP_COMPRESSION_ACCEPT - assumed 'SOAP_COMPRESSION_ACCEPT' in /home/user/public_html/sfdc/includes/soapclient/SforceBaseClient.php83
Notice: Use of undefined constant SOAP_COMPRESSION_GZIP - assumed 'SOAP_COMPRESSION_GZIP' in /home/user/public_html/sfdc/includes/soapclient/SforceBaseClient.php84
Notice: Trying to get property of non-object in /home/user/public_html/sfdc/includes/soapclient/SforceBaseClient.php114
Notice: Trying to get property of non-object in /home/user/public_html/sfdc/includes/soapclient/SforceBaseClient.php124
Notice: Trying to get property of non-object in /home/user/public_html/sfdc/includes/soapclient/SforceBaseClient.php126
Login failed for user user@address.com. The script is being terminated.
This script used to work perfectly but im going nuts trying to find what is happening...
Thnx in advance for your help and guidance
Lacho
Bookmarks