Scenario: After creating several web services as @Stateless bean, pack it as an ejb jar. Result - access to the wsdl file cannot be.
Purpose: I want to use @WebServices as an @Stateless session, using jj jar packaging with the available wsdl file form.
Web service:
@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; } }
In this case, I get
Invalid wsdl request http://192.168.44.48:8181/ws.isp.SecurityService/SecurityService
when I try to access wsdl and if not use the wsdlLocation description, I get a blank page.
Web service as it works well.
Q1: what is the rule for describing the location of the wsdl file for web services as a stateless person in an ejb bank.
Q2: Is it possible to generate a wsdl file during maven packaging?
Q3: how to generate a wsdl file for a web service where we have an annotation like @Stateless and @EJB (currently I can only generate it by commenting on these annotations)
environment: mave 2, ejb 3.1, glassfish v3, jax-ws 2.x
Thanks!
source share