CCM9 RIS WSDL in PHP

I recently spent a lot of time trying to pull out the IP address of a handset registered to a CUCM9 cluster via AXL. It turns out the standard AXL response doesn’t include this information as it’s handled by the RIS service.

I had some luck with getting the RisPort wsdl working inside PHP but couldn’t return specific queries, everything I tried returned the first 1000 devices listed on the cluster.

I came across some varying info from Cisco regarding RIS.

From: https://developer.cisco.com/site/sxml/documents/api-reference/risport/#overview

The RisPort WSDL is deprecated. Use the RisPort70 WSDL.

I tried to use the RisPort70 from my CCM’s RIS page but PHP complained that it wasn’t able to interpret the WSDL. Then I came across this stating that the WSDL RPC’s were being deprecated and being replaced with doc/literal http://solutionpartnerdashboard.cisco.com/web/sxml-developer/get-wsdl

Beginning in 9.0, the Serviceability XML WSDLs are available in both remote procedure call (RPC) encoded and doc/literal style formats.

Developers should migrate to the doc/literal style WSDL as soon as possible. Cisco plans to deprecate the rpc-encoded WSDL in Unified CM 11.0(1).

It stated that the RisPort70 RPC could be found at: https://servername:8443/realtimeservice/services/RisPort70?wsdl whilst the RisPort70 doc/literal could be found at https://ServerName:8443/realtimeservice2/services/RISService70?wsdl. I could hit the RISService70 even though the RIS page on my CCM didn’t list it. There was no small menu like in normal RIS – the page just returned the WSDL. Good enough for me.

After hacking around with the RISService70 and trying different approaches in CCM I finally got my PHP working. My PHP script now searches all clusters for a device registered with an IP address that I specify and returns the structure in an array that I can parse manually with PHP and then operate on.

$soapClientRIS70 = new SoapClient(“https://YOURCCMHERE:8443/realtimeservice2/services/RISService70?wsdl”,
array(‘trace’=>true,
‘exceptions’=>true,
‘location’=>”https://YOURCCMHERE:8443/realtimeservice2/services/RISService70?wsdl”,
‘login’=>’youruserhere’,
‘password’=>’yourpwdhere’,
));

$soap_response = $soapClientRIS70->SelectCmDevice(array(“StateInfo”=>””, “CmSelectionCriteria”=>array(“NodeName”=>””, “Status”=>”Registered”, “SelectBy”=>”IPV4Address”, “SelectItems”=>array(“item”=>array(“Item”=>”DEVICEIPADDRESSHERE”)))));

print_r($soap_response);

From there the Cisco RIS API documentation should provide you with everything else you need: https://developer.cisco.com/site/sxml/documents/api-reference/risport/#overview

I hope that this will be portable into CCM11 but I’m guessing that the WSDL will be updated – hopefully no structure will change, but some better error responses would be nice.

I hope that this serves to save someone the time that I spent trying to work this out…

Leave a Reply

Your email address will not be published. Required fields are marked *