You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by "Michael R. Clements" <mr...@telocity.com> on 2001/09/21 00:29:23 UTC

XML parser & cyclical reference question

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
mrclem@telocity.com
Some find truth in beauty, others find beauty in truth.


RE: XML parser & cyclical reference question

Posted by "Michael R. Clements" <mr...@telocity.com>.
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:gdaniels@macromedia.com]
Sent: Thursday, September 20, 2001 20:51
To: soap-user@xml.apache.org; mrclem@telocity.com
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" <so...@zaks.demon.co.uk>
To: <so...@xml.apache.org>; <mr...@telocity.com>
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:soap@zaks.demon.co.uk]
>Sent: Thursday, September 20, 2001 18:22
>To: soap-user@xml.apache.org; mrclem@telocity.com
>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
>>mrclem@telocity.com
>>Some find truth in beauty, others find beauty in truth.
>




RE: XML parser & cyclical reference question

Posted by "Michael R. Clements" <mr...@telocity.com>.
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:gdaniels@macromedia.com]
Sent: Thursday, September 20, 2001 20:51
To: soap-user@xml.apache.org; mrclem@telocity.com
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" <so...@zaks.demon.co.uk>
To: <so...@xml.apache.org>; <mr...@telocity.com>
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:soap@zaks.demon.co.uk]
>Sent: Thursday, September 20, 2001 18:22
>To: soap-user@xml.apache.org; mrclem@telocity.com
>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
>>mrclem@telocity.com
>>Some find truth in beauty, others find beauty in truth.
>




Re: XML parser & cyclical reference question

Posted by Glen Daniels <gd...@macromedia.com>.
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" <so...@zaks.demon.co.uk>
To: <so...@xml.apache.org>; <mr...@telocity.com>
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:soap@zaks.demon.co.uk]
>Sent: Thursday, September 20, 2001 18:22
>To: soap-user@xml.apache.org; mrclem@telocity.com
>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
>>mrclem@telocity.com
>>Some find truth in beauty, others find beauty in truth.
>



Re: XML parser & cyclical reference question

Posted by Glen Daniels <gd...@macromedia.com>.
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" <so...@zaks.demon.co.uk>
To: <so...@xml.apache.org>; <mr...@telocity.com>
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:soap@zaks.demon.co.uk]
>Sent: Thursday, September 20, 2001 18:22
>To: soap-user@xml.apache.org; mrclem@telocity.com
>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
>>mrclem@telocity.com
>>Some find truth in beauty, others find beauty in truth.
>



RE: XML parser & cyclical reference question

Posted by "Michael R. Clements" <mr...@telocity.com>.
Interesting discussion on this back in July on the soapbuilders forum.

BTW, this raises another issue with nesting. Consider the following:

<s:Envelope>
<s:Body>
<m:doSomething>
<p1 href="#b" />
<p2 href="#b" />
</m:doSomething>
<b id="b">
    <c id="c">
        <d href="#c">
    </c>
</b>
</s:Body>
</e:Envelope>

This should be illegal because item "d" is referring to item "c", and the
latter is not defined at the root level!

Because of this nesting issue, supporting serialization of cycles is a bit
tricky. One must flag every block that is used from anywhere else, and ensure
that block appears at the root level. Is there some way to adorn the HREF tag
to force the XML parser to look for the referent in a specific location or
block?

All this silliness seems to be caused by the fact that the XML standard was
defined to make it easier to resolve references, by forcing them all to be at
the root level. It seems the universe would be a happier place if XML didn't
restrict the location of HREF referents. Of course, this happier universe
would need XML parsers that were smarter about where to find the referents but
it seems a small price to pay.

I'll have to try out the Axis SOAP implementation and look at the XML it
generates. I'm curious how it handles cycles. Does it detect nesting and break
them down accordingly? Or does it have some other solution? I'll know soon. .
.

-----Original Message-----
From: Simon Fell [mailto:soap@zaks.demon.co.uk]
Sent: Thursday, September 20, 2001 20:17
To: soap-user@xml.apache.org; mrclem@telocity.com
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:soap@zaks.demon.co.uk]
>Sent: Thursday, September 20, 2001 18:22
>To: soap-user@xml.apache.org; mrclem@telocity.com
>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
>>mrclem@telocity.com
>>Some find truth in beauty, others find beauty in truth.
>



RE: XML parser & cyclical reference question

Posted by "Michael R. Clements" <mr...@telocity.com>.
Interesting discussion on this back in July on the soapbuilders forum.

BTW, this raises another issue with nesting. Consider the following:

