I am a little confused. In the context of the php-client file structure,
your suggested changes seem to apply in file
WebService_SforceService_Soap.php, whose login function was as follows:
function &login($username, $password) {
$login =& new
SOAP_Value('{urn:partner.soap.sforce.com}login',false,$v=array("username"=>$username,
"password"=>$password));
return $this->call("login",
$v = array('login'=>$login),
array('namespace'=>'urn:partner.soap.sforce.com',
'soapaction'=>'',
'style'=>'document',
'use'=>'literal' ));
}
You are suggesting a header:
$header =& new SOAP_Header(
'{urn:partner.soap.sforce.com}login',
'Struct',
array('username'=>'foo','password'=>'bar'),
1);
$client->addHeader($header);
and then:
$request = array(....); (??)
$response =& $client->call('login', $request, $namespace);
What goes into the $request and $namespace variables? Previously, the
$request variable was a SOAP_Value ($login). Should the $login
SOAP_Value still be used? And then:
$request = array('login'=>$login);
Or is there something I am missing?
You seem to be saying that the login info (username & password) should
be in the SOAP header as well as the body (??)
And is $namespace a scalar 'urn:partner.soap.sforce.com' or the array
that was there before:
array('namespace'=>'urn:partner.soap.sforce.com',
'soapaction'=>'',
'style'=>'document',
'use'=>'literal' )
I do appreciate that you responded to my question. I look forward to
making this work soon.
Sincerely
Colin Goldberg
** <http://www.plezecall.com/ease-savings/pc.pl?pc=zp7C>
Michael Rasmussen wrote:
On Tue, 25 Oct 2005 13:08:27 -0400, Colin Goldberg wrote:
Can you help me discover why parameters username and password do not
appear in the request?
In your client you need to do this:
require_once("../SalesforceClient.php");
$client = new SalesforceClient();
$header =& new SOAP_Header(
'{urn:partner.soap.sforce.com}login',
'Struct',
array('username'=>'foo','password'=>'bar'),
1);
$client->addHeader($header);
....
$resquest = array(....);
$response =& $client->call('theFunction', $request, $namespace);
if (PEAR::isError($response))
echo "Fault: " . $response->message. "\n";
else
echo "Response from server:\n $response\n\n";
--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php