Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAX-WS+Eclipse+Tomcat+Annotations

 
Bhairava Surya
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Can someone clearly explain the step by step process of implementing a webservice using annotations with JAX-WS.
IDE should be - Eclipse & Server - Tomcat.

Thanks & Regards,
Ravi.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Have you seen the instructions on the Metro web site on how to install Metro in Tomcat?
If not, here they are: https://metro.dev.java.net/2.0.1/
I have occasionally had minor problems when running Metro in Tomcat, but they have always been resolved by reinstalling Metro.
With Metro installed in Tomcat, you should be able to follow pretty much any JAX-WS tutorial.
Best wishes!
 
Bhairava Surya
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ivan,

Thank you verymuch for your response. But, I have no idea about Metro.
So, Could you please send me the proper steps for writing/executing a webservice+Tomcat+Annotations(JDK1.6)

Thanks & Regards,
Ravi.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
In order to be able to run a web service inside Tomcat, you must have a web service stack.
There are many to choose from, such as Metro, Apache CXF, Axis etc.
I would personally recommend Metro, due to it being very easy to work with - install it and, more or less, forget it.
The steps would be:
- Install Tomcat.
- Install Metro.
- Create a Dynamic Web Project in Eclipse.
- Develop a web service endpoint implementation class in the Eclipse project.
Use JAX-WS annotations to annotate the class, a minimum would be to annotate the class with @WebService.
- Deploy the project to Tomcat.
- Test the web service using soapUI or similar tool.
Best wishes!
 
Bhairava Surya
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ivan,

This is my immediate response after seeing your mail.

Thank you so much. Let me try the steps what ever you have explained here and will let you whether I have succeeded in that or not.

But small doubts,
1) without the Webservices stack (Metro or something). Cant I write a webservice with normal tomcat 6.x(or any other versions)??
2) Does this Webservices stack Metro etc are required only when we want to write a webservice using annotations? because I think earlier using JAX-RPC we used to write in any tomcat right?

Thanks & Regards,
Ravi.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I guess it is possible to write a web service and deploy it to Tomcat without a web service stack, but it will mean much more work. You would basically have to implement a web service stack yourself.
Are there any obstacles that prevent you from installing Metro, for instance, in the Tomcat instance to which you will deploy your web service?

Though I have not tried, you may be able to deploy the Metro libraries as application-specific libraries, in the WEB-INF/lib directory of your application.
I cannot promise it will work - perhaps someone with some experience in this area care to step forward.

I think JAX-RPC also required a web service stack. Perhaps it was not as obvious back then - just a bunch of JARs.
I also suspect that they were included on a per-application basis.
Best wishes!
 
Bhairava Surya
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ivan,

Thank you very much for the info, please look into your PMs.

Thanks & Regards,
Ravi.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic