• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do I return a ArrayList over SOAP?

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

I would like to be able to return a ArrayList over SOAP.
Not a Array (Object[]).
I use Axis2.

Correct me if I'm wrong when I say that to be able to do this I need to use some products like JiBX or XMLBeans?
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this older thread has a nice discussion on perhaps why you want to actually stick with Object[] as opposed to ArrayList. Hope that helps!
 
Fredrik Andersson
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

Thanks for your reply!

I have done som thinking and discuss this issue.

I have came to the conclusion that it is likely a better idea to return a Object[], then a ArrayList.

Assume that the client suddenly is a .NET or PHP, then it most likely will have trouble to create an instance of this java.util.ArrayList.

Correct me if I'm wrong!!

Best regards
Fredrik
 
Martijn Verburg
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are indeed correct! Web services by their nature need to work with data constructs that are recognizable/convertible across 'all' languages.
[ October 07, 2008: Message edited by: Martijn Verburg ]
 
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
Why would you want the client to get an ArrayList?

I doubt the client is going to do anything with the data besides iterate through the array, but if they need an extensible collection, it is quick to make one given an array in any language.

Bill
 
Fredrik Andersson
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

The idea I was working on was to port a rmi-technic for a app that for eg had a method like:

public ArrayList getMyList()....

...to a implementation with a webservice-technic instead.

But I guess you agree with me, as I mentioned above, that it is a bad idea.

Best regards
Fredrik
 
Fredrik Andersson
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry wrong post!

[ October 13, 2008: Message edited by: Fredrik Andersson ]
[ October 13, 2008: Message edited by: Fredrik Andersson ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic