Sunday, January 27, 2013

JAX-WS Web Service Endpoint implementation

In web service development cycle, Endpoint implementation plays a vital role. Actual purpose of the web service is written in Web service endpoint class or technically we can say that web service endpoint contains the business logic.

In this blog post i'll be going to discuss about types of JAX-WS web service endpoint implementation.

In JAX-WS, we have two choice and discuss individually:

1. JavaBeans service endpoint interface.
2. A Provider interface.

JavaBeans service endpoint implementation is same a JAX-RPC. In JAX-WS SEI (Service Endpoint Interface) is optional. The JAX-WS service that do not have an associated SEI are regarded as having implicit SEI. whereas the service have an associated SEI are regarded as having explicit SEI. Unlike JAX-RPC, JAX-WS service not required to implement java.rmi.Remote. It is mandatory in JAX-RPC.

JAX-WS specification leverages support for annotating Java class with other metadata to expose the class as a web service.

If you are decided to use JavaBeans service endpoint interface, then annotate the class with javax.jws.WebService annotation.


If JAX-WS service implementation bean also uses an explicit SEI then endpoint interface name should be used in attribute "endpointInterface" of javax.jws.WebService annotation.

If JAX-WS service implementation bean does not use explicit SEI then service is described by implicit SEI declared in the bean itself.

If you have explicit SEI then you have to annotate the interface with the javax.jws.WebService with the following attributes.

@WebService(name="", targetNamespace="", wsdlLocation="")

and SIB (Service Implementation Bean) should be annotate with the followings:

@WebService(serviceName="", targetNamespace="", endpointInterface="", portName="")


If you are decided to use a new Provider interface, then annotate the class woth javax.jws.WebServiceProvider annotation.

a new Provider API, is more message oriented and this interface has one method named "invoke" and uses generic "Source" to control input and output.










No comments:

Post a Comment