• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is it possible to retrive multiple objects at one time ?

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For example, i have a getUsersOnline() method on a WebService that returns the users online at that time. The User object (and xml schema) will contain the name, age and location of each user.

So, can i retreive more than one User object ? Like an array of users ? Maybe 1 user, maybe 3, maybe 10.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Yes, of course you can retrieve many Users.
If you do Java-first development and the return type of a method in the endpoint implementation class is String[], then the following XML complex type will be generated:

If you do WSDL-first development, then use the maxOccurs attribute, as seen above, to define an array of some type.
Best wishes!
 
Alex Parvan
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great ! Thanks, i'll post here again if i'm having trouble, please check it again tomorrow or so :P
 
Alex Parvan
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It works, if anyone else needs this, my xsd looks like this:



And then you can use it in Java like this:



Thank you Ivan.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic