Uploaded image for project: 'Axis'
  1. Axis
  2. AXIS-1955

Axis 1.2rc3 does not write derived types from abstract classes to wsdl

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • 1.2RC3
    • 1.2.1
    • WSDL processing
    • None
    • os: ms windows xp pro build 2600 with sp 2
      app server: resin 2.1.14
      ide: eclipse 3.1M6 (used to launch and debug the app)
      hardware: p4 3GHz + 1.0 G ram and ample hd space

    Description

      After upgrading to Axis 1.2rc3 I noticed that the wsdl is no longer being written properly when using derived types from abstract classes.

      Test Case: (i hope you perserve spaces as this is indented properly when i submit it)
      create these files and compile them:
      TestObj.java
      package test;
      public class TestObj {
      public void testShapeHolder(ShapeHolder shapeHolder)

      { System.err.println("SHAPE CLASS: " + shapeHolder.getClass()); }

      /*
      this is commented out on purpose, you will remove it in the last steps of the test case
      public void testAbstractShape(AbstractShape shape)

      { System.err.println("SHAPE CLASS: " + shape.getClass()); }

      */
      }

      ShapeTester.java
      package test;
      public class ShapeTester {
      private AbstractShape shape;
      public AbstractShape getShape ()

      { return shape; }

      //public void setShape (AbstractShape shape)

      { this.shape = shape; }

      }

      AbstractShape.java
      package test;
      public abstract class AbstractShape {}

      Square.java
      package test;
      public class Square extends AbstractShape {}

      Circle.java
      package test;
      public class Circle extends AbstractShape {}

      Add this service to the server-config.wsdd
      <service name="absTest" provider="java:RPC">
      <parameter name="allowedMethods" value="*" />
      <parameter name="className" value="test.TestObj" />
      <beanMapping qname="THENS:ShapeTester" xmlns:THENS="myWebApp:ShapeTester" languageSpecificType="java:test.ShapeTester"/>
      <beanMapping qname="THENS:Square" xmlns:THENS="myWebApp:Square" languageSpecificType="java:test.Square" />
      <beanMapping qname="THENS:Circle" xmlns:THENS="myWebApp:Circle" languageSpecificType="java:test.Circle" />
      </service>

      install axis 1.1 and get it running

      hit the wsdl and look at the wsdl:types, on my box it looks like:
      <wsdl:types>
      <schema targetNamespace="http://test" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <complexType abstract="true" name="AbstractShape">
      <sequence />
      </complexType>
      </schema>
      <schema targetNamespace="myWebApp:Circle" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <complexType name="Circle">
      <complexContent>
      <extension base="tns2:AbstractShape">
      <sequence />
      </extension>
      </complexContent>
      </complexType>
      </schema>
      <schema targetNamespace="myWebApp:ShapeTester" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <complexType name="ShapeTester">
      <sequence>
      <element name="shape" nillable="true" type="tns2:AbstractShape" />
      </sequence>
      </complexType>
      </schema>
      <schema targetNamespace="myWebApp:Square" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <complexType name="Square">
      <complexContent>
      <extension base="tns2:AbstractShape">
      <sequence />
      </extension>
      </complexContent>
      </complexType>
      </schema>
      </wsdl:types>

      replace axis libraries (I replaced axis.jar, saaj.jar, and wsdl.jar) with corresponding axis 1.2rc3 jars

      hit the wsdl and look at the wsdl:types, i NOW get: (that can't be right, is it?)
      <wsdl:types>
      <schema targetNamespace="http://test" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="myWebApp:ShapeTester" />
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <complexType abstract="true" name="AbstractShape">
      <sequence />
      </complexType>
      </schema>
      <schema targetNamespace="myWebApp:ShapeTester" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://test" />
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <complexType name="ShapeTester">
      <sequence>
      <element name="shape" nillable="true" type="tns2:AbstractShape" />
      </sequence>
      </complexType>
      </schema>
      </wsdl:types>

      uncomment the method in TestObj named testAbstractShape

      restart the application

      hit the wsdl. you now get the FULL wsdl written out including the types:
      <wsdl:types>
      <schema targetNamespace="http://test" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="myWebApp:ShapeTester" />
      <import namespace="myWebApp:Circle" />
      <import namespace="myWebApp:Square" />
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <complexType abstract="true" name="AbstractShape">
      <sequence />
      </complexType>
      </schema>
      <schema targetNamespace="myWebApp:ShapeTester" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="myWebApp:Circle" />
      <import namespace="http://test" />
      <import namespace="myWebApp:Square" />
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <complexType name="ShapeTester">
      <sequence>
      <element name="shape" nillable="true" type="tns2:AbstractShape" />
      </sequence>
      </complexType>
      </schema>
      <schema targetNamespace="myWebApp:Square" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="myWebApp:ShapeTester" />
      <import namespace="myWebApp:Circle" />
      <import namespace="http://test" />
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <complexType name="Square">
      <complexContent>
      <extension base="tns2:AbstractShape">
      <sequence />
      </extension>
      </complexContent>
      </complexType>
      </schema>
      <schema targetNamespace="myWebApp:Circle" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="myWebApp:ShapeTester" />
      <import namespace="http://test" />
      <import namespace="myWebApp:Square" />
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <complexType name="Circle">
      <complexContent>
      <extension base="tns2:AbstractShape">
      <sequence />
      </extension>
      </complexContent>
      </complexType>
      </schema>
      </wsdl:types>

      Attachments

        1. test.jar
          1 kB
          clint dovholuk
        2. Patch_BeanSerializer.diff
          0.2 kB
          Jayachandra Sekhara Rao Sunkara
        3. 1955Patch_cvs_diff.txt
          0.8 kB
          Jayachandra Sekhara Rao Sunkara
        4. test.jar
          2 kB
          clint dovholuk
        5. 1955ArrayTypesPatch.txt
          0.6 kB
          Tom Parker

        Activity

          People

            jayachandra Jayachandra Sekhara Rao Sunkara
            dovholuk clint dovholuk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: