Meaningless Drivel is fun!*
The moose likes Web Services and the fly likes Deploy JAXWS (Axis2) in Tomcat. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Deploy JAXWS (Axis2) in Tomcat." Watch "Deploy JAXWS (Axis2) in Tomcat." New topic
Author

Deploy JAXWS (Axis2) in Tomcat.

Joel John
Greenhorn

Joined: Jan 12, 2009
Posts: 4

Hi,
I searched the existing threads and couldnt find anything related to it. Could you please provide steps to deploy JAX-WS (Axis2) in TomCat? Axis2 documentation suggests 2 ways- (http://ws.apache.org/axis2/1_4_1/jaxws-guide.html#DeployService). Both of them do not satisfy my requirement. I want the service to be deployed as a WAR...could somebody give me the steps to do it?

Thank you.

Regards,
Joel John
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41626
    
  55
WS are not web apps; so they aren't deployed as .war files. Axis uses .sar files to do that. What requirement do you have that can't be achieved by this?

Of course, you could redeploy the whole Axis web app as a .war file, including the web services, but that seems way overkill.


Ping & DNS - my free Android networking tools app
Joel John
Greenhorn

Joined: Jan 12, 2009
Posts: 4
As per the Apache axis2 documentation, all the webservices will be deployed under <TomcatRoot>/webapps/axis2/WEB-INF/servicejars/. My requirement is to have 4 webservices running in Tomcat. If I go with what axis2 documentation says, all the webservices will be deployed under a single servlet called axis2. If I want to bring down one service for some maintenance, I have to bring down all of them...If I have them as individual Wars, it is easy for maintenance. I have another long term requirement also....sometimes down the line, I want to move that service to Websphere without any effor or with minimal effort...If I have it as War, it will be easy to move to websphere.

Regards,
Joel John
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41626
    
  55
Which SOAP stack are you going to be using in WebSphere? Is it acceptable to bring it down just to update a single service? Or does that SOAP stack support updating individual services without impacting the other ones?

It's of course possible to run a full Axis web app for each service that you intend to deploy, thus giving you the ability to start, stop and update each individual web service whenever you desire.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Joel John wrote:I have another long term requirement also....sometimes down the line, I want to move that service to Websphere without any effor or with minimal effort...If I have it as War, it will be easy to move to websphere.


Neither JAX-WS or its pre-decessor JAX-RPC have a deployment concept of a "web service component" that is equivalent to that of a "web component". The specifications simply describe the API and configurations that an environment for building Java web service providers and consumers has to support - and there are gaps that implementing platforms fill in a platform dependent manner. So its likely that you will have to at the very least recompile your code under another API implementation. To be sure that you can move your code later, you better plan ahead and test it now under both platforms.

Furthermore Axis2 implemented JAX-WS on top of its own web service API architecture rather than designing an "optimal" architecture for supporting the JAX-WS spec.

Java SE 6 supports JAX-WS and the endpoint is published programmatically with a statement like:

not of a trace of a "web service component" - just a "plain" Java class. (See Confusion in writing web service client + jax-ws. Keep in mind that wsgen and wsimport could generate source code that is dependent on the implementing web services platform.)

Do you have a particular reason for using Axis 2 rather than Sun's JAX-WS implementation?
JAX-WS 2.0 Samples on Tomcat 5.5.x
Running JAX-WS Samples with Tomcat 6.x
Joel John
Greenhorn

Joined: Jan 12, 2009
Posts: 4
Hi,
Thanks for all your inputs. I shall try your suggestions and post my response.
 
Consider Paul's rocket mass heater.
 
subject: Deploy JAXWS (Axis2) in Tomcat.