Hi Glen,

Thanks for the reference. I remember you gave this reference when I first
asked the question a couple of weeks ago. When I looked at the Apache SOAP
source code I found it wasn't hard to change it to do what's described below.

I thought I had an easy solution when I came up with the cycle detection &
href / id idea and implemented it in the Apache code. But now that I'm facing
having to move all the object serialization definitions outside the root
block, this would require more significant changes to the Apache SOAP source
code. At this point it unclear whether the work involved in changing my
implementation of cyclical references, is more or less than that needed to
install & learn a new SOAP implementation, rewrite the proxy objects, and redo
documentation.

I lean toward the DIY side of things and I already have a lot of inertia in
the Apache SOAP direction so I will pursuing that for at least a few days to
see what I can come up with. I'll keep the Axis stuff as a good plan "B". In
the end I might end up supporting both (Axis & Apache SOAP) but my current
mission is to get these cycles working ASAP.

Thanks,

-----Original Message-----
From: Glen Daniels [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 20, 2001 20:51
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: XML parser & cyclical reference question


Hi Simon, Michael:

There are many SOAP implementations out there which will automatically
marshal cyclic language structures into XML like that you suggest.

Axis (http://xml.apache.org/axis) does this kind of serialization by
default.

--Glen

----- Original Message -----
From: "Simon Fell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, September 20, 2001 11:17 PM
Subject: Re: XML parser & cyclical reference question


yes, that's legal. i don't see any problem with href's refering to
themselves [either directly or indirectly].

Issues to do with handling multi-ref's has been discussed on the
soapbuilders mailing list a number of times
http://groups.yahoo.com/group/soapbuilders/

Cheers
Simon

On Thu, 20 Sep 2001 19:59:37 -0700, in soap you wrote:

>Yes, you hit the nail right on the head. The second example is exactly what
>I'm doing. And sometimes it works  =)
>
>If it's true that this is illegal, then it would seem impossible to
serialize
>a cyclical reference. . . unless. . . what about the following example:
>
><s:Envelope>
><s:Body>
><m:doSomething>
><p1 href="#b" />
><p2 href="#b" />
></m:doSomething>
><b id="b">
>    <c href="#b" />
></b>
></s:Body>
></e:Envelope>
>
>If this is legal, then the best approach might be to serialize everything
>inside the root (parameters and return values) as an href. Then serialize
the
>actual data outside.
>
>But this will work only if the serialized data outside the root, can use
hrefs
>that refer to itself.
>
>Will that work? Do you know a good reference that discusses these issues?
>
>Thanks a bunch,
>
>-----Original Message-----
>From: Simon Fell [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, September 20, 2001 18:22
>To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>Subject: Re: XML parser & cyclical reference question
>
>
>Independent elements in SOAP [the one's that have id's] need to be
>serialized outside of the main serialization root, e.g. they can not
>be inlined, e.g.
>
><s:Envelope>
><s:Body>
><m:doSomething>
><p1 href="#b" />
><p2 href="#b" />
></m:doSomething>
><b id="b">5</b>
></s:Body>
></e:Envelope>
>
>is correct, whilst this is not,
>
><s:Envelope>
><s:Body>
><m:doSomething>
><p1 id="b">5</p1>
><p2 href="#b" />
></m:doSomething>
></s:Body>
></e:Envelope>
>
>from your description it sounds like you are generating the bottom
>example.
>
>Cheers
>Simon
>
>On Thu, 20 Sep 2001 15:29:23 -0700, in soap you wrote:
>
>>Hi all,
>>
>>My Apache SOAP v 2.2 is installed & working with Jetty 3.0.6. I'm trying
to
>get data structures with cyclical references to marshal correctly. I've
>modified the Apache SOAP source code to do this as follows:
>>
>>1. Every XML data item has a unique ID for it, whether or not this is
needed.
>>2. BeanSerializer detects duplicate objects or cycles, and in either case
>generates an HREF XML tag to refer to the original item, instead of
>serializing the item again.
>>
>>The XML it generates appears to always be valid, and sometimes it works.
When
>it does not work, the process that is unmarshalling the data (sometimes the
>client, sometimes the server) complains that the XML HREF reference refers
to
>an ID tag that is "not defined" -- despite the fact that this tag is always
>defined somewhere in the XML message.
>>
>>In other words, the unmarshaller sometimes matches the HREF to the ID and
>successfully generates the objects. But other times, the unmarshaller
>complains that it can't find the item to which the HREF refers (even though
it
>does exist in the XML message).
>>
>>In every case, I can look at the XML and see that the HREF tag always has
a
>matching ID tag, even when the parser says it couldn't be found.
>>
>>I'm wondering if there is some kind of namespace issue that might prevent
the
>HREF tags from matching back to the ID tags to which they refer. In other
>words, even though the HREF string is unique and exactly matches the ID
>string, some kind of namespace issue prevents the parser from matching them
>up.
>>
>>This is probably a simple XML issue but I'm kinda new to XML so if anyone
can
>help point me in the right direction regarding HREF and ID, I would
appreciate
>it.
>>
>>Thanks,
>>
>>Michael R. Clements
>>[EMAIL PROTECTED]
>>Some find truth in beauty, others find beauty in truth.
>



Reply via email to