cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

HowTo connect WebServices via SOAP/PHP5.6.x

HowTo connect WebServices via SOAP/PHP5.6.x

Michael_Althoff
New Contributor
Hi community,
I tried to connect the WebServices via SOAP/PHP in version 5.6.18.
The short script should request all END-System MAC addresses from the NAC Appliance.
Via https://...... it works fine with the right output.
But my php script didn't work well because the wsdl file isn't accessible.
I use the Extreme pdf document "OFC-Web-Services.pdf" to try some examples.

ini_set("soap.wsdl_cache_enabled", "0"); //disable wsdl cache
$wsdl = "https://xxx.xxx.xxx.xxx:8443/axis/services/NACWebService?wsdl";
$client = new SoapClient($wsdl, array(
'trace' => 1,
'login' => "root",
'password' => "password",
'cache_wsdl' => WSDL_CACHE_NONE,
'soap_version' => SOAP_1_2
));
$response = $client->getAllEndSystemMacs();
print_r($response);
?>

The cli output looks like:
PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://192.168.10.xx:8443/axis/services/NACWebService?wsdl' : failed to load external entity "https://xxx.xxx.xxx.xxx:8443/axis/services/NACWebService?wsdl";
in C:\xampp\htdocs\soap\phptest.php on line 10
PHP Fatal error: Uncaught SoapFault exception: [wsdl] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://xxx.xxx.xxx.xxx:8443/axis/services/NACWebService?wsdl
' : failed to load external entity "https://xxx.xxx.xxx.xxx:8443/axis/services/NACWebService?wsdl";
in C:\xampp\htdocs\soap\phptest.php:10
Stack trace:
#0 C:\xampp\htdocs\soap\phptest.php(10): SoapClient->SoapClient('https://xxx.xxx...', Array)
#1 {main}
thrown in C:\xampp\htdocs\soap\phptest.php on line 10
I'm not so familiar with the php versions but i guess that there was some changes from the php version in the document and the actual version 5.6.18.
I would be grateful for help

regards

Mike
6 REPLIES 6

Michael_Althoff
New Contributor
Hi Matthew,

thx for reply.
I tried the curl connections. Without the insecure-option "-k" I got a certifikate error

curl: (60) SSL certificate problem: unable to get local issuer certificate
WIth the -k option I can read the wsdl-file succesfully.

I had suspected that this is an issue with the access, but I cannot figure out where it come from, and how I can fix it.
The example, described in the thread above isn't working for me.

regards

Matthew_Hum1
Extreme Employee
Just a thought. Are you using a self signed cert on Netsight? Otherwise I think you need to have certificate validation disabled as described in:

http://stackoverflow.com/questions/84...

can you do a manual curl to the target?

curl -u root:password "https://<Netsight%20IP>:8443/axis/services/NACWebService?wsdl"

if it gives a certificate error try:

curl -k -u root:password "https://<Netsight%20IP>:8443/axis/services/NACWebService?wsdl"
GTM-P2G8KFN