John, Read the "Array of Objects in Axis and .NET interop" thread. It sums it up quite well. In my postings there, I pointed out one of the causes this doesn't work in detail. So far there's no response by the developers, unfortunately.
We found however, that it works using RPC/encoded (Thanks for the tip, Tami ;). That's not the favorable way of doing it, but could suffice as an interim solution, until wrapped works as expected. I guess 1.2RC2 is about to be released, so I'll test using the new RC, since they apparently had a few array-related bugs pointed out and possibly solved. Hope dies last... ;) It RC2 doesn't solve the issue, all I can do is file a bug report, for I assume I won't be granted the time from my descision makers to dig in an offer a patch myself, unfortunately. So long, Flexx -----Original Message----- From: Dennis Sosnoski *EXTERN* [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 5:00 AM To: [EMAIL PROTECTED] Subject: Re: does anyone have complex serialization working? Hi John, Yes, it is perfectly possible to handle arrays of beans with references to other beans, and similar structures. For some examples of code that does this, download the Axis samples from my comparison of SOAP performance at http://www.sosnoski.com/presents/cleansoap/comparing.html This also has a sample of using Castor for the same thing with Axis. As for Nathan's framework, this sort of thing can certainly be done but it's a lot of work and not very good from a performance standpoint. JDK 1.4 and later comes with XMLEncoder and XMLDecoder that do basically this type of XML serialization (though with XMLEncoder/XMLDecoder the format is fixed and not very interoperable with non-Java applications). - Dennis -- Dennis M. Sosnoski Enterprise Java, XML, and Web Services Training and Consulting http://www.sosnoski.com Redmond, WA 425.885.7197 John Menke wrote: >Thanks Nathan, so basically Axis can't do it. That's why nobody has >responded. The docs seem to indicate it can be done...so much for the docs. >I don't have the resources to code a framework at the moment. There was an >article i saw on using Castor and Axis maybe i can do that. > >-jm > >-----Original Message----- >From: Nathan Wardle [mailto:[EMAIL PROTECTED] >Sent: Sunday, November 14, 2004 7:31 PM >To: [EMAIL PROTECTED] >Subject: RE: does anyone have complex serialization working? > > >We've actually ended up writing our own serialiser and deserialiser based on >a reflection excerpt from Better, Faster, Lighter Java by Bruce Tate and >Justin Gehtland (pg 70 something). We combined this with the strategy >pattern (one class per type of strategy (ie ArrayStrategy, Map, Collection, >Bean, Primitive etc) with an isApplicable method which takes a class or >class name and a process method wich does the (de)serialisation for that >type of object). We added the ability to handle beans with references to >another bean by passing around a context map containing all objects that had >been (or were being) processed. We also added a type conversion function to >each strategy because we are passing message between .Net client and java >server. We then just passed the xml messages. > >It's a bit of work, but works well. > >Code is unavailable, sorry, but the resulting xml looks something like this: > ><item class=\"interop.array\" componentType=\"interop.object\" id=\"0\"> > <item class=\"interop.string-object\">My array</item> > <item class=\"interop.array\" itemClass=\"interop.string-object\" > id=\"1\"> > <item class=\"interop.string-object\">1</item> > <item class=\"interop.string-object\">2</item> > </item> > <item class=\"ObjectWithReferences\" id=\"2\"> > <referenceObject class=\"ObjectWithReferences\" refid=\"2\"/> > </item> ></item> > >for this object: > >Object[] arrayObject = new Object[]{"My array", new String[]{"1", "2"}, > new ObjectWithReferences()}; > >ObjectWithReferences test class: > >class ObjectWithReferences >{ > > private ObjectWithReferences referenceObject = this; > > public ObjectWithReferences() > { > > } > > /** > * @param object > * @return > * > * @see java.lang.Object#equals(java.lang.Object) > */ > public boolean equals(Object object) > { > if (!(object instanceof ObjectWithReferences)) return false; > ObjectWithReferences them = (ObjectWithReferences) object; > > return (them.getReferenceObject() == them) && (referenceObject > == this); > } > > /** > * @return > * > * @see java.lang.Object#hashCode() > */ > public int hashCode() > { > return super.hashCode(); > } > > /** > * @return Returns the object1. > */ > public ObjectWithReferences getReferenceObject() > { > return referenceObject; > } > > /** > * @param object1 > * The object1 to set. > */ > public void setReferenceObject(ObjectWithReferences referenceObject) > { > this.referenceObject = referenceObject; > } >} > > >-----Original Message----- >From: John Menke [mailto:[EMAIL PROTECTED] >Sent: Monday, 15 November 2004 11:06 AM >To: Axis >Subject: does anyone have complex serialization working? > > >Is it even possible to serialize an array of beans where the beans have >references to another bean? Nobody has been able to come up with a working >example. beanMapping is not working for me. I have posted several times >and nothing... i'm beginning to think it's not possible. > >-jm >