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 "Bell, Douglas" <DB...@boingo.com> on 2005/08/31 00:30:21 UTC
What kind of serializer should I use for this?
Hello Everyone,
I have a several classes that extends another class i.e.
class ExtendedRule extends Rule
{
....
}
class AnotherExtendedRule extends Rule
{
...
}
I want an array of Rule[]'s returned to me. I'm able to get them back
but am having a problem with the sub class deserialization. Axis can see
that the array of Rule's returned contains ExtendedRules and
AntoherExtendedRules but then complains that the extended Rules contains
elements not contained in Rule[]
My first thought was to use an arrayMapping
<arrayMapping qname="ns:ArrayOfRule" xmlns:ns="urn:ArrayOfRule"
languageSpecificType="java:Rule[]" innerType="ns2:ExtendedRule"
xmlns:ns2="urn:ExtendedRule"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
This throws back "Invalid element in Rule - address". Which is correct
address exist in ExtendedRule but not in Rule..
Any Ideas/Help?
Thanks in advance!
- Doug
Re: What kind of serializer should I use for this?
Posted by Rogério Luz <ro...@gmail.com>.
I have the same situation, but in my case the returned Beans implements an
interface. My choice, at the moment, was "replicate" the interface
implementations for each return bean and forget the implements clause...
If somebody has a solution for complex types wich implements/extends other
complex types, let us know.
On 8/30/05, Bell, Douglas <DB...@boingo.com> wrote:
>
> Hello Everyone,
> I have a several classes that extends another class i.e.
> class ExtendedRule extends Rule
> {
> ....
> }
> class AnotherExtendedRule extends Rule
> {
> ...
> }
> I want an array of Rule[]'s returned to me. I'm able to get them back but
> am having a problem with the sub class deserialization. Axis can see that
> the array of Rule's returned contains ExtendedRules and AntoherExtendedRules
> but then complains that the extended Rules contains elements not contained
> in Rule[]
> My first thought was to use an arrayMapping
>
> <arrayMapping qname="ns:ArrayOfRule" xmlns:ns="urn:ArrayOfRule"
> languageSpecificType="java:Rule[]" innerType="ns2:ExtendedRule"
> xmlns:ns2="urn:ExtendedRule" encodingStyle="
> http://schemas.xmlsoap.org/soap/encoding/"/>
>
> This throws back "Invalid element in Rule - address". Which is correct
> address exist in ExtendedRule but not in Rule..
>
> Any Ideas/Help?
>
> Thanks in advance!
>
> - Doug
>
--
[]´s
Rogério Luz