You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Keith Hatton <kh...@axiomsystems.com> on 2004/01/02 17:44:06 UTC

RE: circular references

I don't know the details of the Axis implementation, but two things you might like to check are:

1. Make sure you are using multirefs (<parameter name="sendMultiRefs" value="true"/> in server-config.wsdd), otherwise I can't see a way this will ever work.

2. Make sure your User and Group objects properly implement (override) the equals() method so that Axis can recognise it is serializing the same object again.

Hope this helps
Keith


-----Original Message-----
From: Andrew Hawkes [mailto:hawkes@quy-su.org]
Sent: 26 December 2003 07:44
To: axis-user@ws.apache.org
Subject: circular references


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


fault tolerant bean serializer

Posted by Karl Baum <kb...@tallan.com>.

When using the bean serializer, I have noticed that when there is an
extra field on the SOAP XML object which is not present on the client
side bean, a fatal SAXParser exception is thrown and the service fails.
Is it possible to make the bean serailizer and bean deserializer fault
tolerant.  

A good example of a fault tolerant XML Serializer is the XMLEncoder and
XMLDecoder which comes with java 1.4  The java doc states the following:
	
"Fault tolerant: Non-structural errors in the file, caused either by
damage to the file or by API changes made to classes in an archive
remain localized so that a reader can report the error and continue to
load the parts of the document which were not affected by the error."

Is this behaviour easily possible with the axis bean serializers?

Thanks.

Karl