1 Reply Latest reply on Jul 26, 2006 10:33 AM by heiko.braun

    How to return an array of class ?

    ericmacau

      Hello,

      how can I return an array of object in web service?
      Please look at the following example, if I want to return a set of User, what SoapBinding should I use?

      If I use RPC, it seems not work.

      Please help?


      for example:

      class User {
       String name;
       int age;
       Date birth;
       ...
       ...
      }
      
      
      @WebService(name = "UserInterface", targetNamespace = "http://mytest.mywebservice.com", serviceName = "UserService ")
      @SOAPBinding( ..... )
      @Stateless
      @Remote(UserServiceRemote.class)
      @RemoteBinding(jndiBinding = "UserServiceBean/remote")
      public class UserService implements UserRemote {
       public User[] getUsers() {
      
       .....
       }
      
      }