Sunday, February 16, 2014

web service tutorial

RESTful web services, often better integrated with HTTP than SOAP-based services are, do not require XML messages or WSDL service–API definitions.
A RESTful design may be appropriate when the following conditions are met.
The web services are completely stateless. A good test is to consider whether the interaction can survive a restart of the server.
Bandwidth is particularly important and needs to be limited.  REST is particularly useful for limited-profile devices, such as PDAs and mobile phones,
for which the overhead of headers and additional layers of SOAP elements on the XML payload must be restricted.
Basically, you would want to use RESTful web services for integration over the web and use big web services in enterprise application integration
scenarios that have advanced quality of service (QoS) requirements.
In JAX-WS, a web service operation invocation is represented by an XML-based protocol, such as SOAP. The SOAP specification defines the envelope
structure, encoding rules, and conventions for representing web service invocations and responses. These calls and responses are transmitted
as SOAP messages (XML files) over HTTP.
The @WebService annotation defines the class as a web service endpoint.
The business methods of the implementing class must be public and must not be declared static or final.
Business methods that are exposed to web service clients must have JAXB-compatible parameters and return types.
The implementing class may use the javax.annotation.PostConstruct or the javax.annotation.PreDestroy annotations on its methods for lifecycle event callbacks.
The @PostConstruct method is called by the container before the implementing class begins responding to web service clients.
The @PreDestroy method is called by the container before the endpoint is removed from operation.

No comments:

Post a Comment