File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Generate stubs for EJB3.1 bean exposed as webservice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Generate stubs for EJB3.1 bean exposed as webservice" Watch "Generate stubs for EJB3.1 bean exposed as webservice" New topic
Author

Generate stubs for EJB3.1 bean exposed as webservice

Simon Joseph Aquilina
Ranch Hand

Joined: Feb 14, 2006
Posts: 102
Hello, I am trying to use Maven to generate stubs for an EJB3.1 bean exposed as a Webservice. My example is as follows; I have an EAR with a JAR containing my EJB3.1 bean and a WAR which contains a Servlet that access this bean as a webservice. The bean code is as follows:



From the Servlet I call the webservice as follows:



This works fine. However on some books and the Internet I also found examples using @WebReference to inject an instance in an object of type HelloService as follows.




However I cannot understand how to generate HelloService from HelloBean. From the Internet I found out that JBossWS - JAX-WS Tools wsconsume will generate HelloService.java when given a WSDL file. However I can't seem to make it work when giving it a bean. From my maven project I tried adding the following plugin definition (glassfish project):



However this only generate classes to represent all methods in HelloBean and their return values. In short I still did not manage to generate HelloService from HelloBean so that from my Servlet I can avoid boilerplate code.

Does anyone know how I can generate stubs for an EJB3.1 bean most importantly the xxxService class? Or at least correct me if my reasoning regarding this class is wrong.
 
Don't get me started about those stupid light bulbs.
 
subject: Generate stubs for EJB3.1 bean exposed as webservice