title: @WebServices as @Stateless session bean in ejb jar
body: <p>Scenario:
  Creating some web service as @Stateless bean, package it as ejb jar. Result - can`t access to wsdl file.</p>
  
  <p>Goal: I want to use @WebServices as @Stateless session using ejb jar packaging with accessible wsdl file form web.</p>
  
  <p>Web service:</p>
  
  <pre><code>@Stateless
  @WebService(serviceName = "ws.isp.SecurityService", wsdlLocation = "META-INF/wsdl/SecurityService.wsdl")
  public class SecurityService{
      @EJB
      private Kerberos factory;
  
      @EJB
      private UsersServiceBean uService;
  
      public SecurityService() {
      }
  
      @WebMethod
      @WebResult(name = "SimpleResponse")
      public SimpleResponse LogOut(
              @WebParam(name = "sessionUUID", targetNamespace = "https://secure.co.ua/ws/")
              String sessionUUID
      ) {
          SimpleResponse resp = new SimpleResponse();
          try{
          factory.removeSession(sessionUUID);
  
          resp.setError(WSErrorCodes.SUCCESS);
          }catch (Exception e){
              e.printStackTrace();
              resp.setError(WSErrorCodes.UNRELOSVED_ERROR);
          }
          return resp;
      }
  
      @WebMethod
      public MySession logIn(
              @WebParam(name = "username", targetNamespace = "https://secure.co.ua/ws/")
              String username,
              @WebParam(name = "password", targetNamespace = "https://secure.co.ua/ws/")
              String password){
          MySession result = new MySession();
          try {
              UserSession us = factory.creatSession(uService.getUser(username, password).getId());
              result.setSessionID(us.getSessionUUID().toString());
              result.setError(WSErrorCodes.SUCCESS);
          } catch (NullPointerException e){
              e.printStackTrace();
              result.setError(WSErrorCodes.UNRELOSVED_USER);
          } catch (Exception e){
              e.printStackTrace();
              result.setError(WSErrorCodes.UNRELOSVED_ERROR);
          }
          return result;
      }
  
  }
  </code></pre>
  
  <p>In this case I getting </p>
  
  <blockquote>
    <p>Invalid wsdl request
    <a href="http://192.168.44.48:8181/ws.isp.SecurityService/SecurityService" rel="nofollow noreferrer">http://192.168.44.48:8181/ws.isp.SecurityService/SecurityService</a></p>
  </blockquote>
  
  <p>when I try to access to wsdl
   and if do not use description of wsdlLocation I getting blank page.</p>
  
  <p>Web service as it self working good.</p>
  
  <p>Q1: what is the rule of describing wsdl file location for web services as stateless in ejb jar.</p>
  
  <p>Q2: is it possible to generate wsdl file during maven packaging ? </p>
  
  <p>Q3: how to generate wsdl file for web service where we have such annotation as @Stateless and @EJB (currently I can generate it only by commenting those annotations)</p>
  
  <p>environment: mave 2, ejb 3.1, glassfish v3, jax-ws 2.x</p>
  
  <p>Thank you!</p>