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 Whitney Hunter <wh...@hunterfam.com> on 2003/08/15 19:39:36 UTC
Using CastorSerializer for return value causing error
Hi,
I am writing a service that uses the Castor serializer/deserializer. I
have gotten it to deserialize my input document into a Castor object.
However, when I return another Castor object, it does not get serialized
correctly. It seems to be duplicating the root element. For example my
test return value should be:
<outputElement xmlns="http://prototype.com/ipo.xsd">
<element3 xmlns="">this is it!</element3>
</outputElement>
But instead, tcpmon is showing this:
<outputElement xmlns="http://prototype.com/ipo.xsd">
<outputElement xmlns="http://prototype.com/ipo.xsd">
<element3 xmlns="">this is it!</element3>
</outputElement>
</outputElement>
As you might expect the client throws an exception when it tries to
deserialize this. Has anyone seen this? Anyone know what is going wrong?
Thanks,
Whitney
Re: Using CastorSerializer for return value causing error
Posted by Whitney Hunter <wh...@hunterfam.com>.
Thanks for the help.
Steve Maring wrote:
> The CastorSerializer in the Axis source tree is flawed. Remove the
> first line of the serialize method that makes reference to
> serializationContext.startElement(). This will fix your problem. I'd
> highly recommend writing your own so that you can use your own mapping
> anyway.
>
> Cheers.
> Steve Maring
>
>
> */Whitney Hunter <wh...@hunterfam.com>/* wrote:
>
> Hi,
>
> I am writing a service that uses the Castor
> serializer/deserializer. I
> have gotten it to deserialize my input document into a Castor object.
> However, when I return another Castor object, it does not get
> serialized
> correctly. It seems to be duplicating the root element. For
> example my
> test return value should be:
>
>
> this is it!
>
>
> But instead, tcpmon is showing this:
>
>
>
> this is it!
>
>
>
> As you might expect the client throws an exception when it tries to
> deserialize this. Has anyone seen this? Anyone know what is going
> wrong?
>
> Thanks,
> Whitney
>
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder
> <http://us.rd.yahoo.com/evt=10469/*http://sitebuilder.yahoo.com> -
> Free, easy-to-use web site design software
Re: Using CastorSerializer for return value causing error
Posted by Steve Maring <ba...@yahoo.com>.
The CastorSerializer in the Axis source tree is flawed. Remove the first line of the serialize method that makes reference to serializationContext.startElement(). This will fix your problem. I'd highly recommend writing your own so that you can use your own mapping anyway.
Cheers.
Steve Maring
Whitney Hunter <wh...@hunterfam.com> wrote:Hi,
I am writing a service that uses the Castor serializer/deserializer. I
have gotten it to deserialize my input document into a Castor object.
However, when I return another Castor object, it does not get serialized
correctly. It seems to be duplicating the root element. For example my
test return value should be:
this is it!
But instead, tcpmon is showing this:
this is it!
As you might expect the client throws an exception when it tries to
deserialize this. Has anyone seen this? Anyone know what is going wrong?
Thanks,
Whitney
---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software