axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "clint dovholuk (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Commented: (AXIS-1955) Axis 1.2rc3 does not write derived types from abstract classes to wsdl
Date Thu, 26 May 2005 11:37:57 GMT
     [ http://issues.apache.org/jira/browse/AXIS-1955?page=comments#action_66347 ]
     
clint dovholuk commented on AXIS-1955:
--------------------------------------

I agree that the message processing isn't being affected by this issue.  Once you add the
second method though, it "forces" Axis to write the AbstractShape type and it's derivitives
out to the wsdl.  Without those types written out, how can you invoke the web service via
a client?  Maybe it's something that I'm missing, but when a concrete class contains an abstract
class, all the derived abstract classes need to be written out or else Axis will never be
able to instantiate the object fully, right?

ie, i can send an AbstractShape, but it's an abstract class, thus can't be instantiated...
Comment out the second method and the AbstractShape is still written to the wsdl, but there's
no instantiable class.

Maybe it's something I'm missing, or maybe there's a "better" way... If so, I'd love to know
it, but for now, I still feel this is a bug...

Thanks for taking the time!
-clint



> Axis 1.2rc3 does not write derived types from abstract classes to wsdl
> ----------------------------------------------------------------------
>
>          Key: AXIS-1955
>          URL: http://issues.apache.org/jira/browse/AXIS-1955
>      Project: Axis
>         Type: Bug
>   Components: WSDL processing
>     Versions: 1.2RC3
>  Environment: 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
>     Reporter: clint dovholuk
>  Attachments: test.jar
>
> 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>
>   

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message