File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Problem returning a collection from web service Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "Problem returning a collection from web service" Watch "Problem returning a collection from web service" New topic
Author

Problem returning a collection from web service

Jaydeep Deshmukh
Ranch Hand

Joined: Sep 10, 2002
Posts: 31
Hi all,

I am having problems returning a collection like arraylist from a weblogic java webservice to the client. How can I achieve this?

Thanks in Advance
Jaydeep
Harish Madhavan
Greenhorn

Joined: Dec 10, 2003
Posts: 17
Can you please be more in detail ? Are you thrown out by exception.Post the trace.

Harish
Tim West
Ranch Hand

Joined: Mar 15, 2004
Posts: 539
What you can do also depends on your WS toolkit.

In general it's much easier to return a Java array (i.e., a MyCustomClass[]) than an ArrayList, since an ArrayList could contain objects of any type.*

I can't help more than this - in Weblogic 8.1, I achieve a similar effect by writing the WSDL and schema first, then generating the Java interface/stubs from these. The Weblogic tools generate methods containing Java arrays rather than ArrayLists.


-Tim

* That is, until Java 5. I've never used Web services with Java 5, so YMMV.
[ August 17, 2005: Message edited by: Tim West ]
Jaydeep Deshmukh
Ranch Hand

Joined: Sep 10, 2002
Posts: 31
Thanks for your help Tim. I used the Java array and it worked fine.
 
 
subject: Problem returning a collection from web service
 
Threads others viewed
should a method return null anytime?
html:iterator troubles
java.rmi.MarshalException
adding new field to a SOAP Object without having to change client side
Accessing CMR collection from servlet
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture