Testing SXML with Telnet
CUCM/AXL Version tested: 7.0(1)
Platform: Ubuntu 8.10, using telnet-ssl
Using a command-line Telnet connection to CCM, it is possible to test the secure AXL web services by sending raw text data. In this example, the Serviceability RisPort is queried for all devices, using a text editor and telnet-ssl.
The first step is to carefully devise the HTTP message to be sent to AXL. The request is made up of the type/header and body. The type/header should look something like this:
Be sure and modify the headers as necessary to match your request:
- POST - check the uri against the AXL docs to ensure it matches with the AXL service you're querying
- SOAPAction - Both Administrative and Serviceability AXL need the SOAPAction header, make sure it is correct for your service/request
- Content-Length - This will be the length in bytes of the 'payload' of the message, i.e. the XML
- Authorization - Use Basic authorization, the username and password is in the form 'username:password' and is Base64 encoded (there are several free web-based sites/tools that can encode Base64 quickly for you.) Make sure this user is part of a group with AXL API role.
- Host: this is the FQDN/IP address and port of the CCM with the AXL service on it
Each line of the type/header ends in a cr/lf, and the type/header itself should end in a blank line with cr/lf.
Next comes the message body, which is the (valid) SOAP XML for the request you want to test. Note the request will fail with 'HTTP 400 Bad Request' if there are any cr/lf's in the XML text - as will commonly occur if you have the XML formatted as multiple lines in a text editor and then copy/paste it. I solved this by removing all of the extra white space and cr/lf's, making the XML one long line in my editor.
At this point you should have something like the following:
Making the request is pretty easy, simply copy the text to your clipboard, then from a command-line/terminal window:
From here past the message request text into the window and press Enter twice (the message has to end with a blank line and cr/lf).
If all went well you should see and HTTP/1.1 200 OK message and your XML response text displayed: