function getClient() {
$client = new SoapClient('http://url:8080/SKS1A/SKS1A?wsdl');
// is soapcookies already set? (must be already logged in)
if (isset($_SESSION['soapcookies']))
{
// just set the cookies
foreach ($_SESSION['soapcookies'] as $cookiename => $value)
$client->__setCookie($cookiename, $value[0]);
}
else {
//please change the username and password
$result = $client->login(array('username' => $username, 'password' => $password))->return;
//print_r($result);
//store the soap cookies in $_SESSION so that don't need to reauthenticate.
$_SESSION['soapcookies'] = $client->_cookies;
}
return $client;
}
$query = "SELECT id,domainname from domain WHERE status='check'";
$data = mysql_query($query, $conn) or die();
echo "Cron Check Start<br>";
while($rec = mysql_fetch_array($data))
{
//get the SOAP client connection
$api = getClient();
$domain = $rec[domainname];
$arg0 = $reseller;
$arg1 = $domain; //sample result available
$result = $api->checkDomainAvailability(array('arg0' =>$arg0,'arg1' =>$arg1))->return;
$xml = new SimpleXMLElement($result);
$result = $xml->code;
$description = $xml->reason;
if($result == 1000) { echo "Domain $domain successfully checked<br>"; }
else { echo "Domain: '".$rec[domainname]."' '".$description."' ERROR<br>"; }
}// end while.
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE