Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5208

Anonymous types in an exception aren't generated in WSDL

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 2.7.6
    • Fix Version/s: None
    • Component/s: JAXB Databinding, Tooling
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      Anonymous types (annotated with @XmlType(name = "")) in an exception class aren't generated at all in WSDL.

      Web service classes:

      @WebService
      public class GreetingService {
        @WebMethod
        public void hello() throws MyException {}
        ...
      
      public class MyException extends Exception {
        private String     str;
        private MyAnonType myAnonObj;
      
        public String getStr() { return str; }
        public void setStr(String str) { this.str = str; }
      
        public MyAnonType getMyAnonObj() { return myAnonObj; }
        public void setMyAnonObj(MyAnonType myAnonObj) { this.myAnonObj = myAnonObj; }
        ...
      
      @XmlType(name = "")
      public class MyAnonType { ...
      

      Generated WSDL:

        <wsdl:types>
      <xs:schema ...>
        ...
        <xs:complexType name="MyException">
          <xs:sequence>
            <xs:element name="str" nillable="true" type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      

      Note that the same type (MyAnonType) is generated in WSDL if the @XmlType(name = "") annotation is removed.

        Attachments

        1. exception-anontype.zip
          5 kB
          Tadayoshi Sato

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tadayosi Tadayoshi Sato
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: