axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anand Natrajan <a...@cs.virginia.edu>
Subject Re: Object lists in axis
Date Wed, 13 Oct 2004 17:30:55 GMT
Suzy,

It's possible, legitimate and reasonable to return arrays of complex objects
using SOAP. In other words, your Java objects should have fields that are
simple types, e.g., String, int, boolean, etc. Your method should return an
array of this type of object (not ArrayList). Doing so will make your SOAP
response palatable to any reasonable language used by the client. You
shouldn't require a separate method that returns an array of the fields -
that's kludgy because it requires the client to line up the fields and
reconstruct the desired objects.

BTW, one correction. Above, I said the object must have simple types as
members - we can relax that a bit. It's okay for the object to have other
complex types in turn as members as long as those complex types eventually
resolve to a collection of simple types. It's when you have members that are
ArrayList or HashMap or some such Java-specific type that you start running
into compatibility issues.

Anand

On Wed, 13 Oct 2004, Suzy Fynes wrote:

: Hey,
:
: Have a question, I have an object containing loads of information on a
: person e.g name, phone number, address etc I want to send someone a list
: of these people using axis. I store the list in an ArrayList containing
: objects of each person. Seen as ArrayLists are just for java its not
: good for a web service, so I created an array of objects. Now
: considering it has to be generic the objects can only be Strings,
: Integers etc
:
: So my question is how can I return more than one piece of information
: using only Data type objects? Currently all web services ive deployed
: only use access one method, could I have say 5 methods all returning
: different information of the person. Ie. one method returns all the
: names, second one returns all phone numbers etc
:
: Any help would be great!
: Thanks,
: Sue
:
:

Mime
View raw message