3 Replies Latest reply on May 22, 2006 7:26 AM by Thomas Diesler

    Support for java enum type.

    Narasimha Goli Newbie

      Hi,
      I am able to deploy the web services using new version of JBoss (4.0.4) & using JBossWS-GA. But when the java class used to input to the webMethod function has a property "GENDER" of type java enum "MALE/FEMALE", it does not work. It works if comment this property.

      I get the following error.

      org.jboss.ws.WSException: JAX-RPC Enumeration type did not conform to expectatins

      Any help would be appreciated.


      Thanks
      Goli.

        • 1. Re: Support for java enum type.
          Heiko Braun Master

          I suppose you are using the JDK 1.5 enum type as input/output. However, it's not supported. JBossWS expects a 'typical' jdk 1.4 enum type like:

          //Java
          public class <enumeration_name> {
          // ...
          // Constructor
          protected <enumeration_name>(<base_type> value) { ... }
          // One for each label in the enumeration
          public static final <base_type> _<label> = <value>;
          public static final <enumeration_name> <label> =
          new <enumeration_name>(_<label>);
          // Gets the value for a enumerated value
          public <base_type> getValue() {...}
          // Gets enumeration with a specific value
          // Required to throw java.lang.IllegalArgumentException if
          // any invalid value is specified
          public static <enumeration_name> fromValue(<base_type> value) {
          ... }
          // Gets enumeration from a String
          // Required to throw java.lang.IllegalArgumentException if
          // any invalid value is specified
          public static <enumeration_name> fromString(String value){ ... }
          // Returns String representation of the enumerated value
          public String toString() { ... }
          public boolean equals(Object obj) { ... }
          public int hashCode() { ... }
          }
          


          Take a loot at JAXRPC 1.1, 4.2.4

          • 2. Re: Support for java enum type.
            Narasimha Goli Newbie

            Is this version of JBoss-WS(jbossws-1.0.0.GA) is JAX-WS 2.0 complaint or not? According to the app server (JBoss 4.0.4 ) documentation, it is J2ee 1.4 complaint. If so, it should support JAXB2.0 bindings completely. JAXB 2.0 maps xml enumeration to enum (1.5 java) type.

            When can we expect JBoss-WS to support the JDK1.5 enum type? The answer will help us in deciding when we want to migrate our current application to JBoss 4.0.4

            Thanks


            • 3. Re: Support for java enum type.
              Thomas Diesler Master

              JAXWS, JAXB-2.0 is not part of J2EE-1.4

              JBossWS-1.0.0.GA does not have support for JAXWS nor for JAXB. You can monitor the roadmap for progress on this.