Thursday, July 09, 2009

using jaxws 2.1 for exposing web services

jaxWS 2.1 simplifies web service development for java based applications. It is very easy to expose your pojo service classes as web services just using web service annotations.

Just put @WebService annotation on your service class, that's all . You can also restrict number of methods to be exposed using @WebMethod annotation on methods of exposed service class.

For the GlassFish V2 you dont have to add anything to web.xml file for the web services. All of required definitions will be added by GlassFish during the deployment. On the other hand , for the tomcat, you have to add listener definitions into web.xml file to run web services.

During the deployement all classes containing web service annotations are scanned by AS and required web service classes are generated using wsgen tool. For this process you need JDK that contains wsgen and apt tools. If you specified jre you will get the following error message during deployment.

com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class {0} is not found. Have you run APT to generate them?

Labels:

3 Comments:

Blogger website design,web design said...

Your blog is very nice... i like your blog ....

web design company, web designer, web design India

2:12 AM  
Blogger mumtaz said...

This i a wonderful blog ..nice to read this about web services.
web design company

11:04 PM  
Blogger sowmya said...

Great content you have been updated in your blog. Its really informative too. Thanks..
Seo forum india

12:52 AM  

Post a Comment

<< Home