Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Returning Arraylist

 
Girish Solanke
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have created web service which return me a ArrayList,
but in interface for that service which is automatically generated from WSDL2java, shows me a return type as array of Object.

why it is so happening ?
what is the solution for same ?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a mistake to define your service as returning an ArrayList - instead return an array of the desired type. The method for creating an array from an ArrayList is very easy to use. If the client side really needs the functionality of an ArrayList (which I strongly doubt) it is easy to create one from the array.

Web services are supposed to be insulated from the underlying details of operating systems and languages.

Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!