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.
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" )));
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.
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.