[jboss-user] [JBoss Web Services] New message: "How can i make my web service method to return an array of objects"

Erick Jeronimo Diaz do-not-reply at jboss.com
Mon Mar 15 13:13:12 EDT 2010


User development,

A new message was posted in the thread "How can i make my web service method to return an array of objects":

http://community.jboss.org/message/532066#532066

Author  : Erick Jeronimo Diaz
Profile : http://community.jboss.org/people/erickjd

Message:
--------------------------------------------------------------
i'm using jbossws tools to generate my  client classes and it works fine. I use slsb with @webservice and  @webmethod annotations. I'm trying to make a method which returns an  array of a Persons objects array: 
* 
@WebService 
@Stateless 
public class CargosBean implements Cargos, Serializable { 
 
.... 
   @WebMethod 
   public Object[] getPersonArray() { 
       Query query = null; 
       Object[] cargoArray = null; 
              query = em.createQuery("Select c from Tbcargos c"); 
       List<Tbcargos> allCargos = query.getResultList(); 
              for (int i=0; i < allCargos.size(); i++) { 
           cargoArray[i] = allCargos.get(i); 
       } 
       return cargoArray; 
 
   } 
... 
 
}* 
 
but it does't works..... 
 
Could you please help me. 
 

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/532066#532066




More information about the jboss-user mailing list