11-08-2019 04:50 PM
hello community,
I farly new to APIs and Soap. I am trying to get my first script going but i cannot find what wrong am I doing.
my web browser keeps throwing this error
Fatal error: Uncaught Error: Class 'SoapClient' not found in C:\xampp\htdocs\FAC.php:24 Stack trace: #0 {main} thrown in C:\xampp\htdocs\FAC.php on line 24 .
here's my script:-
<?php
echo "<h1>Fac Info Test</h1>";
$host="callmanager pub ip address";
$username="admin username";
$password="admin password";
//disable cert check
//$context = stream_context_create(array('ssl'=>array('verify_peer_name'=>false,'allow_self_signed'=>true)));
// cert check with cert full pathinfo
//$context = stream_context_create(array('ssl'=>array('verify_peer_name'=>true,'allow_self_signed'=>true,'cafile'=>"/var/www/html/PHP-Sample/DS-UCM105.cisco.com.pem")));
$client = new SoapClient("C:\xampp\htdocs\AXLAPI.wsdl",
array('trace'=>true,
'exceptions'=>true,
'location'=>"https://".$host.":8443/axl",
'login'=>$username,
'password'=>$password,
));
function getFacInfo($client, $name) {
$returnedTags = array("name"=>"","code"=>"","authorizationLevel"=>"");
try {
$response = $client->getFacInfo(array("name"=>$name),array("returnedTags"=>$returnedTags));
}
catch (SoapFault $sf) {
echo "SoapFault: " . $sf . "<BR>";
}
catch (Exception $e) {
echo "Exception: " . $e . "<BR>";
}
echo("Uuid: ".$response->return->facInfo->uuid."<br>");
echo("Name: ".$response->return->facInfo->name."<br>");
echo("Code: ".$response->return->facInfo->code."<br>");
echo("Auth Level: ".$response->return->facInfo->authorizationLevel."<br>");
echo("<hr>");
}
?>
Solved! Go to Solution.
11-11-2019 01:36 AM
As far as i see you have an error in SOAP Client.
This might be because this is not active in your php.ini
Do the following:
11-11-2019 05:13 AM
The Error "Couldn't load from 'C: mpp\htdocs\AXLAPI.wsdl' "
seems to be because you reffer to C: mpp not C:\xmpp or it is a copy mistake.
I would suggest you put your wsdl and php file in one folder.
The you can reffer to /AXLAPI.wsdl or create a subdirectory maybe AXL the reffer to /AXL/AXLAPI.wsdl
11-11-2019 01:36 AM
As far as i see you have an error in SOAP Client.
This might be because this is not active in your php.ini
Do the following:
11-11-2019 03:22 AM
11-11-2019 05:13 AM
The Error "Couldn't load from 'C: mpp\htdocs\AXLAPI.wsdl' "
seems to be because you reffer to C: mpp not C:\xmpp or it is a copy mistake.
I would suggest you put your wsdl and php file in one folder.
The you can reffer to /AXLAPI.wsdl or create a subdirectory maybe AXL the reffer to /AXL/AXLAPI.wsdl
11-11-2019 01:48 AM
Hi,
Most likely you have caught this error because, you might have not enabled Soap Client in php.ini file.
SoapClient is an extension of PHP that must be enabled in your php.ini file in order to be extended,
Do the following to enable soap:
php.ini
in your apache bin folder, I.e Apache/bin/php.ini
;
from the beginning of extension=php_soap.dll
HTH!
Regards,
Anusha B R
.
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