• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Returning Arraylist

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic