views:

72

answers:

2

Hi there,

i have been reading a little about REST services and i would love to know more.

I wonder if anyone can confirm, currently we have a wcf web service (ending in .svc) and we have many clients accessing (i.e. form linux, max and PC) ...

if i was to change my server to use REST then would the clients break?

+2  A: 

Well, the two world are really SOAP vs. REST.

The "normal" WCF services using NetTcpBinding, basicHttpBinding, wsHttpBinding etc. are all using SOAP - your message is embededded in a SOAP envelope and sent across the wire, and the response comes back the same way. That's why you can't just point your browser to a WCF service and get data - browsers can't send and receive SOAP messages.

Advantages of SOAP: you have things like WSDL/XSD to clearly and very strictly define what your service does and what kind of data you send around.

REST is a totally different beast - no more SOAP, no more WSDL and XSD, no more creating a client that knows about the data types being shuffled back and forth - you just have URL's which represent resources, and you get back some XML - not a whole lot of system support for describing WHAT that XML will be - you'll have to hope the developer of the REST service provides some documentation about what can be retrieved, and what it looks like.

So REST is a totally different beast than SOAP, and it's implemented in WCF using the webHttpBinding.

So if you have existing "traditional" WCF service and clients, and you now switch your service to REST, then yes - 100% sure you'll break EVERY client....

Marc

marc_s
+2  A: 

If you CHANGE the service to be a RESTful format, then yes...existing clients would have to change.

If you ADD a RESTful endpoint and kept the existing endpoint as well, then no...existing clients could continue to use the old endpoint until they migrated their code to use the new RESTful endpoint.

Justin Niessner
good point - the existing endpoints could be left in place, and new endpoint(s) with REST could be added, thus not breaking anything ;-)
marc_s
Thank you... I understand now..
mark smith