07-22-2019 08:27 PM
Hey all,
I am trying to develop an IIS hosted webpage that will allow me to update phones without having to login to the UI. I am new with SOAP and APIs in general and have followed Cisco's PHP guide on AXL connections. We are running CUCM 11.5. Postman query is successful, however am unsure how to get my connection to work via php file in IIS. Test php file works no problem so IIS should not be the culprit. Below is my code that is currently returning a 500 error:
<?php $host = "<FQDN of server>"; $username = "******"; $password = "**********"; $context = stream_context_create(array('ssl'=>array('allow_self_signed'=>true))); $client = new SoapClient("C:\inetpub\wwwroot\PhoneSetup\AXLAPI.wsdl", array('trace'=>true, 'exceptions'=>true, 'location'=>"https://".$host.":8443/axl", 'login'=>$username, 'password'=>$password, 'stream_context'=>$context )); $response = $client->getPhone(array("name"=>" SEP5065F3B9AB95")); ?>
Any assistance as to where to start troubleshooting this?
Thanks in advance.
07-23-2019 02:01 AM
07-23-2019 05:14 AM
Thanks for catching this Robert, however I am still receiving the same error after making that change.
07-24-2019 01:08 PM
You may also need to either disable cert name checking, or download the CUCM Tomcat cert and reference it:
$context = stream_context_create(array('ssl'=>array('verify_peer_name'=>false, 'allow_self_signed'=>true )));
$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" )));
07-24-2019 08:32 PM
dstaudt,
I have the tomcat cert (in pem format) listed in the directory listed in the PHP script. Even when I had it disabled I was receiving errors.
07-26-2019 05:25 AM
Update - I found that I didn't have the soap extension DLL enabled in my PHP.ini file. I enabled that then,still had issues then nulled out the certificate check and now my page loads, however to a white screen. No error logs are shown in either IIS or PHP. Getting closer.
10-22-2019 12:30 AM
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: