Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5420

AXIS2 can't create custom exception from received fault message if a custom string definition exists at the WSDL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.6.2
    • 1.6.3, 1.7.0
    • codegen
    • None

    Description

      The .net implementation of the WCF framework delivered me following schema definitions in the wsdl file:

      <xs:schema attributeFormDefault="qualified"
      elementFormDefault="qualified"
      targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/"
      xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/">
      <xs:element name="dateTime" nillable="true" type="xs:dateTime" />
      <xs:element name="decimal" nillable="true" type="xs:decimal" />
      <xs:element name="double" nillable="true" type="xs:double" />
      <xs:element name="float" nillable="true" type="xs:float" />
      <xs:element name="int" nillable="true" type="xs:int" />
      <xs:element name="long" nillable="true" type="xs:long" />
      <xs:element name="QName" nillable="true" type="xs:QName" />
      <xs:element name="short" nillable="true" type="xs:short" />
      <xs:element name="string" nillable="true" type="xs:string" />
      </xs:schema>

      The resulting problem on the side of AXIS2 is that AXIS2 is generating a String class definition from the XSD definition <xs:element name="string" nillable="true" type="xs:string" />. If a custom fault is received AXIS2 creats a custom exception by using reflection and throws a error by invoking line:

      java.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class);

      The misstake is that the String.class is resolved as the generated class definition from AXIS2 and not java.lang.String. So it will be better to use the full qualified name.

      Attachments

        Activity

          People

            veithen Andreas Veithen
            glance Andy Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: