Hi Andrey,

I don't see anything wrong with the binding, offhand. It's very similar to the polymorphism example from the Jibx2Wsdl code at http://www.sosnoski.com/jibx-wiki/space/axis2-jibx/jibx2wsdl/example3 , and that works with the Axis2 1.2 release.

There were problems with this in earlier versions of the Axis2 code, including the 1.1.1 code. Which version of Axis2 are you using?

 - Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Axis2 Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Andrey A. Chujko wrote:
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to