<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Some basic AXL sql questions in Management</title>
    <link>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4003747#M3276</link>
    <description>&lt;P&gt;Good Day,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a complete beginner with AXL, Java, and Eclipse IDE.&lt;/P&gt;&lt;P&gt;I have been trying to begin learning in these areas by reviewing what information I can find online, but am struggling!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ive been able to do some basic stuff like getphone to pull phone device information, and set a phone device description ( as a basic step) using UpdatePhoneReq. But I just havent had any luck trying to run SQL queries via axl.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There seems to be a couple different methods for accomplishing an SQL query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One appears to be by simply defining the query in a string, then using 'ExecuteSQLQueryReq' in a manner similiar to the code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;String sSQLQuery = "SELECT * FROM numplan"; //V2
ExecuteSQLQueryReq axlParams = new ExecuteSQLQueryReq();
axlParams.setSql(sSQLQuery);

try{
&amp;nbsp;ExecuteSQLQueryRes getSQLResponse = axlPort.executeSQLQuery(axlParams);
&amp;nbsp;List&amp;lt;Object&amp;gt; returnList = new ArrayList&amp;lt;Object&amp;gt;(); //added to orig
&amp;nbsp;returnList = getSQLResponse.getReturn().getRow();

&amp;nbsp;for (Object object : returnList) {
&amp;nbsp; System.out.println(object.toString() + "\n");
&amp;nbsp;}

&amp;nbsp;} catch (AXLError e ) {
&amp;nbsp; System.out.println("An AXLError occurred:" + e.getFaultInfo());
&amp;nbsp;}
}&lt;/PRE&gt;&lt;P&gt;I can get this method to run, but no matter how I try to enumerate what should be the returned values, I just get Row: null; entries in the output (it does contain the correct number of rows tho...) (I should also mention that when I pull the axl logs from call manager(10.5 btw), the query looks properly formed and no errors are shown. I dont see any response information in the log but I dont know that I am supposed to)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The other method appears to be by constructing the soap structures manually like this:&lt;/P&gt;&lt;PRE&gt;	&amp;lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/8.5"&amp;gt;
	   &amp;lt;soapenv:Header/&amp;gt;
	   &amp;lt;soapenv:Body&amp;gt;
	      &amp;lt;ns:executeSQLQuery sequence="1"&amp;gt;
	         &amp;lt;sql&amp;gt;select * from processnode&amp;lt;/sql&amp;gt;
	      &amp;lt;/ns:executeSQLQuery&amp;gt;
	   &amp;lt;/soapenv:Body&amp;gt;
	&amp;lt;/soapenv:Envelope&amp;gt;&lt;/PRE&gt;&lt;P&gt;For that style, I was never able to get past compiler muster: I couldnt get it to like the soap tag structures.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my questions are:&lt;/P&gt;&lt;P&gt;Why are there 2 different methods, when it seams like the&amp;nbsp;ExecuteSQLQueryRes method would be more straight-forward?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the direct SOAP method supported via Java?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why cant I see anything but nulls using the&amp;nbsp;ExecuteSQLQueryRes method - even tho I have gone to command line on the pub, executed the same simple query, and see data populated?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a preferred method between these 2? if so, why?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I be trying to do this via Java? I chose that language because I found a few demos and videos that used Java and I wanted to try to keep the already steep learning curve down as much as possible. If that answer is dependent upon the application, my immediate end goal is to create a form-driven api that would allow service-desk staff do basic phone builds in a simplified 'supercopy' type fashion, while limiting their access to just that function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are there any good, basic, resources that could help me slog through the basics? I done a lot of search-engine searches and I haven't been able to find much that steps me through a lot of this in a helpful fashion. Many of my directed searches wind up at dead links (a lot of jiveon's). Others are too far from applicability, or I cant get them to run at all. Part of the problem is probably because I dont have the luxury, time-wise, of first knowing, or&amp;nbsp; learning java, then eclipse, then axl, so I can focus on 1 thing at a time - I have to dive in with a solution-based approach and learn as I go.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd appreciate your thoughts and any direction you can provide!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS, something else I noticed is that there seems to be 2 methods of attempting to display returned information: just iterating through - as I tried in the first example listed - and one that uses getElementsByTagName like below:&lt;/P&gt;&lt;PRE&gt;import org.w3c.dom.Document;&lt;BR /&gt;import org.w3c.dom.Node;&lt;BR /&gt;import org.w3c.dom.NodeList;&lt;BR /&gt;(some other code to connect and perform query)&lt;BR /&gt;Element returnValue = Element)returnList.get(1);//
	     Field test = Doc.class.getField(phoneName);
	      Object dNumber = returnValue.getElementsByTagName("phoneName").item(0).getFirstChild().getTextContent();&lt;/PRE&gt;&lt;P&gt;but I can't get it to recognize&amp;nbsp;getElementsByTagName, and I cant find any clear help on doing so. Can that method be used with Java? Is there a basic tutorial somewhere on setting it up and getting it working?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thx again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Dec 2019 19:33:56 GMT</pubDate>
    <dc:creator>Keith Abbott</dc:creator>
    <dc:date>2019-12-26T19:33:56Z</dc:date>
    <item>
      <title>Some basic AXL sql questions</title>
      <link>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4003747#M3276</link>
      <description>&lt;P&gt;Good Day,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a complete beginner with AXL, Java, and Eclipse IDE.&lt;/P&gt;&lt;P&gt;I have been trying to begin learning in these areas by reviewing what information I can find online, but am struggling!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ive been able to do some basic stuff like getphone to pull phone device information, and set a phone device description ( as a basic step) using UpdatePhoneReq. But I just havent had any luck trying to run SQL queries via axl.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There seems to be a couple different methods for accomplishing an SQL query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One appears to be by simply defining the query in a string, then using 'ExecuteSQLQueryReq' in a manner similiar to the code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;String sSQLQuery = "SELECT * FROM numplan"; //V2
ExecuteSQLQueryReq axlParams = new ExecuteSQLQueryReq();
axlParams.setSql(sSQLQuery);

try{
&amp;nbsp;ExecuteSQLQueryRes getSQLResponse = axlPort.executeSQLQuery(axlParams);
&amp;nbsp;List&amp;lt;Object&amp;gt; returnList = new ArrayList&amp;lt;Object&amp;gt;(); //added to orig
&amp;nbsp;returnList = getSQLResponse.getReturn().getRow();

&amp;nbsp;for (Object object : returnList) {
&amp;nbsp; System.out.println(object.toString() + "\n");
&amp;nbsp;}

&amp;nbsp;} catch (AXLError e ) {
&amp;nbsp; System.out.println("An AXLError occurred:" + e.getFaultInfo());
&amp;nbsp;}
}&lt;/PRE&gt;&lt;P&gt;I can get this method to run, but no matter how I try to enumerate what should be the returned values, I just get Row: null; entries in the output (it does contain the correct number of rows tho...) (I should also mention that when I pull the axl logs from call manager(10.5 btw), the query looks properly formed and no errors are shown. I dont see any response information in the log but I dont know that I am supposed to)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The other method appears to be by constructing the soap structures manually like this:&lt;/P&gt;&lt;PRE&gt;	&amp;lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/8.5"&amp;gt;
	   &amp;lt;soapenv:Header/&amp;gt;
	   &amp;lt;soapenv:Body&amp;gt;
	      &amp;lt;ns:executeSQLQuery sequence="1"&amp;gt;
	         &amp;lt;sql&amp;gt;select * from processnode&amp;lt;/sql&amp;gt;
	      &amp;lt;/ns:executeSQLQuery&amp;gt;
	   &amp;lt;/soapenv:Body&amp;gt;
	&amp;lt;/soapenv:Envelope&amp;gt;&lt;/PRE&gt;&lt;P&gt;For that style, I was never able to get past compiler muster: I couldnt get it to like the soap tag structures.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my questions are:&lt;/P&gt;&lt;P&gt;Why are there 2 different methods, when it seams like the&amp;nbsp;ExecuteSQLQueryRes method would be more straight-forward?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the direct SOAP method supported via Java?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why cant I see anything but nulls using the&amp;nbsp;ExecuteSQLQueryRes method - even tho I have gone to command line on the pub, executed the same simple query, and see data populated?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a preferred method between these 2? if so, why?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I be trying to do this via Java? I chose that language because I found a few demos and videos that used Java and I wanted to try to keep the already steep learning curve down as much as possible. If that answer is dependent upon the application, my immediate end goal is to create a form-driven api that would allow service-desk staff do basic phone builds in a simplified 'supercopy' type fashion, while limiting their access to just that function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are there any good, basic, resources that could help me slog through the basics? I done a lot of search-engine searches and I haven't been able to find much that steps me through a lot of this in a helpful fashion. Many of my directed searches wind up at dead links (a lot of jiveon's). Others are too far from applicability, or I cant get them to run at all. Part of the problem is probably because I dont have the luxury, time-wise, of first knowing, or&amp;nbsp; learning java, then eclipse, then axl, so I can focus on 1 thing at a time - I have to dive in with a solution-based approach and learn as I go.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd appreciate your thoughts and any direction you can provide!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS, something else I noticed is that there seems to be 2 methods of attempting to display returned information: just iterating through - as I tried in the first example listed - and one that uses getElementsByTagName like below:&lt;/P&gt;&lt;PRE&gt;import org.w3c.dom.Document;&lt;BR /&gt;import org.w3c.dom.Node;&lt;BR /&gt;import org.w3c.dom.NodeList;&lt;BR /&gt;(some other code to connect and perform query)&lt;BR /&gt;Element returnValue = Element)returnList.get(1);//
	     Field test = Doc.class.getField(phoneName);
	      Object dNumber = returnValue.getElementsByTagName("phoneName").item(0).getFirstChild().getTextContent();&lt;/PRE&gt;&lt;P&gt;but I can't get it to recognize&amp;nbsp;getElementsByTagName, and I cant find any clear help on doing so. Can that method be used with Java? Is there a basic tutorial somewhere on setting it up and getting it working?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thx again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2019 19:33:56 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4003747#M3276</guid>
      <dc:creator>Keith Abbott</dc:creator>
      <dc:date>2019-12-26T19:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Some basic AXL sql questions</title>
      <link>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4004222#M3277</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For a little further enlightenment, I downloaded SoapUI and from there was able to use 'executeSQLQuery' to run exactly the same query I have been attempting in my java code - So the problem that started all of the questions doesnt relate to:&lt;/P&gt;&lt;P&gt;The server Im running against - used the same one&lt;/P&gt;&lt;P&gt;the credentials - same&lt;/P&gt;&lt;P&gt;the sql query - same&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and RTMT AXL log shows exactly what it did on Java attempts.&lt;/P&gt;&lt;P&gt;So AXL calls appear they should work, and shouldnt require manually building SOAP requests&lt;/P&gt;&lt;P&gt;and there must be a problem with the way I am capturing and iterating he return data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the basic questions still remain:&lt;/P&gt;&lt;P&gt;Can Java use the manually constructed SOAP SQL requests?&lt;/P&gt;&lt;P&gt;Is there an advantage to using those over 'ExecuteSQLQuery'?&lt;/P&gt;&lt;P&gt;Is Java a good choice over, say C++ or PHP - especially when looking for ease-of-learning?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add to that the more specific questions regarding the problem with my code. I am capturing the return (at least I think I am)&amp;nbsp; in getSQLResponse:&lt;/P&gt;&lt;PRE&gt;ExecuteSQLQueryRes getSQLResponse = axlPort.executeSQLQuery(axlParams);&lt;/PRE&gt;&lt;P&gt;then I think Im dumping each row into array returnList:&lt;/P&gt;&lt;PRE&gt;List&amp;lt;Object&amp;gt; returnList = new ArrayList&amp;lt;Object&amp;gt;();
returnList = getSQLResponse.getReturn().getRow();&lt;/PRE&gt;&lt;P&gt;Then I think Im iterating through that, converting it to string, and dumping to console with:&lt;/P&gt;&lt;PRE&gt;for (Object object : returnList) {
     System.out.println(object.toString() + "\n");
}&lt;/PRE&gt;&lt;P&gt;though Ive also tried:&lt;/P&gt;&lt;PRE&gt;for (int i = 0; i &amp;lt; returnList.size(); i++) {
	System.out.println(returnList.get(i));
}&lt;/PRE&gt;&lt;P&gt;Im sure making some basic mistake - does anyone see what it is?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 21:13:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4004222#M3277</guid>
      <dc:creator>Keith Abbott</dc:creator>
      <dc:date>2019-12-27T21:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Some basic AXL sql questions</title>
      <link>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4006812#M3279</link>
      <description>&lt;P&gt;I don't know it you read the documentation and know how AXL is working.&lt;/P&gt;&lt;P&gt;If you call ExecuteSQLQueryReq there will be a SOAP Requst processed by the AXL Api.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you create a SOAP yourself it is the same.&lt;/P&gt;&lt;P&gt;As Java can handle SOAP Requests and Responses it should work fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 08:33:28 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4006812#M3279</guid>
      <dc:creator>thedd</dc:creator>
      <dc:date>2020-01-06T08:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Some basic AXL sql questions</title>
      <link>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4006814#M3280</link>
      <description>&lt;P&gt;Regardind your qestion:&lt;BR /&gt;Is Java a good choice over, say C++ or PHP - especially when looking for ease-of-learning?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well that depends on your coding experience.&lt;/P&gt;&lt;P&gt;Did you ever use Java, C++, C#, php, perl, python?&lt;/P&gt;&lt;P&gt;Are you familiar with any of these languages?&lt;BR /&gt;&lt;BR /&gt;If not you could nearly start with any of these.&lt;/P&gt;&lt;P&gt;In my opinion coding with eclipse is harder and more complex then other IDEs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as i see not AXL is your main problem it it SOAP Handling within the chosen language.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to test you SQL you can just do it on the CUCM CLI by using the command run sql and your query.&lt;/P&gt;&lt;P&gt;Then you will see if there is anything returned.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 08:39:14 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4006814#M3280</guid>
      <dc:creator>thedd</dc:creator>
      <dc:date>2020-01-06T08:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Some basic AXL sql questions</title>
      <link>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4006959#M3283</link>
      <description>Thanks Thedd, I do not have experience in any of those languages - mostly VB and some older languages. Because of the difficulty in finding help with the Java/AXL combo, Ive just switched to Python: I found someone familiar with that pairing, that can provide some assistance. I started with NetBeans IDE, and Eclipse seems easier than does NetBeans - tho it may just be because started gaining some familiarity with IDEs. I did test the SQL query with pub command line, and that is fine. And the AXL log shows that its being delivered to the AXL service correctly - I think the SQL is being correctly executed - I think the issue is in the way Im trying to grab and process the response. thanks</description>
      <pubDate>Mon, 06 Jan 2020 13:30:52 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4006959#M3283</guid>
      <dc:creator>Keith Abbott</dc:creator>
      <dc:date>2020-01-06T13:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Some basic AXL sql questions</title>
      <link>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4007030#M3285</link>
      <description>&lt;P&gt;There are a couple of sample AXL+Java apps in this repo that might be helpful: &lt;A href="https://developer.cisco.com/codeexchange/github/repo/CiscoDevNet/axl-java-samples" target="_blank"&gt;https://developer.cisco.com/codeexchange/github/repo/CiscoDevNet/axl-java-samples&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In DevNet we tend to use AXL+Python with Zeep for building samples and demos - if you don't have a strong language preference, you might lean that way..&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 15:39:20 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4007030#M3285</guid>
      <dc:creator>dstaudt</dc:creator>
      <dc:date>2020-01-06T15:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Some basic AXL sql questions</title>
      <link>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4024852#M3305</link>
      <description>&lt;P&gt;did you solve your issue?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 11:07:55 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4024852#M3305</guid>
      <dc:creator>thedd</dc:creator>
      <dc:date>2020-02-06T11:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Some basic AXL sql questions</title>
      <link>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4024933#M3306</link>
      <description>&lt;P&gt;Hi Thedd, I have not yet resolved my issue - unfortunately other demands have kept me away from the project but I hope to resume soon - I have switched to python and zeep, as was suggested by dstaut and a good guy from our vendor staff. It seems to be a little easier to work with than was Java. But I dont know how it will work out overall yet. I just kept hitting roadblocks with the java returns. Hopefully I can start back on the project tonight or tomorrow - at which juncture Im sure you'll hear me whining! thx&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 13:38:55 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/some-basic-axl-sql-questions/m-p/4024933#M3306</guid>
      <dc:creator>Keith Abbott</dc:creator>
      <dc:date>2020-02-06T13:38:55Z</dc:date>
    </item>
  </channel>
</rss>

