1 Reply Latest reply on Mar 11, 2010 5:17 AM by asoldano

    EJB WS Annotation and WSDL generation

    jojopotatoe

      I have noticed some differences in wsdl generation when you change the place of annotation.

       

      I am using Jboss 5.1 (jdk6) with a deployment of ws 3.2.2.

       

      Here the test class :

       

      @WebService(name = "EndpointInterface", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", serviceName = "HelloWorldService")  
      @SOAPBinding(style = SOAPBinding.Style.RPC)  
      @Remote(HelloRemote.class)  
      @Stateless  
      public class HelloWorld implements HelloRemote  
      {  
         @WebMethod  
         public String echo(String input)  
         {  
            return input;  
         }  
           
            
           
      }  
      
      

       

      Here the interface :

       

      @WebService  
      public interface HelloRemote  
         
      {  
         public String echo(String input);  
           
            
      }  
      
      

       

       

      If you change code to :

       

      @WebService(name = "EndpointInterface", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", serviceName = "HelloWorldService")  
      @Stateless  
      public class HelloWorld implements HelloRemote  
      {    
         public String echo(String input)  
         {  
            return input;  
         }  
           
            
           
      }  
      
      
      
      
      

       

       

      and interface :

       

      @WebService 
      @SOAPBinding(style = SOAPBinding.Style.RPC)  
      public interface HelloRemote  
         
      {  
         @WebMethod
         public String echo(String input);  
           
            
      }  
      
      

       

       

      The two wsdl are quite differents and the second is way seems to be better. For example if you use apache axis to generate data from wsdl only the second one give us a working implementation.

       

      Is it something known ? Maybe it is my bad use of the framework ?

        • 1. Re: EJB WS Annotation and WSDL generation
          asoldano

          What does it mean a wsdl is "better" than another? You might want to post the differences. The wsdl can either be valid/consistent  with the endoint or not. If you can't automatically generate a working client from a valid wsdl, perhaps you have an issue in the tool/library used on client side.

          This said, you're probably missing the endpointInterface declaration in the @WebService annotation on the endpoint impl. That way your interface is most probably not being considered (from a ws point of view).