In this section, we will be looking at some of the useful annotations introduced in the JSR 224 (JAX-WS) specification. These are additional annotations that supplement the JSR-181 annotations. We will be looking at the following annotations:
javax.xml.ws.BindingType
javax.xml.ws.RequestWrapper
javax.xml.ws.ResponseWrapper
javax.xml.ws.ServiceMode
javax.xml.ws.WebEndpoint
javax.xml.ws.WebFault
javax.xml.ws.WebServiceClient
javax.xml.ws.WebServiceProvider
javax.xml.ws.WebServiceRef
The BindingType
annotation is used to specify the binding to use for a web service endpoint implementation class. It has a single attribute, value
, which is a binding URI, and the default value is SOAP 1.1 / HTTP
. Let us look at a simple example:
@WebService
@BindingType(value="http://www.w3.org/2003/05/soap/bindings/HTTP/")
public class AddNumbers {
public int add(int a, int b) {
…
}
}
The deployed endpoint would use SOAP1.2 over HTTP...