02-20-2014 12:03 PM
Hello,
by the following example I was able to implement reading 1 record in PHP:
I can't read any lists (in the example below listPhone) where I end with Fatal error: Uncaught SoapFault exception.
Is there somewhere an example please? I not found it, for completeness, I attach a piece of code with error.
Using:
System version: 9.1.2.10000-28
Used AXL WSDL version: http://www.cisco.com/AXL/API/9.1
Example:
<h1>List of phones</h1>
<?php
$client = new SoapClient("AXLAPI.wsdl",
array('trace'=>true,
'exceptions'=>true,
'location'=>"https://HostName:8443/axl",
'login'=>'*************',
'password'=>'**************',
));
// [437] => ListPhoneRes listPhone(ListPhoneReq $axlParams)
//
// echo '<pre>';
// print_r($client->__getFunctions());
// echo '<pre>';
// I try different array and multi-array combinations
$response = $client->listPhone(
array("searchCriteria"=>
array("name"=>"%")
)
);
echo '<pre>';
print_r($response->phone);
echo '</pre>';
// Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object has no 'returnedTags'
// property in /var/www/Test.php:59 Stack trace: #0 /var/www/Test.php(59):
// SoapClient->__call('listPhone', Array) #1 /var/www/Test.php(59): SoapClient->listPhone(Array)
// #2 {main} thrown in /var/www/Test.php on line 59
?>
Thank you and best regards,
Peter
02-25-2014 04:30 PM
Hi Peter,
You need to add the returnedTags as part of request.
The request should look like this
$response = $client->listPhone(
array("searchCriteria"=>
array("name"=>"%"),
"returnedTags" =>
array("name"=>"", "model"=>"", "callingSearchSpaceName"=>"")
)
);
echo '<pre>';
print_r($response->return->phone);
echo '</pre>';
Hope this help
Howard
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide