REST is not rest.


REST Services RS is just another way of representing web services, and its not just rest other than SOAP-WS.

What is it?
Its a full fledged service no less than any other computational system or to that matter its sister SOAP-WS. RS represnts a state of some resource at service side and upon request it changes the state and transfers that state to client, but resource remains.

So whats resource?
It can be anything and evrything you think of in the business context, e.g. You access Sydney's weather on weatherzone.com.au or it may be list from yahoo shoping.

Whats request? And how can i change state of the resource on service side?
A request should have 2 parts; HTTP method / VERB and actual parameters that can be a query string or a raw XML.
# if you want list it 'll be GET and query string with ? Followed by name-val pair.
# if want to change/add something POST and raw XML in HTTP request
Likewise there can be PUT for update, DELETE for delete function.

And response?
- Response is raw xml

What is JAX-RS?
- its java api for RS, nothing greek here. To implement few things are diff
# @WebServiceProvider
# @BindingType - HTTP
# @ServiceMode for just payload or whole message.
# Also to send and receive xml, you can use XmlEncode and XmlDecode.
# one more caution about exceptional handling it emits Http status code.

more on RS later...Till then..

Jai Ho

No comments:

Post a Comment