axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ranjiith Selvarajan <>
Subject Problem in returning an array in a container
Date Tue, 12 Jul 2005 09:00:40 GMT

As my subject line says I'm facing a problem when I
try to send an array in a container with Axis 1.2.1.
Here are the steps I followed.

The service at the server side returns the following
(getUsers method in the service class returns

	User[] users;

I have defined an arrayMapping for 'User[]',
beanMapping for 'User' and beanMapping for

I generate WSDL using (Java2WSDL) and client side java
files using (WSDL2Java).
As I run the client side code it failed with
ArrayStoreException with a message cannot convert to
bean etc.
(some serialization issue)

After going thru some forum discussions I added the
following (indexed) to the 'UserCollection' object.


	User[] users;

	setUsers(int i, User user)
		users[i] = user;

	getUsers(int i)
		return users[i];
And things started working fine as expected. I was
able to use the webservice (got the list of users).

But the *ServiceSoapBindingImpl that got generated at
the client side had return as 'User[]' and not
'UserCollection' as defined at the server side.
I would like to know why is this and what needs to be
corrected for the above to return 'UserCollection' ?
(getUsers returned User[] instead of UserCollection.)

Being a newbie I tried the options (-u LITERAL and -y
WRAPPED) to figure out what difference it makes and if
it can help in the current scenario but it did not.

Looking forward for a response.

ranjiith s

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

View raw message