cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5984
Views
1
Helpful
12
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++;
  }
  }
  }

12 Replies 12

dstaudt
Cisco Employee
Cisco Employee

Usually 599 occurs if the request somehow specifies an unsupported AXL version.  While the 10.0 version is indicated in the schema version in your request, it is also required that the version be specified in the 'SOAPAction' header:

POST https://10.194.104.56:8443/axl/ HTTP/1.1

Accept-Encoding: gzip,deflate

Content-Type: text/xml;charset=UTF-8

SOAPAction: "CUCM:DB ver=10.0 executeSQLQuery"

Authorization: Basic YXBwX3VzZXI6UEBzc3cwcmQx

Content-Length: 360

Host: 10.194.104.56:8443

Connection: Keep-Alive

User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

Please try adding the appropriate SOAPAction header, e.g.:

req.Headers.Add("SOAPAction","CUCM:DB ver=10.0 executeSQLQuery");

Many Thanks dstaudt for your prompt response...

After i add the piece of code that determines the DB version.it generates another error of "The remote server returned an error: (500) internal server error".

Important Notes:

-I didn't use any method from AXIAPIService class.

-I give the lap server some sort of internet but with no luck.

Again, appreciate your help alot.

Can you provide either/or:

- AXL logs from CUCM for this scenario

https://developer.cisco.com/site/axl/learn/how-to/gather-axl-logs.gsp

- Complete HTTP request/response, i.e. via an HTTPS troubleshooting tool like Fiddler or by emitting the HTTP request from the code

Sorry for the late reply,

i have extracted the axl logs, where i found that the problem may occurred a the CUCM can't identify the SOAP Action header

2015-02-19 08:10:26,181 INFO  [http-bio-443-exec-8] filters.TimingFilter - Received request 1424252852897 from admin at IP 10.10.209.150

2015-02-19 08:10:26,181 WARN  [http-bio-443-exec-8] wrappers.RequestHeaderWrapper - Client sent an unsupported header, SOAPAction= [null], attempting to auto correct.

2015-02-19 08:10:26,181 WARN  [http-bio-443-exec-8] wrappers.RequestHeaderWrapper - SOAPAction header correction needed: Version is malformed or missing

2015-02-19 08:10:26,181 WARN  [http-bio-443-exec-8] wrappers.RequestHeaderWrapper - SOAPAction header correction needed: Api is malformed or missing

2015-02-19 08:10:26,185 INFO  [http-bio-443-exec-8] servletRouters.AXLAlpha - Going to axis--->

2015-02-19 08:10:26,185 INFO  [http-bio-443-exec-8] servletRouters.AXLAlpha - AXL REQUEST :

can you help me doing the same thing with java? I'm using the AXLtoolkit

------- have a look to my blog lgrconsulting.com

The code in the AXL SQL Toolkit specifies the schema version in the header and namespace as below:

public SOAPMessage createSqlMessage(String cmdName, String sql) throws Exception {
   // Add a soap body element to the soap body
   MessageFactory mf = MessageFactory.newInstance();
   SOAPMessage soapMessage = mf.createMessage();
MimeHeaders mh = soapMessage.getMimeHeaders();
mh.addHeader("SOAPAction", "CUCM:DB ver=10.5");
   SOAPEnvelope envelope = soapMessage.getSOAPPart().getEnvelope();
   SOAPBody bdy = envelope.getBody();
envelope.addNamespaceDeclaration("ns", "http://www.cisco.com/AXL/API/10.5");
   SOAPBodyElement bodyElement = bdy.addBodyElement(envelope.createName(cmdName));
bodyElement.setPrefix("ns");
   bodyElement.addAttribute(envelope.createName("sequence"), String.valueOf(System.currentTimeMillis()));
   bodyElement.addChildElement("sql").addTextNode(sql);
   return soapMessage;
}

Note the lines:

- mh.addHeader("SOAPAction", "CUCM:DB ver=10.5");

and

- envelope.addNamespaceDeclaration("ns", "http://www.cisco.com/AXL/API/10.5");

where the schema version has been hard-coded in.

lorenz84gDD
Level 1
Level 1

Thanks a lot for your reply, much appreciated. What I'm trying to do is modify the axltoolkit class and create a partition to start then I'll do the same stuff for CSSs, Locations etc.

But the below code is failing on the CUCM with this error:

Request 1447928479783 was processed in 72ms
2015-12-02 12:39:55,006 INFO  [http-bio-443-exec-3] filters.TimingFilter - Received request 1447928479784 from administrator at IP 10.100.253.43
2015-12-02 12:39:55,006 DEBUG [http-bio-443-exec-3] wrappers.RequestHeaderWrapper - Inside Request Header Wrapper
2015-12-02 12:39:55,006 WARN  [http-bio-443-exec-3] wrappers.RequestHeaderWrapper - Client sent an unsupported header, SOAPAction= [CUCM:DB ver=10.5], attempting to auto correct.
2015-12-02 12:39:55,006 WARN  [http-bio-443-exec-3] wrappers.RequestHeaderWrapper - SOAPAction header correction needed: Api is malformed or missing
2015-12-02 12:39:55,011 DEBUG [http-bio-443-exec-3] filters.ThrottlingFilter - DBLCNQueue Count: 0
2015-12-02 12:39:55,012 DEBUG [http-bio-443-exec-3] filters.ThrottlingFilter - Successfully set the value of counter: 4 value: 0
2015-12-02 12:39:55,012 DEBUG [http-bio-443-exec-3] servletRouters.AXLAlpha - Checking request version [10.5]
2015-12-02 12:39:55,012 DEBUG [http-bio-443-exec-3] servletRouters.AXLAlpha - Checking if requested api [addRoutePartition] the implementedHandlers list
2015-12-02 12:39:55,012 DEBUG [http-bio-443-exec-3] servletRouters.AXLAlpha - [addRoutePartition] is not in the implementedHandlers list
2015-12-02 12:39:55,012 INFO  [http-bio-443-exec-3] servletRouters.AXLAlpha - Going to axis--->
2015-12-02 12:39:55,013 DEBUG [http-bio-443-exec-3] wrappers.RequestNamespaceWrapper - Inside Request Wrapper
2015-12-02 12:39:55,013 INFO  [http-bio-443-exec-3] servletRouters.AXLAlpha - AXL REQUEST :

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/10.5"><SOAP-ENV:Header/><SOAP-ENV:Body><ns:addRoutePartition><newPattern sequence="1449056395221"><name>PT-X-TEST1</name><description>PT site </description></newPattern></ns:addRoutePartition></SOAP-ENV:Body></SOAP-ENV:Envelope>

2015-12-02 12:39:55,013 DEBUG [http-bio-443-exec-3] servletRouters.AXLAlpha - Request processed by AXIS
2015-12-02 12:39:55,015 DEBUG [http-bio-443-exec-3] axlapiservice.Handler - dbConnector Initialization in handler.java
2015-12-02 12:39:55,015 DEBUG [http-bio-443-exec-3] axlapiservice.Axl - Connection given to current thread
2015-12-02 12:39:55,016 DEBUG [http-bio-443-exec-3] axlapiservice.Axl - Thread is same so connection is reused, name of thread : http-bio-443-exec-3
2015-12-02 12:39:55,017 DEBUG [http-bio-443-exec-3] axlapiservice.AXLCallFlow - In begin transaction of AXLCallflow and created pub connector
2015-12-02 12:39:55,017 DEBUG [http-bio-443-exec-3] axlapiservice.AddRoutePartitionHandler - In AddRoutePartition

public SOAPMessage createSOAPMessage(String sPattern, String sPartition, String sCSS, String sMask) throws Exception {

        MessageFactory mf = MessageFactory.newInstance();

        SOAPMessage soapMessage = mf.createMessage();

        MimeHeaders headers = soapMessage.getMimeHeaders();

        headers.addHeader("SOAPAction", "CUCM:DB ver=10.5");

        SOAPEnvelope envelope = soapMessage.getSOAPPart().getEnvelope();

        SOAPBody bdy = envelope.getBody();

        envelope.addNamespaceDeclaration("ns", "http://www.cisco.com/AXL/API/10.5");

        SOAPBodyElement bodyElement = bdy.addBodyElement(envelope.createName("addRoutePartition"));

        bodyElement.setPrefix("ns");

       

       

        Name attrUuid = envelope.createName("uuid");

       

        SOAPElement newPattern = bodyElement.addChildElement("newPattern");

        newPattern.addAttribute(envelope.createName("sequence"), String.valueOf(System.currentTimeMillis()));

        newPattern.addChildElement("name").addTextNode(sPattern);       

        newPattern.addChildElement("description").addTextNode(sCSS);      

       

      

       

        return soapMessage;

    }

------- have a look to my blog lgrconsulting.com

The reason for all this version stuff is of course because the AXL schema may change between versions.  I think that is the case here: if you are actually running against 10.5 and are specifying the 10.5 schema, then the actual XML for the addRoutePartition request you are sending looks to be from an old version.

The 10.5 version of the request looks like:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/10.5">

   <soapenv:Header/>

   <soapenv:Body>

      <ns:addRoutePartition sequence="?">

         <routePartition>

            <name>?</name>

            <!--Optional:-->

            <description>?</description>

            <!--Optional:-->

            <timeScheduleIdName uuid="?">?</timeScheduleIdName>

            <!--Optional:-->

            <useOriginatingDeviceTimeZone>true</useOriginatingDeviceTimeZone>

            <!--Optional:-->

            <timeZone>Etc/GMT</timeZone>

            <!--Optional:-->

            <partitionUsage>General</partitionUsage>

         </routePartition>

      </ns:addRoutePartition>

   </soapenv:Body>

</soapenv:Envelope>

can you point me to a collection of all the SOAP messages?

I'm aware of the AXL Schema Reference but it's not like the SOAP message format you just posted.

Again thanks a lot for your help!

------- have a look to my blog lgrconsulting.com

think i got it!

should be explained here:

Cisco DevNet: Administrative XML (AXL) - How To

------- have a look to my blog lgrconsulting.com

Hello people !!


I have the same problem, and i also changed the version of CUCM:DB to the version 10.5. Then it changed the error code to 500, but i still could not solve this. Someone could then move forward from this point?

Hi Walter, could you create a new thread for your question, and include:

- Full request/response (including headers) of the AXL operation

- AXL service logs

- Version of CUCM you are testing with