I have a webservice in which I am trying to return a List back to my client and am getting "qname not found message". I have temporarily resolved this by changing my List to Object[] and casting the object I want to return to an array. However I would like to use the List if possible here is my sample code:
public List nonPOAProcess() throws org.apache.axis2.AxisFault {
List suspendList = new ArrayList();
try {
popper = defineNonPOAPopStructure();
popper.setWaitSeconds(-1);
if (popper.pop()) {
String orderNumber = popper.getPopulatedDataQueueEntry().getField("ORDERNUM").toString();
suspendList = POSHIManager.getManager().getSuspendInfo(orderNumber);
}
} catch (Exception e) {
throw new org.apache.axis2.AxisFault(e.getMessage());
}
return suspendList;
}
Are you sure that you can
epp Did I mention that I
Same problem
help please
I want to send from axis to a client many same objects. I try to return them as an array as you say but tomcat hits an error saying there was an error trying to invoke method getLocation. Can you post your whole code. Mine is the following:
This is the client code:
package gr.ntua.netmode.rpcclient;
import javax.xml.namespace.QName;
import java.util.List;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client
import org.apache.log4j.Logger;
import gr.ntua.netmode.myPaper.*;
public class topologyRPCClient {
private static Logger log =Logger.getLogger(topologyRPCClient.class);
public static void main(String[] args1) throws AxisFault {
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new EndpointReference("http://localhost:8080/axis2
options.setTo(targetEPR);
QName opGetNode =new QName(" http://service.netmode.ntua.gr
log.debug(opGetNode);
Object[] opGetNodeArgs = new Object[] { };
Class[] returnTypes = new Class[] { List.class };
Object[] response = serviceClient.invokeBlocking (opGetNode, opGetNodeArgs, returnTypes);
List result = (List) response[0];
Location k=(Location) result.get(1);
System.out.println(k.getCity());
}
}
}
and this is the service code:
public List getLocation(Integer id) throws Exception {
List <Location> n=null;
Location x=null;
String y=null;
Transaction tx = null;
SessionFactory sessionFactory = new Configuration().configure()
Session session =sessionFactory.openSession();
System.err.println(session.isConnected());
System.err.println(session.isOpen());
try {
tx = session.beginTransaction();
System.err.println(tx.isActive());
n= session.createQuery("from Location as location").list();
x=n.get(2);
y=x.getName();
log.debug(n);
tx.commit();
System.out.println(n);
System.out.println();
System.out.println(y);
System.out.println(x.getCountry());
System.out.println(x.getAltitude());
System.out.println(x.getEmail_address());
System.out.println ();
}
catch (HibernateException e) {
e.printStackTrace();
if (tx != null && tx.isActive())
tx.rollback();
}
return n;
}
Try the following
Try this
How to return an ArrayList object from web service
I had same problem and found the solution