axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey A. Chujko" <acau...@googlemail.com>
Subject Axis2 + JiBX, polymorphic types unmarshaling
Date Tue, 15 May 2007 11:23:42 GMT
Hi all,

I have set of objects being extended from another one:

<wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ns.url.com/">
      <s:complexType name="Product" abstract="true">
        <s:sequence>
           ...
        </s:sequence>
        ...
      </s:complexType>
      <s:complexType name="Application">
        <s:complexContent mixed="false">
          <s:extension base="tns:Product">
            <s:sequence>
              ...
            </s:sequence>
          </s:extension>
        </s:complexContent>
      </s:complexType>
      <s:complexType name="Logo">
        <s:complexContent mixed="false">
          <s:extension base="tns:Product">
            <s:sequence>
              ...
            </s:sequence>
          </s:extension>
        </s:complexContent>
      </s:complexType>
    </s:schema>
</wsdl:types>


The JiBX binding is following:

<binding xmlns:tns="http://ns.url.com/" force-classes="true" add-constructors="false">
   ...
   <mapping abstract="true" class="model.Product" type-name="tns:Product">
      ...
   </mapping>
   <mapping abstract="true" class="model.Product" name="Product">
       <structure map-as="tns:Product"/>
   </mapping>

   <mapping class="model.Application" name="Application" extends="model.Product">
       ...
   </mapping>

   <mapping class="model.Logo" name="Logo" extends="model.Product">
       ...
   </mapping>
</binding>


All stubs have been generated successfully, but compilation is failed with following messages:

   ...
   [javac] /home/zzz/ContentSoap12Stub.java:1734: model.Product is abstract; cannot be instantiated
   [javac]         uctx.getUnmarshaller(_type_index8).unmarshal(new model.Product(), uctx)
   [javac]                                                      ^
   [javac] /home/zzz/ContentSoap12Stub.java:2407: model.Product is abstract; cannot be instantiated
   [javac]         uctx.getUnmarshaller(_type_index8).unmarshal(new model.Product(), uctx)
   [javac]                                                      ^
   [javac] /home/zzz/ContentSoap12Stub.java:4545: model.Product is abstract; cannot be instantiated
   [javac]         uctx.getUnmarshaller(_type_index8).unmarshal(new model.Product(), uctx)
   [javac]                                                      ^
   [javac] /home/zzz/ContentSoap12Stub.java:5302: model.Product is abstract; cannot be instantiated
   [javac]         uctx.getUnmarshaller(_type_index8).unmarshal(new model.Product(), uctx)
   [javac]                                                      ^
   [javac] /home/zzz/ContentSoapStub.java:1731: model.Product is abstract; cannot be instantiated
   [javac]         uctx.getUnmarshaller(_type_index8).unmarshal(new model.Product(), uctx)
   [javac]                                                      ^
   [javac] /home/zzz/ContentSoapStub.java:2404: model.Product is abstract; cannot be instantiated
   [javac]         uctx.getUnmarshaller(_type_index8).unmarshal(new model.Product(), uctx)
   [javac]                                                      ^
   [javac] /home/zzz/ContentSoapStub.java:4542: model.Product is abstract; cannot be instantiated
   [javac]         uctx.getUnmarshaller(_type_index8).unmarshal(new model.Product(), uctx)
   [javac]                                                      ^
   [javac] /home/zzz/ContentSoapStub.java:5299: model.Product is abstract; cannot be instantiated
   [javac]         uctx.getUnmarshaller(_type_index8).unmarshal(new model.Product(), uctx)
   ...

I'm stuck with that issue.
Does someone of you guys has any idea why it trying to instantiate base abstract class and
how I could solve that? Am I doing something wrong?

Any help will be appreciated greatly.

Thanks,
Andrey.

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message