axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert van Engelen <>
Subject Re: circular references
Date Mon, 29 Dec 2003 00:59:29 GMT


There are SOAP toolkits that can handle cycles automatically.

Try gSOAP (for C/C++) for example, it handles cycles intelligently and 
does not waste space (producing id-refs only when necessary).

- Robert

On Friday, December 26, 2003, at 11:28 AM, Chandrasegaram Jeyakumaran 

> Hi,
> Yes(bit interested :) ), I agree with Aaron and the concept can be
> implemented in a handler(so it is a serialization part) and we can 
> call it
> whenever the recursion is occured(provided that developer should be
> capable of prediction the circular references).]
> regards,
> Jeyakumaran
>> I can't answer for Axis, but this is one of the problems with XML 
>> being
>> a unidirectional tree.  The only way to do this in XML (that I am 
>> aware
>> of) is use 'id' attributes and then refer to those id attributes in
>> subsequent tags (you'll note this problem is similar in
>> object-relational mapping).  You could have either User or Group 
>> object
>> (or both) not contain references to each other but merely unique ids 
>> to
>> the respective object...or implement custom serializers to perform 
>> this
>> under the covers.
>> Aaron
>> Andrew Hawkes wrote:
>>> I'm having a problem with circular references during serialization.
>>> For example, say I have two types: User and Group. User has a
>>> getGroup() method, and Group has a getUsers() method which returns an
>>> array of users.
>>> Since this basically amounts to a circular reference, Axis goes into
>>> infinite recursion when it tries to serialize the response, and 
>>> simply
>>>  hangs forever spitting out huge log messages.
>>> It seems like SOAP should have a more intelligent way to handle this.
>>> Is there a known solution, other than removing the circular reference
>>> from my objects?
>>> Thanks,
>>> Andrew
> Lanka Software Foundation
> Promoting opensource in Srilanka

View raw message