This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

[Messaging Styles & Message Exchange Patterns] Leonard Richardson and Sam Ruby  RSS feed

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Leonard, Sam,

If we compare the RESTful Web Services with the traditional Web Services, would we be still having the 4 Messaging styles of rpc-literal, doc-literal, rpc-encoded and doc-encoded?? and what about the Message Exchange Patterns (MEP's), one-way, request-response, notification and solicit-response? OR do we introduce new styles and MEP's?

*********************
Regards,
Dinesh Sundrani
---------------
SCJP 1.5 [86%]
SCWCD [95%]
SCDJWS [98%]
*********************
 
author
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dinesh,

Messaging styles and message exchange patterns are concepts from SOAP,
and they're not used in RESTful analysis. Sam will know better than I,
but I'm pretty sure that describing HTTP in terms of the SOAP concepts
gives you document-literal for the messaging style and
request-response for the MEP.

Of course, you can implement other styles and MEPs on top of HTTP
(that's what SOAP does), but in RESTful design your thinking is
oriented around different concepts: resources, representations, etc.

Does this help?
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also note that even traditional (SOAP-based) web services are limited to the one-way and request-response messaging patterns. Because they use HTTP as a transport solicit-response and notification aren't directly supported.
 
Dinesh Sundrani
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Leonard,

So the Web Service Client uses the available 4 verbs (below) for every noun.
GET - to fetch info
POST - to add info
PUT - to update info
DELETE - to remove info

Am in on the same page?


And

Yes, Peer!! I am aware of the fact that solicit-response & notification MEP's are not directly supported by SOAP over HTTP, we need to have some kind of callbacks and create corelation Id's to make it possible the asyncronous way.

*********************
Regards,
Dinesh Sundrani
---------------
SCJP 1.5 [86%]
SCWCD [95%]
SCDJWS [98%]
*********************
 
Leonard Richardson
author
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dinesh, yes, that's more or less right. There are some other auxilliary verbs like HEAD, and PUT can also be used to create new resources.
 
Dinesh Sundrani
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Leonard for making it clear!!

Also one more thing regarding Idempotence of these Web Methods.

POST is not an Idempotent methods, so do we need to take care of "multiple-accidental-clicks-for-credit-card-purchase-order" kind of problems in the RESTFul web service code itself when we are using POST URL's to expose the service (resource), so that we are sure that we don't double charge the customer and loose out on any further businesses with him??

*********************
Regards,
Dinesh Sundrani
---------------
SCJP 1.5 [86%]
SCWCD [95%]
SCDJWS [98%]
*********************
 
author
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

do we need to take care of "multiple-accidental-clicks-for-credit-card-purchase-order" kind of problems in the RESTFul web service code itself when we are using POST URL's to expose the service (resource)



Short answer: yes. But the good news is that there are standard patterns for doing this.
 
Sam Ruby
author
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More related information was posted today by Joe Gregorio.
 
I think I'll just lie down here for a second. And ponder this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!