users@jax-rpc.java.net

handling of <any> in extension

From: Pete Hendry <peter.hendry_at_CAPECLEAR.COM>
Date: Fri, 06 Jun 2003 11:06:28 +1200

How does a JAX-RPC implementation handle the case where a complexType is
derived from another complexType and both type contain a reference to an
<any>?

For example

<complexType name="base">
    <sequence>
       <element name="e1" type="xsd:string"/>
       <any namepace="##targetNamespace"/>
    </sequence>
</complexType>

<complexType name="derived1">
    <complexContent>
       <restriction base="base">
          <sequence>
             <element name="e2" type="xsd:string"/>
             <any namespace="##local ##targetNamespace"/>
          </sequence>
       </restriction>
    </complexContent>
</complexType>

When "base" is generated as java code it gets an "_any"field of type
SOAPElement. However, what happens when "derived1" is generated? What
happens with its any? From my reading of the spec the above is logically
equivalent

<complexType name="logicalDerived1">
    <sequence>
        <sequence>
            <element name="e1" type="xsd:string"/>
            <any namepace="##targetNamespace"/>
        </sequence>
        <sequence>
             <element name="e2" type="xsd:string"/>
             <any namespace="##local ##targetNamespace"/>
         </sequence>
    </sequence>
</complexType>

This means that there can/must be 2 any elements in an instance of this
type. But how does this translate to the JAX-RPC specification on how to
generate types with any? Where would the second any field go in the
generated code (the first _any is inherited from the base class)? This
gets more complicated when maxOccurs > 0 on either the base or the
derived any.

Pete