This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Web Services and the fly likes returning a 2-d array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "returning a 2-d array" Watch "returning a 2-d array" New topic

returning a 2-d array

archit thakur

Joined: Jul 10, 2010
Posts: 24
can a 2-d array be returned from the method of end point implementation class generated using annotations?
if not, what is the solution to the problem?
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
With the following method in the endpoint implementation class:

If we then look at the generated WSDL, there is the following type declared for the reply of the above method:

The stringArray type is type predefined by JAXB that appears in a separate XML schema:

Thus the data returned from the method will be a list of stringArray-s.
Best wishes!

My free books and tutorials:
archit thakur

Joined: Jul 10, 2010
Posts: 24
thank you, but is it also applicable if i have to return any other datatype array
It is sorta covered in the JavaRanch Style Guide.
subject: returning a 2-d array
It's not a secret anymore!