cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
603
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Mohamad Atef on 29-11-2010 01:48:40 PM
I'm using call manager 6 , and I noticed there is a method to list all the devices on the call manager and there are no methods to list the lines on the call manager.If anybody has some ideas, please let me know, thanks in advance.

Subject: RE: How to List all lines on the call Manager?
Replied by: Mayank Sharma on 29-11-2010 02:06:24 PM
I'm using call manager 6 , and I noticed there is a method to list all the devices on the call manager and there are no methods to list the lines on the call manager.If anybody has some ideas, please let me know, thanks in advance.




You can execute an SQL query and get list of directory numbers from NUMPLAN table.

This thread might help: http://developer.cisco.com/web/axl/forums/-/message_boards/message/1553976

Subject: Re: New Message from Mohamad Atef in Administration XML (AXL) - Administrat
Replied by: Wes Schochet on 29-11-2010 05:54:11 PM
I use the Route Plan Report under call routing quite a bit.  It's the closest you'll find in the actual GUI.   You can write an AXL query something like this:

select d.name, d.description, m.numplanindex, n.dnorpattern
from (device d inner join devicenumplanmap m on  d.pkid = m.fkdevice)
          inner join numplan n on n.pkid = m.fknumplan
where d.name like 'SEP%' and numplanindex=1


>>> On 11/29/2010 at  7:48 AM, Cisco Developer Community Forums <cdicuser@developer.cisco.com> wrote:
Mohamad Atef has created a new message in the forum "Administration XML Questions":
--------------------------------------------------------------
I'm using call manager 6 , and I noticed there is a method to list all the devices on the call manager and there are no methods to list the lines on the call manager.If anybody has some ideas, please let me know, thanks in advance.
--
To respond to this post, please click the following link:
<http://developer.cisco.com/web/axl/forums/-/message_boards/message/2782048>
or simply reply to this email.

Confidentiality Statement:
This email/fax, including attachments, may include confidential
and/or proprietary information and may be used only by the
person or entity to which it is addressed. If the reader of
this email/fax is not the intended recipient or his or her
agent, the reader is hereby notified that any dissemination,
distribution or copying of this email/fax is prohibited. If you
have received this email/fax in error, please notify the sender
by replying to this message and deleting this email or
destroying this facsimile immediately.

Subject: RE: How to List all lines on the call Manager?
Replied by: David Staudt on 07-12-2010 02:28:01 PM
The XSD type of the response to any <ExecuteSQLQuery> is of XSD type 'any' - i.e. an undefined block of XML.  The actual XML returned is of course dependent on the specifics of the SQL query you submit, and Axis is unable to handle the  result itself:
 
No deserializer for {http://www.w3.org/2001/XMLSchema}anyType
 
For these types of queries, you will need to either build your own SAX deserializer for the query and incorporate it into the Axis source code (hard), or use a more 'manual' approach to the XML, such as using XML DOM (Xerxes) or simple string parsing - much easier.  

Subject: RE: How to List all lines on the call Manager?
Replied by: Mohamad Atef on 07-12-2010 10:34:18 AM
well , I tried to make a query like this :
 
 public void getAllLines() throws RemoteException{
   ExecuteSQLQueryReq req = new ExecuteSQLQueryReq();
   req.setSql("select numplan.dnorpattern, numplan.alertingname, numplan.alertingnameascii, typepatternusage.name as type from numplan, typepatternusage where numplan.tkpatternusage=typepatternusage.enum");
   stub.executeSQLQuery(req);
   }
 
 
and unfortunately it's not working and giving me this exception:
 
 
- Exception:
org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType
Exception in thread "main" AxisFault
        at org.apache.axis.encoding.DeserializerImpl.onStartElement(DeserializerImpl.java:453)
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
        at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
 faultSubcode:
 faultString: org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType
        at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
 faultActor:
        at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
 faultNode:
 faultDetail:
        at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
        {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType
        at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
        at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
        at org.apache.axis.encoding.DeserializerImpl.onStartElement(DeserializerImpl.java:453)
        at org.apache.axis.client.Call.invoke(Call.java:2467)
        at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
        at cisco.www.AXLAPIService.AXLAPIBindingStub.executeSQLQuery(AXLAPIBindingStub.java:21773)
        at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
        at axl.AXLManipulator6Impl.getAllLines(AXLManipulator6Impl.java:173)
        at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
        at axl.Main.main(Main.java:32)
        at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
        at org.apache.axis.client.Call.invoke(Call.java:2467)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at cisco.www.AXLAPIService.AXLAPIBindingStub.executeSQLQuery(AXLAPIBindingStub.java:21773)
        at axl.AXLManipulator6Impl.getAllLines(AXLManipulator6Impl.java:173)
        at axl.Main.main(Main.java:32)
 
can anybody know ,what does this really mean?

Subject: RE: How to List all lines on the call Manager?
Replied by: Mohamad Atef on 14-12-2010 09:28:13 AM
The XSD type of the response to any <ExecuteSQLQuery> is of XSD type 'any' - i.e. an undefined block of XML.  The actual XML returned is of course dependent on the specifics of the SQL query you submit, and Axis is unable to handle the  result itself:
 
No deserializer for {http://www.w3.org/2001/XMLSchema}anyType
 
For these types of queries, you will need to either build your own SAX deserializer for the query and incorporate it into the Axis source code (hard), or use a more 'manual' approach to the XML, such as using XML DOM (Xerxes) or simple string parsing - much easier.  

 
 
can you give me more hint of how to do it?

Subject: RE: How to List all lines on the call Manager?
Replied by: David Staudt on 14-12-2010 04:19:19 PM
The AXL SQL Toolkit (downloadable from the UCM admin web UI, under Applications/Tools) contains some java source code that demonstrates using javax SOAP tools and Xerxes DOM.

Subject: RE: How to List all lines on the call Manager?
Replied by: Mohamad Atef on 15-12-2010 09:40:26 AM
 
 
The AXL SQL Toolkit (downloadable from the UCM admin web UI, under Applications/Tools) contains some java source code that demonstrates using javax SOAP tools and Xerxes DOM.

 
 
 
 
well, I've written this code:
// this method connects to the CUCM
 public void conectToCCUM(String username, String password) throws ServiceException, MalformedURLException {
        System.setProperty("javax.net.debug", "ssl:plaintext");
        AxisProperties.setProperty("axis.socketSecureFactory", "axl.SocketFactory");
        //initialization
        AXLAPIServiceLocator locator = new AXLAPIServiceLocator();
        stub = (AXLAPIBindingStub) locator.getAXLPort(new URL("https://192.168.1.50:8443/axl/"));
        //String username = "administrator";
        // String password = "Xeno@123456";
        ListUserByNameReq userListReq = new ListUserByNameReq();
        stub.setUsername(username);
        stub.setPassword(password);
    }
// and this makes some query
 public void getSomeByQuery() throws RemoteException {
        ExecuteSQLQueryReq req = new ExecuteSQLQueryReq();
        req.setSql("select pkid from endusernumplanmap");
        System.out.println( stub.executeSQLQuery(req).get_return());

    }
 
in the main method I call conectToCCUM() , and then getSomeByQuery(). As a result I getting an exception.
 
 
org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType
Exception in thread "main" AxisFault
        at org.apache.axis.encoding.DeserializerImpl.onStartElement(DeserializerImpl.java:453)
         faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
 faultSubcode:
 faultString: org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType
        at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
 faultActor:
        at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
 faultNode:
        at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType
        at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
        at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
        at org.apache.axis.encoding.DeserializerImpl.onStartElement(DeserializerImpl.java:453)
        at org.apache.axis.client.Call.invoke(Call.java:2467)
        at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
        at cisco.www.AXLAPIService.AXLAPIBindingStub.executeSQLQuery(AXLAPIBindingStub.java:21773)
        at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
        at axl.AXLManipulator6Impl.getLinesByQuery(AXLManipulator6Impl.java:230)
        at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
        at axl.Main.main(Main.java:42)
        at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
        at org.apache.axis.client.Call.invoke(Call.java:2467)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at cisco.www.AXLAPIService.AXLAPIBindingStub.executeSQLQuery(AXLAPIBindingStub.java:21773)
        at axl.AXLManipulator6Impl.getLinesByQuery(AXLManipulator6Impl.java:230)
        at axl.Main.main(Main.java:42)

        {http://xml.apache.org/axis/}hostname:smohamady

org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
        at org.apache.axis.client.Call.invoke(Call.java:2470)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at cisco.www.AXLAPIService.AXLAPIBindingStub.executeSQLQuery(AXLAPIBindingStub.java:21773)
        at axl.AXLManipulator6Impl.getLinesByQuery(AXLManipulator6Impl.java:230)
        at axl.Main.main(Main.java:42)
Caused by: org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType
        at org.apache.axis.encoding.DeserializerImpl.onStartElement(DeserializerImpl.java:453)
        at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
        at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
        at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
        at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
        at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
        at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
        at org.apache.axis.client.Call.invoke(Call.java:2467)
        ... 5 more
Java Result: 1

and after debugging the ssl connection to see the comming response, I get this :
 
Padded plaintext after DECRYPTION:  len = 928
0000: 48 54 54 50 2F 31 2E 31   20 32 30 30 20 4F 4B 0D  HTTP/1.1 200 OK.
0010: 0A 53 65 72 76 65 72 3A   20 41 70 61 63 68 65 2D  .Server: Apache-
0020: 43 6F 79 6F 74 65 2F 31   2E 31 0D 0A 53 65 74 2D  Coyote/1.1..Set-
0030: 43 6F 6F 6B 69 65 3A 20   4A 53 45 53 53 49 4F 4E  Cookie: JSESSION
0040: 49 44 53 53 4F 3D 33 45   31 37 45 41 30 42 36 38  IDSSO=3E17EA0B68
0050: 35 44 32 35 32 32 39 31   41 30 41 46 43 35 44 38  5D252291A0AFC5D8
0060: 42 42 36 38 46 35 3B 20   50 61 74 68 3D 2F 0D 0A  BB68F5; Path=/..
0070: 53 65 74 2D 43 6F 6F 6B   69 65 3A 20 4A 53 45 53  Set-Cookie: JSES
0080: 53 49 4F 4E 49 44 3D 36   42 45 38 36 32 42 41 36  SIONID=6BE862BA6
0090: 36 31 33 38 32 44 35 41   31 35 45 32 45 42 36 42  61382D5A15E2EB6B
00A0: 30 45 37 39 32 44 33 3B   20 50 61 74 68 3D 2F 61  0E792D3; Path=/a
00B0: 78 6C 3B 20 53 65 63 75   72 65 0D 0A 53 4F 41 50  xl; Secure..SOAP
00C0: 41 63 74 69 6F 6E 3A 20   22 43 55 43 4D 3A 44 42  Action: "CUCMB
00D0: 20 76 65 72 3D 36 2E 31   20 65 78 65 63 75 74 65   ver=6.1 execute
00E0: 53 51 4C 51 75 65 72 79   22 0D 0A 43 6F 6E 74 65  SQLQuery"..Conte
00F0: 6E 74 2D 54 79 70 65 3A   20 74 65 78 74 2F 78 6D  nt-Type: text/xm
0100: 6C 3B 63 68 61 72 73 65   74 3D 49 53 4F 2D 38 38  l;charset=ISO-88
0110: 35 39 2D 31 0D 0A 43 6F   6E 74 65 6E 74 2D 4C 65  59-1..Content-Le
0120: 6E 67 74 68 3A 20 35 34   33 0D 0A 44 61 74 65 3A  ngth: 543..Date:
0130: 20 53 61 74 2C 20 31 31   20 44 65 63 20 32 30 31   Sat, 11 Dec 201
0140: 30 20 30 36 3A 33 31 3A   32 38 20 47 4D 54 0D 0A  0 06:31:28 GMT..
0150: 43 6F 6E 6E 65 63 74 69   6F 6E 3A 20 63 6C 6F 73  Connection: clos
0160: 65 0D 0A 0D 0A 3C 3F 78   6D 6C 20 76 65 72 73 69  e....<?xml versi
0170: 6F 6E 3D 22 31 2E 30 22   20 65 6E 63 6F 64 69 6E  on="1.0" encodin
0180: 67 3D 22 49 53 4F 2D 38   38 35 39 2D 31 22 3F 3E  g="ISO-8859-1"?>
0190: 3C 53 4F 41 50 2D 45 4E   56 3A 45 6E 76 65 6C 6F  <SOAP-ENV:Envelo
01A0: 70 65 20 78 6D 6C 6E 73   3A 53 4F 41 50 2D 45 4E  pe xmlns:SOAP-EN
01B0: 56 3D 22 68 74 74 70 3A   2F 2F 73 63 68 65 6D 61  V="http://schema
01C0: 73 2E 78 6D 6C 73 6F 61   70 2E 6F 72 67 2F 73 6F  s.xmlsoap.org/so
01D0: 61 70 2F 65 6E 76 65 6C   6F 70 65 2F 22 20 53 4F  ap/envelope/" SO
01E0: 41 50 2D 45 4E 56 3A 65   6E 63 6F 64 69 6E 67 53  AP-ENV:encodingS
01F0: 74 79 6C 65 3D 22 68 74   74 70 3A 2F 2F 73 63 68  tyle="http://sch
0200: 65 6D 61 73 2E 78 6D 6C   73 6F 61 70 2E 6F 72 67  emas.xmlsoap.org
0210: 2F 73 6F 61 70 2F 65 6E   63 6F 64 69 6E 67 2F 22  /soap/encoding/"
0220: 3E 3C 53 4F 41 50 2D 45   4E 56 3A 48 65 61 64 65  ><SOAP-ENV:Heade
0230: 72 2F 3E 3C 53 4F 41 50   2D 45 4E 56 3A 42 6F 64  r/><SOAP-ENV:Bod
0240: 79 3E 3C 61 78 6C 3A 65   78 65 63 75 74 65 53 51  y><axl:executeSQ
0250: 4C 51 75 65 72 79 52 65   73 70 6F 6E 73 65 20 78  LQueryResponse x
0260: 6D 6C 6E 73 3A 61 78 6C   3D 22 68 74 74 70 3A 2F  mlns:axl="http:/
0270: 2F 77 77 77 2E 63 69 73   63 6F 2E 63 6F 6D 2F 41  /www.cisco.com/A
0280: 58 4C 2F 41 50 49 2F 36   2E 31 22 20 78 6D 6C 6E  XL/API/6.1" xmln
0290: 73 3A 78 73 69 3D 22 68   74 74 70 3A 2F 2F 77 77  s:xsi="http://ww
02A0: 77 2E 63 69 73 63 6F 2E   63 6F 6D 2F 41 58 4C 2F  w.cisco.com/AXL/
02B0: 41 50 49 2F 36 2E 31 22   3E 3C 72 65 74 75 72 6E  API/6.1"><return
02C0: 3E 3C 72 6F 77 3E 3C 70   6B 69 64 3E 61 32 65 36  ><row><pkid>a2e6
02D0: 32 32 39 66 2D 66 33 39   35 2D 34 30 34 30 2D 61  229f-f395-4040-a
02E0: 30 62 30 2D 32 35 37 30   61 39 62 39 34 64 64 65  0b0-2570a9b94dde
02F0: 3C 2F 70 6B 69 64 3E 3C   2F 72 6F 77 3E 3C 72 6F  </pkid></row><ro
0300: 77 3E 3C 70 6B 69 64 3E   65 35 37 30 33 65 63 62  w><pkid>e5703ecb
0310: 2D 63 38 66 63 2D 34 35   65 38 2D 38 30 37 38 2D  -c8fc-45e8-8078-
0320: 65 33 35 61 32 38 38 31   37 64 33 61 3C 2F 70 6B  e35a28817d3a</pk
0330: 69 64 3E 3C 2F 72 6F 77   3E 3C 2F 72 65 74 75 72  id></row></retur
0340: 6E 3E 3C 2F 61 78 6C 3A   65 78 65 63 75 74 65 53  n></axl:executeS
0350: 51 4C 51 75 65 72 79 52   65 73 70 6F 6E 73 65 3E  QLQueryResponse>
0360: 3C 2F 53 4F 41 50 2D 45   4E 56 3A 42 6F 64 79 3E  </SOAP-ENV:Body>
0370: 3C 2F 53 4F 41 50 2D 45   4E 56 3A 45 6E 76 65 6C  </SOAP-ENV:Envel
0380: 6F 70 65 3E 45 61 E5 B5   8C D6 BE A9 C4 C5 EA 67  ope>Ea.........g
0390: 5B BD FD 6F C3 BE E0 D3   07 07 07 07 07 07 07 07  [..o............
main, READ: TLSv1 Alert, length = 32
 
 
as you can see , I get the return , which has row , which has pkid that I was quering.
what can I do to get the response with out exceptions?

Subject: RE: How to List all lines on the call Manager?
Replied by: David Staudt on 15-12-2010 02:57:19 PM
The main consideration is that you cannot use the Axis generated code to access the <return> element - Axis cannot handle the 'xsd:any' data type that is defined for this element.  You will need to abandon Axis for <executeSQLQuery> requests, and use 'lower level' mechanisms, such as the javax SOAP and DOM libraries or simple text parsing.

Subject: RE: How to List all lines on the call Manager?
Replied by: Mohamad Atef on 15-12-2010 03:17:53 PM
The main consideration is that you cannot use the Axis generated code to access the <return> element - Axis cannot handle the 'xsd:any' data type that is defined for this element.  You will need to abandon Axis for <executeSQLQuery> requests, and use 'lower level' mechanisms, such as the javax SOAP and DOM libraries or simple text parsing.

 
ok, but how can I abandon the axis here ?
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links