You do not need a third-party library to use jax-ws . J2SE comes with jax-ws , so all annotations are still available to you. You can get easy results with the following solution, but for something optimized / multi-threaded, this is on your own head to implement:
Create an SEI endpoint interface, which is basically a Java interface with web service annotations. This is not necessary, it is just a point of good design from a basic OOP.
import javax.jws.WebService; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.soap.SOAPBinding; import javax.jws.soap.SOAPBinding.Style; @WebService @SOAPBinding(style = Style.RPC) //this annotation stipulates the style of your ws, document or rpc based. rpc is more straightforward and simpler. And old. public interface MyService{ @WebMethod String getString(); }
Deploy SEI in a Java class called the SIB bean service implementation.
@WebService(endpointInterface = "com.yours.wsinterface")
Open the service using Endpoint import javax.xml.ws.Endpoint;
public class MyServiceEndpoint{ public static void main(String[] params){ Endpoint endPoint = EndPoint.create(new MyServiceImpl()); endPoint.publish("http://localhost:9001/myService");
The passages above, as I said, are quite simple and will work poorly in production. You will need to develop a threading model for queries. The endpoint API accepts an instance of Executor to support concurrent requests. Threading is not really my thing, so I cannot give you pointers.
source share