Bonjour a tous,
je suis débutant en SOAP et je ne sais pas comment résoudre mon problème donc si un expert veut bien m'accorder quelques minutes se serai très sympa.
Mon problème est que j'ai récupéré le script d'Ovh pour vérifier les noms domaine a cette adresse : http://www.ovh.com/soapi/fr/?method=domainCheck
j'ai récupéré le fichier class.soapclient.php du Nusoap-0.7.3.zip,que j'ai inclut, qui semble faire du SOAPI WSDL, donc cela me semble correct mais cela ne marche pas ?
erreur : Fatal error: Class 'SoapServer' not found in ...
Voici un partie du fichier class.soapclient.php:
class nusoap_client extends nusoap_base {
var $username = ''; // Username for HTTP authentication
var $password = ''; // Password for HTTP authentication
var $authtype = ''; // Type of HTTP authentication
var $certRequest = array(); // Certificate for HTTP SSL authentication
var $requestHeaders = false; // SOAP headers in request (text)
var $responseHeaders = ''; // SOAP headers from response (incomplete namespace resolution) (text)
var $responseHeader = NULL; // SOAP Header from response (parsed)
var $document = ''; // SOAP body response portion (incomplete namespace resolution) (text)
var $endpoint;
var $forceEndpoint = ''; // overrides WSDL endpoint
var $proxyhost = '';
var $proxyport = '';
var $proxyusername = '';
var $proxypassword = '';
var $xml_encoding = ''; // character set encoding of incoming (response) messages
var $http_encoding = false;
var $timeout = 0; // HTTP connection timeout
var $response_timeout = 45; // HTTP response timeout
var $endpointType = ''; // soap|wsdl, empty for WSDL initialization error
var $persistentConnection = false;
var $defaultRpcParams = false; // This is no longer used
var $request = ''; // HTTP request
var $response = ''; // HTTP response
var $responseData = ''; // SOAP payload of response
var $cookies = array(); // Cookies from response or for request
var $decode_utf8 = true; // toggles whether the parser decodes element content w/ utf8_decode()
var $operations = array(); // WSDL operations, empty for WSDL initialization error
var $curl_options = array(); // User-specified cURL options
var $bindingType = ''; // WSDL operation binding type
var $use_curl = false; // whether to always try to use cURL
/*
* fault related variables
*/
/**
* @var fault
* @access public
*/
var $fault;
/**
* @var faultcode
* @access public
*/
var $faultcode;
/**
* @var faultstring
* @access public
*/
var $faultstring;
/**
* @var faultdetail
* @access public
*/
var $faultdetail;
/**
* constructor
*
* @param mixed $endpoint SOAP server or WSDL URL (string), or wsdl instance (object)
* @param bool $wsdl optional, set to true if using WSDL
* @param int $portName optional portName in WSDL document
* @param string $proxyhost
* @param string $proxyport
* @param string $proxyusername
* @param string $proxypassword
* @param integer $timeout set the connection timeout
* @param integer $response_timeout set the response timeout
* @access public
*/
function nusoap_client($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30){
parent::nusoap_base();
$this->endpoint = $endpoint;
$this->proxyhost = $proxyhost;
$this->proxyport = $proxyport;
$this->proxyusername = $proxyusername;
$this->proxypassword = $proxypassword;
$this->timeout = $timeout;
$this->response_timeout = $response_timeout;
$this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout");
$this->appendDebug('endpoint=' . $this->varDump($endpoint));
// make values
if($wsdl){
if (is_object($endpoint) && (get_class($endpoint) == 'wsdl')) {
$this->wsdl = $endpoint;
$this->endpoint = $this->wsdl->wsdl;
$this->wsdlFile = $this->endpoint;
$this->debug('existing wsdl instance created from ' . $this->endpoint);
$this->checkWSDL();
} else {
$this->wsdlFile = $this->endpoint;
$this->wsdl = null;
$this->debug('will use lazy evaluation of wsdl from ' . $this->endpoint);
}
$this->endpointType = 'wsdl';
} else {
$this->debug("instantiate SOAP with endpoint at $endpoint");
$this->endpointType = 'soap';
}
}
Voici le script Ovh :
include_once("lib/class.soapclient.php");
SoapServer::getFunctions();
$soap = nusoap_client('https://www.ovh.com/soapi/soapi-1.2.wsdl');
// login
try {
$login = "PB12252-OVH";
$password = "ropel";
$language = null;
$multisession = false;
$session = $soap->login($login,$password,$language,$multisession);
echo $saop->login;
echo "login successfull<br/>";
echo $session;
}
catch(SoapFault $fault)
{
echo "Error : ".$fault;
}
echo "+++++++++++".$soap;
//domainCheck
try {
$result = $soap->domainCheck($session, 'google');
echo "domainCheck successfull<br/>";
print_r($result); // place your code here ...
echo "<br/>";
}
catch(SoapFault $fault) {
echo "Error : ".$fault;
}
//logout
try {
$result = $soap->logout($session);
echo "logout successfull<br/>";
}
catch(SoapFault $fault)
{
echo "Error : ".$fault;
}
?>
Merci par avance car je ne sais que faire.![]()
Partager