How to ... Test AXL with Curl
CUCM/AXL Version tested: 8.5
CURL is a an open source, cross-platform tool able to perform URL-based network requests from the comamnd line: http://curl.haxx.se/
CURL can be used, among other things, to make HTTP requests, including SOAP requests. In this example, the XML for the actual AXL SOAP request is stored in a file on the local system, called 'request.xml' Here are the contents:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/8.5"> <soapenv:Header/> <soapenv:Body> <ns:executeSQLQuery sequence="?"> <sql>Select name from device where tkclass = 1</sql> </ns:executeSQLQuery> </soapenv:Body> </soapenv:Envelope>
This XML could be replaced with any valid AXL request XML.
The CURL command is executed in the same directory as the request.xml file.
$ curl -k -u Administrator -H "Content-type: text/xml;" -H "SOAPAction: CUCM:DB ver=8.5" -d @request.xml https://[CCM-IP-ADDRESS]:8443/axl/
The parameters given are as follows:
- -k : Disable SSL key authentication of the AXL server
- -u : In this example 'Administrator'. The HTTP user name. This should be a CUCM user with AXL access role
- -H : Header. Two header entries are given, one to override CURL's default Content-type, and the other to specify the AXL version
- -d : Specifies the data file where the data to be sent is stored
- The final parameter is the AXL URL, be sure to ensure the IP address is valid and includes the port designation :8443