Home > Documentation > Developer's guide > Tutorials > Web services > Developing a JAX-WS EJB Stateless Session Bean Web Service |
This tutorial will take you through the steps required in developing, deploying and testing a EJB Stateless Session Bean Web Service in Apache Geronimo. After completing this tutorial you should be able to understand how to develop simple JAX-WS compliant EJB web services in Apache Geronimo using Eclipse development environment.
It is highly recommended that you go through the Developing a JAX-WS POJO Web Service tutorial before jumping into this. We will be using the same sample from the tutorial to develop a EJB Web Service.
Client development is excluded from this tutorial because there is no difference in creating a client for EJB Stateless Session Bean Web Service and a POJO Web Service.
You can refer to Developing a JAX-WS POJO Web Service tutorial for further knowledge about how to develop a client for Web Services.
To run this tutorial, as a minimum you will be required to have installed the following prerequisite software.
Details on installing eclipse are provided in the Development environment section. This tutorial will take you through the following steps:
If you want to change the service location to any custom URL you want, make sure that the check box Generate Deployment Descriptor is selected.
This completes the configuration of Eclipse for application development.
To deploy the Converter EJB Service, we are going to create a remote interface and a stateless session bean that implements the interface. The steps required are as follows:
If you have already gone through the Developing a JAX-WS POJO Web Service tutorial, you might have observed that there's not much difference between an EJB Web Service and POJO Web Service except for the EJB specific annotations.
This completes the development of the Web Service Implementation code.
If you are comfortable with the location that Geronimo deploys the EJB Web Service, you can skip this section and got Deploy and Test Section.
If ejb-jar.xml is not present, create a XML file and name it as ejb-jar.xml
This completes the setting up of Deployment descriptor and Deployment Plan.
Now, we will look into the steps involved in deploying and testing our web service without any clients.
If you see any errors at deploy time like Unable to read WSDL file null, simply ignore them.
If you have followed the steps to deploy the service onto custom location, go to the url http://localhost:8080/CUSTOM_URL
You can also use Web Services Explorer present in Eclipse to rapidly test your web service without developing a client.
To know how to use Web Services Explorer in Eclipse, one can refer to the Developing a JAX-WS POJO Web Service#Using Web Services Explorer in Eclipse
Bookmark this on Delicious Digg this | Privacy Policy - Copyright © 2003-2011, The Apache Software Foundation, Licensed under ASL 2.0. |