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 Apache axis arraylist problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Apache axis arraylist problem" Watch "Apache axis arraylist problem" New topic
Author

Apache axis arraylist problem

Ashok C. Mohan
Ranch Hand

Joined: Dec 03, 2003
Posts: 75
I have a web service which exposes a method which takes an object as an argument. This object contains 2 custom arraylists. I populate the arraylists with custom objects manually before invoking the web service. But they become empty when they reach the web service.
I don't get any serialization errors in the (jboss) console or logs. What could be the problem?


SCJP 1.4
Do not dwell in the past, do not dream of the future, concentrate the mind on the present moment.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
If this was my problem I would define the service in terms of arrays, not ArrayList objects - there are convenient conversions from and to arrays in the Collections API.

If you still want to continue with arrays, the next thing to do would be to capture the full text of the request with something like TCPMON - in your Axis toolkit. People are often surprised when they see what is actually being sent.

Bill


Java Resources at www.wbrogden.com
Ashok C. Mohan
Ranch Hand

Joined: Dec 03, 2003
Posts: 75
I might have mislead you by making my question sound very simple. I apologize for it. My problem is not with a simple scenario with an object and 2 arraylists. What I am trying to do is pass to the webservice a complex data structure which contains multiple arraylists with custom objects which in turn contain arraylists and other objects.
I am afraid that I cannot change to arrays as the webservice works with these custom objects and arraylist. Conversion to arrays would be very painful and complex.
If you still want to continue with arrays

I assume you meant
If you still want to continue with arraylists

I will try capturing the full text of the request with TCPMON. In the meantime if you happen to have any other suggestions you are most welcome. I am really stuck and I would be greatful for any lead.
Ashok C. Mohan
Ranch Hand

Joined: Dec 03, 2003
Posts: 75
This is the full text of the request with TCPMON


I am new to axis and SOAP. Anyone who can read this xml, please help

[ December 04, 2006: Message edited by: Ashok C.M. ]

[ December 04, 2006: Message edited by: Ashok C.M. ]
[ December 04, 2006: Message edited by: Ashok C.M. ]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5

Etc..
Looks like your custom objects are not getting encoded at all or contain no data.
Bill
[ December 04, 2006: Message edited by: William Brogden ]
Ashok C. Mohan
Ranch Hand

Joined: Dec 03, 2003
Posts: 75
I use custom lists (extends ArrayList) could that be the problem? There are no attributes specified in my custom list. Could the webservice be just scanning for attributes and finds none, so marks it as empty?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
Could the webservice be just scanning for attributes and finds none, so marks it as empty?


As far as I can see, right now what your client is sending is nothing like the complex object you say the web service needs. If you don't see something recognizable as your data in the SOAP request, then something is wrong on the client side encoding.

How did you use your custom object code to create a SOAP client?

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Apache axis arraylist problem
 
Similar Threads
WS for existing application
Extending DataModel
publish a Servlet as an SOA implementation?
Webservice return type
ClassCastException