You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2003/07/29 18:19:43 UTC

DO NOT REPLY [Bug 21973] New: - BeanSerializer generates invalid WSDL for interfaces

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21973>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21973

BeanSerializer generates invalid WSDL for interfaces

           Summary: BeanSerializer generates invalid WSDL for interfaces
           Product: Axis
           Version: 1.0
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: axis-dev@ws.apache.org
        ReportedBy: niall@pobox.com


When BeanSerializer is generating the WSDL for a Java class it adds the
"abstract=true" modifier to the XSD complex type definition if the class is
actually an interface.  This seems incorrect and causes interoperability
problems with Visual Studio .NET 2003.

It seems incorrect because an interface is not necessarily abstract; when
BeanDeserializer deserializes a class which implements an interface that has an
entry in the type registry, then the xsi:type attribute it generates declares it
to be of the XSD type corresponding to the interface.  However the WSDL
generated by BeanSerializer will have declared that type as "abstract".  In so
far as I can understand the XSD specifications this is illegal, from section
3.4.1 of part I:

"Complex types for which {abstract} is true must not be used as the {type
definition} for the �validation� of element information items. It follows that
they must not be referenced from an xsi:type (�2.6.1) attribute in an instance
document. Abstract complex types can be used as {base type definition}s, or even
as the {type definition}s of element declarations, provided in every case a
concrete derived type definition is used for �validation�, either via xsi:type
(�2.6.1) or the operation of a substitution group."

It causes interoperability issues with VS.NET 2003 because the VB stub class is
declared as "MustInherit" (equivalent to "abstract" in Java).  Deserialization
then fails because the SOAP toolkit cannot instantiate the stub class.  (The
exact error is "System.InvalidOperationException: The specified type is abstract"). 


The quick fix to this problem is to delete these lines from
BeanSerializer.writeSchema:


       if (Modifier.isAbstract(javaType.getModifiers())) {
            complexType.setAttribute("abstract", "true");
       }