AXL CUCM 6.1 Beginner in C#2.0

Unanswered Question
May 29th, 2008

Hi there,

I am new to AXL programming and looking for some help on how to retrieve data from Cisco Unified CallManager Database (6.1).

I'm trying to retrieve data from CUCM database (User information such as First Name, Last Name, Extension and Department) in an XML format and display that information on a web page using .NET2.0(C#).

I have gone through the AXL Programming Guide. Also made the necessary configuration for .NET environment(mainly AXLAPIService.cs class file)

Below is the sample code that I am using to establish a connection between my .aspx page and CUCM Database.


TcpClient tcpClient = new TcpClient(url,80);

NetworkStream nStream = tcpClient.GetStream();

Encoding encode = Encoding.GetEncoding("utf-8");

StreamWriter sWriter = new StreamWriter(nStream);

StreamReader sReader = new StreamReader(nStream,encode);

string strAXLSOAPRequest = string.Empty;

string strAXLRequest = string.Empty;

try {

// --- SOAP Requst ----

strAXLSOAPRequest = "POST :8443/axl\r\n";

strAXLSOAPRequest += "Host :\r\n";

strAXLSOAPRequest += "Authorization :Basic bGFycnk6Y3VybHkgYW5kIG1vZQ==\r\n";

strAXLSOAPRequest += "Accept: text/*\r\n";

strAXLSOAPRequest += "Content-type: text/xml\r\n";

strAXLSOAPRequest += "content-length: ";

// --- SOAP Request Payload

strAXLRequest = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"\" ";

strAXLRequest += "xmlns:xsi=\"\" xmlns:xsd=\"\"> ";

strAXLRequest += "<SOAP-ENV:Body> <axl:getPhone xmlns:axl=\"\" ";

strAXLRequest += " xsi:schemaLocation=\"\" ";

strAXLRequest += " sequenc=\"1234\" > <phoneName>SEP001C5678CEBE</phoneName> ";

strAXLRequest += " </axl:getPhone> </SOAP-ENV:Body> </SOAP-ENV:Envelope>";

SOAP Request. strAXLSOAPRequest += strAXLRequest.Length;

strAXLSOAPRequest += "\r\n\r\n";




string strStreamReader;

while ((strStreamReader = sReader.ReadLine()) != null)

lblResponse.Text += strStreamReader + "<br/>";


With the above code I'm getting NULL in StreamReader and control doesn't go through the while loop.

I don't know exactly if this sample that I'm using is wrong or I've to make configuration changes. Any help would be highly appreciated.

Thanks for your time and efforts.



I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
stephan.steiner Thu, 05/29/2008 - 22:49

I don't know if that's it but look at your first line:

TcpClient tcpClient = new TcpClient(url,80);

You need to connect to port 443 or 8443 - and the whole thing only works using https so I'm not sure your approach would work out as I don't see anything about encryption.

Tim Smith Thu, 05/29/2008 - 23:20

Hi Kevin,

I'm no way an expert in this.. starting out as yourself, and I was using instead of C#..

But you want to take a look at some of the .net classes available to you already.

There are microsoft web client classes for .net that will do all the hard work for you. Including the HTTPS part which is essential.

I cant remember off the top of my head which one I used, but it worked a treat. A bit of google action should see you right ;)



rameshbalajiv Mon, 07/21/2008 - 10:39


Could you please provide the sample code for AXL to retrieve phone information. I am yet to decide on to go for or Java to start with.

Thank You

Ramesh Vasudevan

rameshbalajiv Mon, 07/21/2008 - 10:40

Hi Kevin:

Have you made any progress further from here with the error message. If you have found the solution, pl let us know.


Ramesh Vasudevan

kevindesai Mon, 07/21/2008 - 20:31

Hi Ramesh,

I still haven't get through to the solution yet. Once I do, I'll for sure post it here on this forum. Meanwhile, if you find anything useful please don't hesitate to share.

Good luck!


This Discussion