Jak połączyć się z interfejsem API eBay poprzez SoapClient?

Próbuję połączyć się z interfejsem handlowym ebay i wykonać podstawowe żądanie używając klasy SoapClient PHP, ale mam problem. Zrobiłem kilka godzin poszukiwań i bawiąc się przykładami, ale nie mogę nic zrobić. Napisałem więc następujący kod barebones i próbuję go uruchomić:

$token  = [token here];

$client = new SOAPClient('http://developer.ebay.com/webservices/latest/eBaySvc.wsdl', array('trace' => 1, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS));

$header = new SoapHeader('urn:ebay:apis:eBLBaseComponents', 'RequesterCredentials', new SoapVar(array('ebayAuthToken' => $token), SOAP_ENC_OBJECT), false);

$client->__setSoapHeaders(array($header));

$method = 'GeteBayOfficialTime';

$parameters = array(

);

try {
    $responseObj = $client->__soapCall($method, array($parameters));
}
catch (Exception $e)
{
    echo 'Exception caught. Here are the xml request & response:<br><br>';
    echo '$client->__getLastRequest():<br><pre><xmp>' . $client->__getLastRequest() . '</xmp></pre>';
    echo '$client->__getLastResponse():<br><pre><xmp>' . $client->__getLastResponse() . '</xmp></pre><br>';

    echo '<p>Exception trying to call ' . $method . '</p>';
    echo '$e->getMessage()';
    echo '<pre>' . $e->getMessage() . '</pre>';
}

Wynik tego jest:

Exception caught. Here are the xml request & response:

$client->__getLastRequest():

<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ebay:apis:eBLBaseComponents" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Header><xsd:RequesterCredentials><ebayAuthToken>[token was here]</ebayAuthToken></xsd:RequesterCredentials></SOAP-ENV:Header><SOAP-ENV:Body><ns1:GeteBayOfficialTimeRequest/></SOAP-ENV:Body></SOAP-ENV:Envelope>

$client->__getLastResponse():

<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Server.userException</faultcode> <faultstring>com.ebay.app.pres.service.hosting.WebServiceDisabledException: The web service eBayAPI is not properly configured or not found and is disabled.</faultstring> <detail/> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope>


Exception trying to call GeteBayOfficialTime
$e->getMessage()

com.ebay.app.pres.service.hosting.WebServiceDisabledException: The web service eBayAPI is not properly configured or not found and is disabled.

Czy ktoś może mi pomóc, aby to działało? Częścią problemu może być to, że nie mam pojęcia, co powinno się znaleźć w pierwszym parametrze funkcji SoapHeader („przestrzeń nazw”).

questionAnswers(2)

yourAnswerToTheQuestion