File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it possible to retrive multiple objects at one time ?

 
Alex Parvan
Ranch Hand
Posts: 115
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic