• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

WCF and REST

complete

Weaksauce
Joined
Aug 30, 2005
Messages
92
As far as I can tell REST is a methodology or an archecture. Is it a real tangable thing? I mean, can you look at a back-end code and determine if it is REST or not REST? How do you communicate with a WCF RESTful service? Are all WCF services RESTful?
 
As far as I can tell REST is a methodology or an archecture. Is it a real tangable thing? I mean, can you look at a back-end code and determine if it is REST or not REST?

REST is more of a philosophy than anything concrete. Whatever you build, you can probably find some people who think it's clearly REST, and some who think it's clearly not REST. (Unless you're building SOAP, or you go seriously crazy). If you really want to piss the crazy REST people off, ask them what should be the the resource for one squid, and what should be the resource for a collection of squid, and how the f*** your server can tell the difference (given that squid is the plural of squid). If they want context, tell them you have a pet store or something.

If you have people saying one of your requirements is that you build 'RESTful services', ask them to define it specifically, and also specifically why they want it. People often say that RESTful services are easier to use, but really, most of the URL is just magic words that you copy from the documentation. Is it nice when the magic words happen to line up with how you might think of them, sure? But is there really a huge difference between /squid/bob and /animals.php?type=squid&name=bob (answer: yes, clients are more likely to fuck up url encoding bob in the first example, and server devs are more likely to be confused that animals.php is actually a C# program in 10 years when they're doing maintenance)
 
As far as I can tell REST is a methodology or an archecture. Is it a real tangable thing?

Is any software really "tangible"? I'm not sure how to answer that!

I mean, can you look at a back-end code and determine if it is REST or not REST?
Sure. From a WCF perspective, you can look at the service endpoints to determine what's deployed. You can also look at the code and deduce what is being deployed. Take a look at this MSDN resource: http://msdn.microsoft.com/en-us/magazine/dd315413.aspx

How do you communicate with a WCF RESTful service?
You communicate with a RESTful service using URIs and the HTTP standard methods (GET, PUT, POST, DELETE, and perhaps HEAD as well). How the data is returned depends on resource representation... it can be plain text, XML or JSON, etc.

You perform an HTTP method listed above against the URI and the web service will send you the result. Twitter has a pretty powerful REST API that's fairly straightforward and includes examples. The way you communicate with a RESTful service is independent of the langauge/framework used to build it. As far as I know, Twitter's REST API was not built with WCF.

Are all WCF services RESTful?
No. It depends on what is built and what is deployed. WCF lets you build web services using the standard of your choice.
 
Back
Top