I believe you have to use xsd schema to define an xsd:complexType
(eventually abstract) and define further subclasses using
xsd:complexType/complexContent/extention elements with the
appropriate [@base="my:parentType] (I'm guess-presenting xpath,
btw... please bear with me ;-) ) If the bean mapping framework is
good enough it should be fine.
Polimorphism requires the use of substitution groups ( http://
www.w3.org/TR/2001/REC-xmlschema-0-20010502/#SubsGroups ). While
theoretically fine as long as soap:body payloads are concerned in a
doc/lit service, I don't think jaxb supports it. I also sense trouble
as far as SOAP method lookup is concerned. IMHO, the current method
based on the argument signature is ass-backward anyway and I don't
see how could a SOAP engine decide what derivation to call after
deserialization.
To do such thing properly jaxb should generate interface classes and
implementing beans, while jax-rpc generate stubs/skels on those
interface signatures. The SOAP servlet would then, somehow create the
correct object (I was thinking about a SOAP Header extension but that
would be too easy wouldn't it?), a business visitor and ask the
object to accept it.
My 2c,
e
Il giorno 19/gen/06, alle ore 17:55GMT+01:00, Ryan LeCompte ha scritto:
> Hello all,
>
> I was wondering if anyone could shed any light on the notion of
> WSDL polymorphism. Is this something that is interoperable among
> all web service stacks? For example, I'd like to basically
> represent the following in WSDL:
>
> class Base {
> string commonValue1;
> string commonValue2;
> }
>
> class ChildOne extends Base {
> string childOneValue1;
> string childOneValue2;
> }
>
> class ChildTwo extends Base {
> string childTwoValue1;
> string childTwoValue2;
> }
>
> (note that the above is just pseudo code)
>
> Does WSDL support the above notion of inheritance, polymorphism? If
> so, will all WSDL stacks generate the right interfaces? What about
> langauges that don't support type-safety, such as Python/Perl? Is
> it best to just have two different types and duplicate the
> "commonValue1" and "commonValue2" for the sake of interoperability?
>
> Thanks!
> Ryan
>