<s:Envelope>
<s:Body>
<m:doSomething>
<p1 href="#b" />
<p2 href="#b" />
</m:doSomething>
<b id="b">
    <c id="c">
        <d href="#c">
    </c>
</b>
</s:Body>
</e:Envelope>

This should be illegal because item "d" is referring to item "c", and the
latter is not defined at the root level!

Because of this nesting issue, supporting serialization of cycles is a bit
tricky. One must flag every block that is used from anywhere else, and ensure
that block appears at the root level. Is there some way to adorn the HREF tag
to force the XML parser to look for the referent in a specific location or
block?

All this silliness seems to be caused by the fact that the XML standard was
defined to make it easier to resolve references, by forcing them all to be at
the root level. It seems the universe would be a happier place if XML didn't
restrict the location of HREF referents. Of course, this happier universe
would need XML parsers that were smarter about where to find the referents but
it seems a small price to pay.

I'll have to try out the Axis SOAP implementation and look at the XML it
generates. I'm curious how it handles cycles. Does it detect nesting and break
them down accordingly? Or does it have some other solution? I'll know soon. .
.

-----Original Message-----
From: Simon Fell [mailto:soap@zaks.demon.co.uk]
Sent: Thursday, September 20, 2001 20:17
To: soap-user@xml.apache.org; mrclem@telocity.com
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:soap@zaks.demon.co.uk]
>Sent: Thursday, September 20, 2001 18:22
>To: soap-user@xml.apache.org; mrclem@telocity.com
>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
>>mrclem@telocity.com
>>Some find truth in beauty, others find beauty in truth.
>



Re: XML parser & cyclical reference question

Posted by Simon Fell <so...@zaks.demon.co.uk>.
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:soap@zaks.demon.co.uk]
>Sent: Thursday, September 20, 2001 18:22
>To: soap-user@xml.apache.org; mrclem@telocity.com
>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
>>mrclem@telocity.com
>>Some find truth in beauty, others find beauty in truth.
>


Re: XML parser & cyclical reference question

Posted by Simon Fell <so...@zaks.demon.co.uk>.
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:soap@zaks.demon.co.uk]
>Sent: Thursday, September 20, 2001 18:22
>To: soap-user@xml.apache.org; mrclem@telocity.com
>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
>>mrclem@telocity.com
>>Some find truth in beauty, others find beauty in truth.
>


RE: XML parser & cyclical reference question

Posted by "Michael R. Clements" <mr...@telocity.com>.
I've finished changing the Apache SOAP source code so it serializes the ID
referents outside the <method> wrapper as you suggested. Unfortunately, it
still doesn't work. It reports the same error -- that it can't find the
referent ID to which the HREF refers.

It's probably a simple error on my part, but I've read the SOAP spec until my
eyes are bugging out of my head, and their examples seem to be exactly what
I've generated. So I can't figure out why this isn't working.

Here is a sample XML message, a response the client received from the server.
The client could not resolve the "ActionalRef2" reference:

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
	<SOAP-ENV:Body>
		<ns1:getServiceInfoResponse xmlns:ns1="urn:acbManager"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
			<return id="ActionalRef1" xmlns:ns2="http://xml.apache.org/xml-soap"
xsi:type="ns2:Vector">
				<item href="#ActionalRef2"></item>
			</return>
		</ns1:getServiceInfoResponse>

		<item id="ActionalRef2" xsi:type="ns1:svcInfo"><pollInterval
id="ActionalRef3" xsi:type="xsd:int" xsi:null="true"/>
			<keyName id="ActionalRef8" xsi:type="xsd:string">test1</keyName>
			<keyID id="ActionalRef9" xsi:type="xsd:string">test1:manual</keyID>
			<hostServer href="#ActionalRef11"></hostServer>
			<adminServer href="#ActionalRef25"></adminServer>
		</item>
		<hostServer id="ActionalRef11" xsi:type="ns1:svrInfo"><contactInfo
id="ActionalRef12" xsi:type="xsd:string">Default contactInfo</contactInfo>
			<keyID id="ActionalRef18" xsi:type="xsd:string">clements</keyID>
			<keyName id="ActionalRef24" xsi:type="xsd:string">clements</keyName>
		</hostServer>
		<adminServer id="ActionalRef25" xsi:type="ns1:svrInfo"><contactInfo
id="ActionalRef26" xsi:type="xsd:string">Default contactInfo</contactInfo>
			<keyID id="ActionalRef32" xsi:type="xsd:string">clements</keyID>
			<keyName id="ActionalRef38" xsi:type="xsd:string">clements</keyName>
		</adminServer>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Can anyone tell what is wrong with this message? What am I missing?

