fusionado
Jun 19 2009, 09:43 PM
Hello im getting this error when test the api:
Note: im already open a ticket with the planet and they enable api access to my account.
Fatal error: Uncaught SoapFault exception: [a:FailedAuthentication] Access is denied. in C:\wamp\www\ThePlanet\getTicket.php:22 Stack trace: #0 [internal function]: SoapClient->__call('GetTicketByID', Array) #1 C:\wamp\www\ThePlanet\getTicket.php(22): SoapClient->GetTicketByID(Object(SoapParam)) #2 {main} thrown in C:\wamp\www\ThePlanet\getTicket.php on line 22
My php code:
<?php
ini_set('soap.wsdl_cache_enabled', false);
$wsdl_url = 'https://api.theplanet.com/Svc/TicketTicketService.svc?WSDL';
$params = array(
'login' => 'ES-XXXXXX',
'password' => '*********'
);
$tkt_tkt_svc = new SoapClient($wsdl_url, $params);
//$hola = $tkt_tkt_svc->HelloPlanet();
$tickets = $tkt_tkt_svc->GetTicketByID(new SoapParam('5800667', 'TicketID'));
print_r($tickets);
?>
Any idea of the problem? thanks
fusionado
Jun 21 2009, 01:55 AM
i edit the code and only give me error when triying to execute a function i got "Access denied"
this is the final code:
<?php
ini_set('soap.wsdl_cache_enabled', false);
$wsdl_url = 'https://api.theplanet.com/Svc/TicketTicketService.svc?WSDL';
$params = array(
'login' => 'ES-XXXXXX',
'password' => '*************'
);
$client = new SoapClient($wsdl_url, $params);
echo '<pre>';
var_dump($client);
var_dump($client->__getFunctions());
$tickets = $client->GetTicketByID(new SoapParam('5800667', 'TicketID'));
?>
object(SoapClient)#1 (4) {
["_login"]=>
string(9) "ES-XXXXXXXXX"
["_password"]=>
string(7) "******"
["_soap_version"]=>
int(1)
["sdl"]=>
resource(7) of type (Unknown)
}
array(5) {
[0]=>
string(46) "Ticket AddTicket(AddTicketRequest $parameters)"
[1]=>
string(46) "void EditTicket(EditTicketRequest $parameters)"
[2]=>
string(36) "Ticket GetTicketByID(long $TicketID)"
[3]=>
string(69) "GetTicketListResponse GetTicketList(GetTicketListRequest $parameters)"
[4]=>
string(48) "TicketDetail GetTicketDetailByID(long $TicketID)"
}
Fatal error: Uncaught SoapFault exception: [a:FailedAuthentication] Access is denied. in C:\wamp\www\ThePlanet\getTicket.php:24
Stack trace:
#0 [internal function]: SoapClient->__call('GetTicketByID', Array)
#1 C:\wamp\www\ThePlanet\getTicket.php(24): SoapClient->GetTicketByID(Object(SoapParam))
#2 {main}
thrown in C:\wamp\www\ThePlanet\getTicket.php on line 24
I can read the function list, but when i try to execute a function just im getting access deniend.
Can some one help me please?
Also this forum is the official support from the planet, or they dont have official support for the api