This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Web Services and the fly likes Returning an array with different classes inside Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Returning an array with different classes inside" Watch "Returning an array with different classes inside" New topic

Returning an array with different classes inside

Peter Merker
Ranch Hand

Joined: Oct 18, 2003
Posts: 37

I have a method which is returning an array of type BaseClass. Inside are objects of different SubClasses. The SOAP message generated by Axis 1.3 treats the objects in the array as if they were all of type BaseClass, but I need the attributes from the SubClasses, which are really inside the array.
Is there a way to do this somehow, either with Axis 1.3, another version, or another Web Services Library?
If this is not implemented yet, is it possible to fix the Axis code? In this case, where could this be done?

Thanks in advance for your help.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13006
I think you are trying to push SOAP well beyond what it is designed for. You should try to come up with a way to transfer the information using standard SOAP concepts.

For example can you reduce the specialized class attributes to a Map?

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Returning an array with different classes inside
jQuery in Action, 3rd edition