0 Replies Latest reply on Jun 4, 2010 11:03 AM by rkb76in

    Application exceptions namespace not correct in wsdl

      Doing development on JBoss [EAP] 4.3.0.GA_CP07 with Java version: 1.5.0_22,Sun Microsystems Inc.

       

      Exposing webservices using Stateless EJB3

       

      Try 1, My objects are like this

       

      package org.xxxx.common.item.exception;

       

      @XmlType(namespace="exception.item.common.xxxxx.org")

      public class ApplicationException extends Exception {

      ....

      }

       

      package org.xxxx.common.item;

       

      @XmlType(namespace="item.common.xxxxx.org")

      public class AppealId implements Comparable, Serializable {

      ......

      }

       

      and

       

      package org.xxxx.ejb3;

       

      public class DDBean implements DD {

      ....

           public Appeal getAppeal(AppealId id) throws ApplicationException {

                .....

           }

      }

       

      ApplicationException, gets defined in the .wsdl as a complex type, but the @XmlType annotation information does not taken into account e.g. the type is defined in the wrong namespace.

       

      AppealId, gets defined in the .wsdl as a complex type and @XmlType annotation information taken into account e.g. the type is defined in correct namespace.

       

      I could generate classes using wsconsume.bat successfully (Exceptions created under wrong packages org.xxxx.ejb3 instead of org.xxxx.common.item.exception)

       

      Try 2, My objects are like this

       

      package org.xxxx.common.item.exception;

       

      @XmlType(namespace="exception.item.common.xxxxx.org")

      @WebFault(name="ApplicationException",targetNamespace="exception.item.common.xxxxx.org")

      public class ApplicationException extends Exception {

      ....

      }

       

      same objects AppealId and DDBean.

       

      ApplicationException, gets defined in the .wsdl as a complex type, but the @WebFault annotation information does not taken into account fully e.g. the type is defined in the wrong namespace.

       

      AppealId, gets defined in the .wsdl as a complex type and @XmlType annotation information taken into account e.g. the type is defined in correct namespace.

       

      But this time got this in .wsdl
      <xs:schema targetNamespace="exception.item.common.xxxxx.org" version="1.0" xmlns:ns1="http://ejb3.xxxxx.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <xs:import namespace="http://ejb3.xxxxx.org/" />  
        <xs:element name="ApplicationException" type="ns1:ApplicationException" />
      </xs:schema>

       

      I couldn't generate classes using wsconsume.bat, got error message

      [ERROR] Schema descriptor {http://ejb3.xxxxx.org/}ApplicationException in message part "ApplicationException" could not be bound to Java!

       

      Any solution/suggestion/reason for this behaviour.