jonlewi5
09-06-2010, 20:14
Cheers very much for your help and patiance, at least i can see how it all works now. Thanks.
login successfull array(0) { }
if ( !$session )
throw new Exception('Could not create a session');
if ( !$result )
throw new Exception ('Could not get a list of domains');
Oh crap: Object id #2
OpenSSL support enabled OpenSSL Version OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
soap Soap Client enabled Soap Server enabled Directive Local Value Master Value soap.wsdl_cache 1 1 soap.wsdl_cache_dir /tmp /tmp soap.wsdl_cache_enabled 1 1 soap.wsdl_cache_limit 5 5 soap.wsdl_cache_ttl 86400 86400
(); ?>
try {
/* Do we have the required stuff
* For example in Windows' php.ini: extension=php_soap.dll and extension=php_openssl.dll
*/
if ( !class_exists('SoapClient') )
throw new Exception('No SOAP client available.');
$soap = new SoapClient('https://www.ovh.com/soapi/soapi-re-1.10.wsdl');
// Use SOAPI function "login" to create a session in "en"glish:
$session = $soap->login('yourid1234-ovh', 'NotSoSecretPa$$word', 'en');
// Did we get a session ID?
if ( !$session )
throw new Exception('Could not create a session');
// We got a session ID if we reach this point
echo "login successfull\n";
// Use SOAPI function "domainList" to get a list of our domains with OVH:
$result = $soap->domainList($session);
// And was this function call successful?
if ( !$result )
throw new Exception ('Could not get a list of domains');
// Yes it was, dump what we've received:
echo ""
;
var_dump($result);
echo "";
// Close the session using the "logout" SOAPI function:
$soap->logout($session);
} catch(Exception $error) {
// We reach this in case there's been an error
echo "Oh crap: " . $error;
}
?>