cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1183
Views
0
Helpful
2
Replies

Error after upgrading to CUCM 10.5 - Running executesqlcommand

ccooci2011
Level 1
Level 1

Good Evening Fellows, The below code run smoothly on the CUCM 9.0 test lab (isolated environment with no internet connection) which grabs user details and populate then in an array lists.an error message appears after upgrading the CUCM version to 10.5 "The remote server returned an error: (599)"

  HttpWebRequest req = (HttpWebRequest)WebRequest.Create(@"https://10.10.209.17/axl/");

  //req.KeepAlive = false;
  req.ProtocolVersion = HttpVersion.Version10;

  req.Method = "POST";
  //req.Headers.Add("Host","10.10.209.17");
  req.Host = "10.10.209.17";
  req.ProtocolVersion = System.Net.HttpVersion.Version10;
  req.ContentType = "text/xml";
  req.Accept = "text/xml";
  req.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes("admin:p@ssw0rd")));

  string strAXLRequest;
  strAXLRequest = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=";
  strAXLRequest += "\"http://schemas.xmlsoap.org/soap/envelope/\"";
  strAXLRequest += " xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"";
  strAXLRequest += " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";
  strAXLRequest += " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> ";
  strAXLRequest += "<SOAP-ENV:Body> ";
  strAXLRequest += "<m:executeSQLQuery xmlns:m=\"http://www.cisco.com/AXL/API/10.0\" sequence=\"1\"> ";
  strAXLRequest += "<m:sql> ";
  strAXLRequest += "SELECT userid,firstname,lastname,department FROM ENDUSER ORDER BY userid";
  strAXLRequest += "</m:sql> ";
  strAXLRequest += "</m:executeSQLQuery> ";
  strAXLRequest += "</SOAP-ENV:Body> ";
  strAXLRequest += "</SOAP-ENV:Envelope>";

  System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };


  req.ContentLength = strAXLRequest.Length;

  Stream s = req.GetRequestStream();
  byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strAXLRequest);
  s.Write(buffer, 0, strAXLRequest.Length);
  s.Close();

  WebResponse resp = req.GetResponse();
  s = resp.GetResponseStream();
  StreamReader sr = new StreamReader(s);
  XmlDocument xdoc = new XmlDocument();
  xdoc.Load(sr);
  XmlNodeList Users_List = xdoc.GetElementsByTagName("row");
  ArrayList Phones = new ArrayList();
  ArrayList First_Names = new ArrayList();
  ArrayList Last_Names = new ArrayList();
  ArrayList Department = new ArrayList();
  int index_arr = 0;
  int n;
  foreach (XmlNode user in Users_List)
  {
  if (index_arr < Users_List.Count)
  {
  if (Int32.TryParse(user.SelectSingleNode("userid").InnerText, out n) == true)
  {
  Phones.Add(user.SelectSingleNode("userid").InnerText);
  First_Names.Add(user.SelectSingleNode("firstname").InnerText);
  Last_Names.Add(user.SelectSingleNode("lastname").InnerText);
  Department.Add(user.SelectSingleNode("department").InnerText);
  index_arr++;
  }
  }
  }

2 Replies 2

npetrele
Cisco Employee
Cisco Employee

Error 599 can mean a number of things.  Since you started getting the error after an upgrade, I suspect it's a version mismatch.

Is your application using the new AXL WSDL, or still using the WSDL from 9.0?  If you're using anything from 9.0, that will cause an error with 10.5.

The WSDL has a soap action tag that points to the database version it expects.  The 10.5 WSDL contains tags like these:

<soap:operation soapAction="CUCM:DB ver=10.5 addSipProfile" style="document"/>

Whereas the 9.0 WSDL will have this:

      <soap:operation soapAction="CUCM:DB ver=9.0 addSipProfile" style="document"/>

If it's not a WSDL problem, I still suspect you have a version mismatch in there somewhere. See this similar thread regarding PERL (probably the same issue, different language):  Perl not working CUCM 10.5

stephan.steiner
Spotlight
Spotlight

I'd also check the axl logs on cucm to see if there's anything suspicious. You'd definitely see Schema mismatches in the logs (I have tons of such Errors in my logs.. it seems the callcenter isn't properly Setting the Schema Version and it keeps requesting stuff and CUCM dutyfully dumps those to the log)