Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Apache axis arraylist problem

 
Ashok C. Mohan
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ashok C. Mohan
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic