Service-REST
REST – Representational State Transfer
What is stateless? – Stateful is
like somewhere you maintain the session. When you say stateless you don’t
maintain the session. When you create a case, case data is getting saved to the
database so, some transactions are there. But in REST you don’t do that you hit
the service and get the data. That’s it.
- Uses the HTTP protocol and perform CRUD operations using HTTP methods
- Can use XML, JSON, HTML
- REST APIs uses URI to identify the resource (That is called resource-based )
HTTP methods
GET method –
Can help with retrieving data/Resource – Similar to
Obj-Browse method
E.g.: - GetCustomerDetails
POST method –
Can help with creating resource
E.g.: -CreateClaimsRequest
(Must define the body)
PUT method –
Can help with updating a record
E.g.: - UpdateClaimsRequest
(There is no much difference in PUT and POST methods as both
methods need to define an activity which will determine what needs to be done)
DELETE method –
Can help with deleting resource – in a way similar to GET
method as it doesn’t need a body
E.g.: - DeleteFraudDetails
PATCH method –
Can help with partial updating resource
E.g.: -UpdateCustomerAddressDetails
Why REST is preferred over SOAP?
- REST messages are more light-weight than SOAP
- REST supports many message formats such as JSON,XML and HTTP but SOAP only supports XML.
- REST exposes service URI where as SOAP exposes the user interface.
- REST supports different HTTP methods where SOAP supports only POST
Steps to implement Service-REST
- Decide on application layer (situational layering).
- Create an integration data model (classes and properties).
- Create the service processing activity
- Create the service package (optional).
- Create the service-REST rule.
No comments:
Post a Comment