cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1469
Views
0
Helpful
3
Replies

ExecuteSQL returning row:null with JAX-WS

chhartle
Cisco Employee
Cisco Employee

Hi,

I am trying to use JAX-WS based on the demo app at the below URL. When i try to modify it to do an ExecuteSQL the return gives me list but row = null for each instance. Using Eclipse debug i can see the information under the ArrayList but it seems the .getRow() is not returning the value.

Can anyone point me to how i can get the actual value returned?

Create an AXL Java Client using JAX-WS

https://developer.cisco.com/site/axl/learn/how-to/axl-java-sample-application.gsp

String sSQLQuery = "select processnodeservice.servername from processnodeservice,typeservice where processnodeservice.tkservice = typeservice.enum and typeservice.processname='ctftp'";

               

                ExecuteSQLQueryReq axlParams = new ExecuteSQLQueryReq();

                axlParams.setSql(sSQLQuery);

                try{

                ExecuteSQLQueryRes getSQLResponse = axlPort.executeSQLQuery(axlParams);

                List<Object> vServerList = getSQLResponse.getReturn().getRow();

                List<String> strings = new ArrayList<String>();

                for (Object object : vServerList) {

                    textArea_Log.insert(object.toString() + "\n",0);

          }

I get returned [row: null] for every record returned.

Regards

Chris

1 Accepted Solution

Accepted Solutions

npetrele
Cisco Employee
Cisco Employee

This code only returns the first row, but perhaps it will help you understand how the API works...

String ucCritString = "select processnodeservice.servername from processnodeservice,typeservice where processnodeservice.tkservice = typeservice.enum and typeservice.processname='ctftp'";
sqlReq.setSql(ucCritString);

try {
List<Object> returnList = new ArrayList<Object>();
ExecuteSQLQueryRes getResponse = axlPort.executeSQLQuery(sqlReq);
returnList = getResponse.getReturn().getRow();
ElementNSImpl rowElement = (ElementNSImpl) returnList.get(0);
servername = rowElement.getElementsByTagName("servername").item(0).getFirstChild().getTextContent();
System.out.println(servername);
} catch (AXLError e) {
System.out.println("An AXLError occurred: " + e.getFaultInfo());
}

View solution in original post

3 Replies 3

npetrele
Cisco Employee
Cisco Employee

This code only returns the first row, but perhaps it will help you understand how the API works...

String ucCritString = "select processnodeservice.servername from processnodeservice,typeservice where processnodeservice.tkservice = typeservice.enum and typeservice.processname='ctftp'";
sqlReq.setSql(ucCritString);

try {
List<Object> returnList = new ArrayList<Object>();
ExecuteSQLQueryRes getResponse = axlPort.executeSQLQuery(sqlReq);
returnList = getResponse.getReturn().getRow();
ElementNSImpl rowElement = (ElementNSImpl) returnList.get(0);
servername = rowElement.getElementsByTagName("servername").item(0).getFirstChild().getTextContent();
System.out.println(servername);
} catch (AXLError e) {
System.out.println("An AXLError occurred: " + e.getFaultInfo());
}

Nice!

Perfect. Although i ended up using Element instead of ElementNSImpl