Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.2
-
Fix Version/s: 1.2.2
-
Component/s: Aegis Module
-
Labels:None
-
Number of attachments :
Description
I have a interface like
public interface User{....}
a method like
@WebMethod
public @WebResult(name="user") User getUser(){...}
generated wsdl like
<xsd:complexType abstract="true" name="User"> ...</xsd:complexType>
and WSGen create a class like
public abstract class User {...}
so the client throw exception:
Caused by: java.lang.InstantiationException
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at com.sun.xml.bind.v2.ClassFactory.create0(ClassFactory.java:93)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.createInstance(ClassBeanInfoImpl.java:228)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.createInstance(UnmarshallingContext.java:486)
... 50 more
I have a similar problem. When upgrading to 1.2 I noticed all my complex types (which are interfaces) became described as abstract in the WSDL. While I agree with this change as interfaces are abstract, there are clients of my service that are incompatible with types described as abstract in the WSDL (I hate ColdFusion). I looked over the code for org.codehaus.xfire.aegis.type.basic.BeanType and found the writeSchema(Element) method sets the abstract attribute based directly on the class. Wouldn't it make more since to set this attribute using the value from isAbstract() inherited from Type. Then have isAbstract() overridden to return true when the BeanTypes class is abstract. By making this change it would be possible override the behavior by setting this to false for all my types.