
The CallOptions header replaces the setClientId method in the old toolkit. The first argument to CallOptions is a Client and the second is a namespace prefix for managed packages. Both are optional.
<? php
define("SOAP_CLIENT_BASEDIR", "../../soapclient");
require_once (SOAP_CLIENT_BASEDIR.'/SforcePartnerClient.php');
try {
$mySforceConnection = new SforcePartnerClient();
$mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/partner.wsdl.xml');
$callOptionsHeader = new CallOptions('YourClientId', 'aNamespace');
$mySforceConnection->setCallOptions($callOptionsHeader);
$loginResult = $mySforceConnection->login($username, $password);
//print_r($mySforceConnection->getLastRequest());
//print_r($loginResult);
} catch (Exception $e) {
echo $e->faultstring;
}
?>