Thanks,

-----Original Message-----
From: Michael R. Clements [mailto:mrclem@telocity.com]
Sent: Thursday, September 20, 2001 20:00
To: Simon Fell; soap-user@xml.apache.org
Subject: RE: XML parser & cyclical reference question


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:soap@zaks.demon.co.uk]
Sent: Thursday, September 20, 2001 18:22
To: soap-user@xml.apache.org; mrclem@telocity.com
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
>mrclem@telocity.com
>Some find truth in beauty, others find beauty in truth.




RE: XML parser & cyclical reference question

Posted by "Michael R. Clements" <mr...@telocity.com>.
I've finished changing the Apache SOAP source code so it serializes the ID
referents outside the <method> wrapper as you suggested. Unfortunately, it
still doesn't work. It reports the same error -- that it can't find the
referent ID to which the HREF refers.

It's probably a simple error on my part, but I've read the SOAP spec until my
eyes are bugging out of my head, and their examples seem to be exactly what
I've generated. So I can't figure out why this isn't working.

Here is a sample XML message, a response the client received from the server.
The client could not resolve the "ActionalRef2" reference:

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
	<SOAP-ENV:Body>
		<ns1:getServiceInfoResponse xmlns:ns1="urn:acbManager"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
			<return id="ActionalRef1" xmlns:ns2="http://xml.apache.org/xml-soap"
xsi:type="ns2:Vector">
				<item href="#ActionalRef2"></item>
			</return>
		</ns1:getServiceInfoResponse>

		<item id="ActionalRef2" xsi:type="ns1:svcInfo"><pollInterval
id="ActionalRef3" xsi:type="xsd:int" xsi:null="true"/>
			<keyName id="ActionalRef8" xsi:type="xsd:string">test1</keyName>
			<keyID id="ActionalRef9" xsi:type="xsd:string">test1:manual</keyID>
			<hostServer href="#ActionalRef11"></hostServer>
			<adminServer href="#ActionalRef25"></adminServer>
		</item>
		<hostServer id="ActionalRef11" xsi:type="ns1:svrInfo"><contactInfo
id="ActionalRef12" xsi:type="xsd:string">Default contactInfo</contactInfo>
			<keyID id="ActionalRef18" xsi:type="xsd:string">clements</keyID>
			<keyName id="ActionalRef24" xsi:type="xsd:string">clements</keyName>
		</hostServer>
		<adminServer id="ActionalRef25" xsi:type="ns1:svrInfo"><contactInfo
id="ActionalRef26" xsi:type="xsd:string">Default contactInfo</contactInfo>
			<keyID id="ActionalRef32" xsi:type="xsd:string">clements</keyID>
			<keyName id="ActionalRef38" xsi:type="xsd:string">clements</keyName>
		</adminServer>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Can anyone tell what is wrong with this message? What am I missing?

Thanks,

-----Original Message-----
From: Michael R. Clements [mailto:mrclem@telocity.com]
Sent: Thursday, September 20, 2001 20:00
To: Simon Fell; soap-user@xml.apache.org
Subject: RE: XML parser & cyclical reference question


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:soap@zaks.demon.co.uk]
Sent: Thursday, September 20, 2001 18:22
To: soap-user@xml.apache.org; mrclem@telocity.com
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
>mrclem@telocity.com
>Some find truth in beauty, others find beauty in truth.




RE: XML parser & cyclical reference question

Posted by "Michael R. Clements" <mr...@telocity.com>.
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:soap@zaks.demon.co.uk]
Sent: Thursday, September 20, 2001 18:22
To: soap-user@xml.apache.org; mrclem@telocity.com
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
>mrclem@telocity.com
>Some find truth in beauty, others find beauty in truth.



RE: XML parser & cyclical reference question

Posted by "Michael R. Clements" <mr...@telocity.com>.
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:soap@zaks.demon.co.uk]
Sent: Thursday, September 20, 2001 18:22
To: soap-user@xml.apache.org; mrclem@telocity.com
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
>mrclem@telocity.com
>Some find truth in beauty, others find beauty in truth.



Re: XML parser & cyclical reference question

Posted by Simon Fell <so...@zaks.demon.co.uk>.
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
>mrclem@telocity.com
>Some find truth in beauty, others find beauty in truth.


Re: XML parser & cyclical reference question

Posted by Simon Fell <so...@zaks.demon.co.uk>.
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
>mrclem@telocity.com
>Some find truth in beauty, others find beauty in truth.