02-19-2015 02:47 AM
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++;
}
}
}
02-20-2015 07:46 AM
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
02-27-2015 01:42 AM
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)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide