简体   繁体   中英

Can Axis2 expose a web service from a plain old Java program?

I need to modify an existing Java SE process to expose a web service.

I notice that ApacheCXF can expose web services from a Java SE process, but my company is pushing me strongly towards using Axis2.

All the examples seem to assume you're running a fully-fledged servlet container. But since Java SE 6 includes com.sun.net.httpserver, I was hoping there'd be a way of avoiding setting up something like Jetty or Tomcat.

How can I use Axis2 to do this?

Axis 2 web services, including JAX-WS web services , need to be packaged and deployed in the Axis 2 container (the Axis 2 web application itself is a container for Web Services). So you have your answer, Axis 2 has to run inside a servlet container.

While I understand the motivations behind Axis 2 "container like" architecture and its deployment model, I really hate it and see more drawbacks than advantages (like its packaging hell which is totally counter productive). If at least it was performing better than alternatives, but no! See this comparison with the RI for example. Really, if you can reconsider using Axis 2, do it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM