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:

POST /realtimeservice/services/RisPort HTTP/1.1
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://schemas.cisco.com/ast/soap/action/#RisPort#SelectCmDevice"
Content-Length: 1380
Authorization: Basic QWRtaW5pc3RyYXRvcjpjaXNjbyExMjM=
Host: 10.88.131.133:8443

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:

SelectCmDevice.txt (download)

POST /realtimeservice/services/RisPort HTTP/1.1
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://schemas.cisco.com/ast/soap/action/#RisPort#SelectCmDevice"
Content-Length: 1380
Authorization: Basic QWRtaW5pc3RyYXRvcjpjaXNjbyExMjM=
Host: 10.88.131.133:8443

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"...etc...

Making the request is pretty easy, simply copy the text to your clipboard, then from a command-line/terminal window:

dstaudt@ubuntu:~$ telnet -z ssl 10.88.131.133 8443
Trying 10.88.131.133...
SSL: Server has a self-signed certificate
SSL: unknown issuer: <self-signed cert info here>
Connected to 10.88.131.133.
Escape character is '^]'.

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:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONIDSSO=B70632E7B77AAEE1E6524941C2E55EB6; Path=/
Set-Cookie: JSESSIONID=69F05B928C4AA7C0D86B0A523FAA0D1B; >Path=/realtimeservice; Secure
Set-Cookie: SoapSession.id=-451835773722921813
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Fri, 19 Dec 2008 06:23:06 GMT

af4
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">...etc...</soapenv:Envelope>
0

Connection closed by foreign host.
0 Attachments
2562 Views
Average (0 Votes)
The average rating is 0.0 stars out of 5.
Comments