Since I really didn't have any luck returning Lists or arrays, I decided
to return
a simple POJO class in my POJO web service. The class that I am trying
to return
is defined on both the service and client side as:
public class QueryResultSet {
private List<Object> columnNames;
private List<Object> resultSet;
public QueryResultSet() {
}
public List<Object> getColumnNames() {
return columnNames;
}
public void setColumnNames(List<Object> columnNames) {
this.columnNames = columnNames;
}
public List<Object> getResultSet() {
return resultSet;
}
public void setResultSet(List<Object> results) {
this.resultSet = results;
}
}
On the client side, I call the service as:
Class[] queryReturnTypes = new Class[] { QueryResultSet.class };
try {
Object[] queryResponse =
serviceClient.invokeBlocking(queryQName,
queryArgs, queryReturnTypes);
QueryResultSet rs = (QueryResultSet) queryResponse[0];
List<Object> colNames = rs.getColumnNames();
List<Object> queryRows = rs.getResultSet();
for (int i=0; i<colNames.size(); i++) {
log.info("Response from 'query' operation: column name
"+colNames.get(i).toString());
}
The log statement produces:
2011-08-03 16:47:53,059 [main ] INFO
SadlMain - Response from 'query' operation: column
name <ax25:columnNames
xmlns:ax25="http://provider.axis.sadlserver.sadl.research.ge.com/xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string">cw</ax25:columnNames>
I was expecting that by specifying the correct return type that the
invokeBlocking call would "unwrap" the
QueryResultSet class in queryResponse[0] and just get cw. Obviously,
being a newbie, this isn't quite right.
Any ideas?
Thanks
Barry Hathaway
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org
For additional commands, e-mail: java-user-h...@axis.apache.org