Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>What is today the quickest way to implement this in Java? I thoughted AXIS+Tomcat. Maybe is there any other newest library?</p> </blockquote> <p>Yes, there is a much better way. Forget Axis and go for a JAX-WS stack such as <a href="https://jax-ws.dev.java.net/" rel="nofollow noreferrer">JAX-WS RI</a> (which is included in Java 6) or <a href="http://cxf.apache.org/" rel="nofollow noreferrer">Apache CXF</a>. Here is the usual HelloWorld service with a test method using the built-in HTTP server of the JDK:</p> <pre><code>package hello; import javax.jws.WebMethod; import javax.jws.WebService; import javax.xml.ws.Endpoint; @WebService public class Hello { @WebMethod public String sayHello(String name) { return "Hello, " + name + "."; } public static void main(String[] args) { Endpoint.publish("http://localhost:8080/WS/Hello", new Hello()); } } </code></pre> <p>Just run the <code>main</code> method and you're ready to play with the web service. </p> <p>Of course, you'll want to deploy your web service on a real container for production use. You could go with GlassFish and just deploy your service (GlassFish bundles a JAX-WS runtime). Or you could pick Jetty or Tomcat and install the chosen runtime on it (JAX-WS RI or Apache CXF). Refer to their respective instructions.</p> <h3>Resources</h3> <ul> <li><a href="http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/2.0/tutorial/doc/JAXWS3.html" rel="nofollow noreferrer">Creating a Simple Web Service and Client with JAX-WS</a> </li> <li><a href="http://java.dzone.com/articles/jax-ws-hello-world" rel="nofollow noreferrer">JAX-WS Five Minute Tutorial</a> </li> </ul> <h3>Related question</h3> <ul> <li><a href="https://stackoverflow.com/questions/1533118/getting-started-with-jax-ws">Getting started with JAX-WS...</a> </li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload