Forum Moderators: coopster
//http_response_code(200);
header('HTTP/1.1 200 OK');
header("Status: 200");
//Open SOAP WSDL Connection
$client = @new SoapClient('https://site.com/ClockService.svc?wsdl', array('cache_wsdl' => 0));
var_dump($client->__getFunctions());
// Request a authentication ticket GUID
$tixparam = array('userName'=>'user', 'password'=>'Password');
$getauth = $client->Authenticate($tixparam);
$authkey = $getauth->AuthenticateResult;
//Give the WSDL the received ticket and prepare a request.
$param = array('ticket'=>$authkey);
// Do a Human Readable dump of the Object Array,
echo "<pre>".print_r($param, true)."</pre><br>";
//Deal with Faults
catch (SoapFault $doapunch) {
header('HTTP/1.1 200 OK');
header("Status: 200 OK");
// Do a Human Readable dump of the Object Array,
echo "<pre>".print_r($param, true)."</pre><br>";
trigger_error("SOAP Fault: (faultItem: {$doapunch->detail->ValidationFault->Messages->KeyValueOfstringstring->Key}, faultstring: {$doapunch->detail->ValidationFault->Messages->KeyValueOfstringstring->Value})", E_USER_ERROR);
}