Hi,
I am delving into try to write a small PHP program and falling over at the first hurdle on pre-auth. My code so far
Code:
<?php
$client = new SoapClient(null,
array(
'location' => "https://zimbra.fqdn/service/soap/",
'uri' => "urn:zimbra",
'trace' => 1,
'exceptions' => 1,
'soap_version' => SOAP_1_1,
'style' => SOAP_RPC,
'use' => SOAP_LITERAL
)
);
$key = "<my domain auth key>";
$timestamp = time() * 1000;
$preauthToken = hash_hmac("sha1", "uxbod@domain.com" . "|name|0|" . $timestamp, $key);
$params = array(
new SoapParam("uxbod@domain.com", "name"),
new SoapParam("$preauthToken", "preauth"),
new SoapParam("0", "expires"),
);
try
{
$zimbraSession = $client->__soapCall(
"AuthRequest",
$params,
new SoapHeader("urn:zimbra", "context")
);
} catch (SoapFault $exception) { echo "Failed : $exception\n\n"; }
echo htmlentities($client->__getLastResponse()) . "\n\n";
?> I end up getting the error message
Code:
PHP Fatal error: SoapClient::__soapCall(): first parameter must be string or null in code.php line 30
Any help would be gratefully appreciated. All I am wanting to do in the end is query for a contact and pull out the name.