• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Generate stubs for EJB3.1 bean exposed as webservice  RSS feed

Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!