.NET Framework 4.0 to become less SOAP-centric, embrace REST

By Scott M. Fulton, III | Published October 1, 2008, 5:37 PM

(continued from previous page)

What's the difference between REST and SOAP, really? The two implementations of Web services architecture are actually completely different; they may accomplish much the same results, but they go about their jobs in entirely separate ways.

With SOAP, each Web service has its own URL, and a request made of that URL is submitted as a message in an XML enclosure. Each request uses an instruction that's part of the namespace of the service, which is itself explained through an XML scheme called Web Services Description Language (WSDL). So a Web client passes a message to the service, using the lexicon outlined by WSDL and enclosed in a SOAP envelope. The service then responds with results that are enclosed in a very symmetrical fashion, so that the queried element and the response tend to match up.

The key benefits of SOAP are that it is transport-agnostic (just because it uses HTTP now doesn't mean it has to in ten or fifteen years' time), and that it's easy to associate a Web service with an appropriate URL. That makes directories of Web services easier to assemble.

REST is actually a bit simpler to explain, especially to someone who hasn't grown too accustomed to SOAP. Unlike SOAP, REST relies entirely on HTTP. But because of that, its request language is already known; there are only four "verbs" in REST which translate directly to the GET, POST, PUT, and DELETE. So the need for WSDL on the request side is completely thwarted.

With REST, the item of data the client requests -- not the Web service itself -- is the target of the URL. For example, the field where a customer's surname would appear in a database may be the URL, whereas in SOAP, the URL refers to the service to which a request for that surname would be placed in an envelope. The server responds with a message in an XML envelope that pairs both the item that was requested and its response, which makes it easier for an auditing application to account for data transactions.

Is REST necessarily an easier way to go? It is if you're developing applications using a new concept called the model view controller scheme. These are the "composite" applications to which Microsoft's marketing literature refers; they involve three separate components which may be programmed in completely different languages, and may be running on separate processors. The model component sets up the data that's the subject of an application, whereas the view component prepares a meaningful relationship of that data for a human reader. This tends to translate well to systems where JavaScript or dynamic language code can do the modeling, and HTML can set up the view. The controller may be a server application that maintains the active state and integrity of the database.

It's an extremely sensible way to think of a network application, and it may be much easier to develop such a system because the three aspects of maintaining it can be delegated to separate development teams. But it almost mandates that the "what" of the application -- the part which the model component is setting up, and the view is preparing to lay out -- have a discrete name, without relying upon some Web service to give it a name later on during the transaction process. That's where the REST model may be a better fit.

Last November, Microsoft unveiled something called the ASP.NET Model View Controller Framework at a developer's conference in Las Vegas. There, one of the company's non-employee MVPs, author Dino Esposito, noted what he perceived to be the new framework's key benefit.

Summing up that benefit for his blog, Esposito wrote, "It uses a REST-like approach to ASP.NET Web development. It implements each request to the Web server as an HTTP call to something that can be logically described as a 'remote service endpoint.' The target URL contains all that is needed to identify the controller that will process the request up to generating the response -- whatever response format you need. I see more REST than MVC in this model. And, more importantly, REST is a more appropriate pattern to describe what pages created with the MVC framework actually do."

That's a sentiment Microsoft evidently took to heart. As Corporate Vice President Scott Guthrie wrote in describing his team's MVC implementation, "It includes a very powerful URL mapping component that enables you to build applications with clean URLs. URLs do not need to have extensions within them, and are designed to easily support SEO and REST-friendly naming patterns. For example, I could easily map the /products/edit/4 URL to the 'Edit' action of the ProductsController class in my project...or map the /Blogs/scottgu/10-10-2007/SomeTopic/ URL to a 'DisplayPost' action of a BlogEngineController class."

PDC in Los Angeles is a little over four weeks away, and BetaNews will be there to see how the first public betas of .NET 4.0 with REST perform in comparison to their predecessors.

← Previous Page | 1 | 2

Comments

View comments by with a score of at least

Why is microsoft always copying the sun,s product?

Score: 0

|

Good article for this site yet quite behind the times.

The MVC pattern is not new but around long enough that it was core of many now redundant technologies and mayor systems driving the world's economy are build with SOAP/REST based on the architects decisions, which are based on business requirements. (unlike which OS to support on BN of course!!! :))

I don't have firm dates but REST is around since 2000 and SOAP since the last millennium... No need to panic...

Score: 0

|

Indeed, REST has been around for that long, but as I'm sure you'll agree, Microsoft has taken that long to catch up. And as a result, a lot of the world has to catch up along with it.

-SF3

Score: 0

|

I am sure it helps exposing it to greater masses but MSFT enterprise systems have it in active usage. I guess this all ties into the 'Windows Cloud' thing and for what it's worth .NET client / Java server systems are not going away that soon so hopefully it makes it lighter on the UI devs.

Score: 0

|

So basically Microsoft is about to drop the SOAP.

Score: 0

|

I hope steve jobs is not entering the showers too . . :S

Score: 0

|

I just wish they would make it so you wouldn't have to have multiple versions of Framework installed. The 3.5 framework should be all I need installed to run anything 3.5 based and before. No, I'm not a programmer anymore.. so what Im saying is pretty ignorant. But it's sort of like Java. I only (usually) need one version of JRE installed (the newest) and things run fine. On this computer (my rm's), it has 4 different versions of Framework.. And even more annoying.. If something screws up, like ATI's Catalyst, because there's something wrong with Framework 2.0.. It's a pain to fix (sometimes). anyway, sorry, ranting.

Score: 0

|

You don't have multiple versions of the .Net Framework. You have additions to the 2.0 Framework.

2.0 is the Framework. 3.0 just adds a few more dlls to the 2.0 Framework. 3.5 adds 4 more dlls to the 3.0 Framework. So think of 3.0 and 3.5 as expansion packs not full frameworks.

Score: 0

|

The whole point of .NET is that you load the version you need when you need it. They don't all sit in RAM when they're not in use. That is also why there is no backwards compatibility - it's not needed. Why would you want to load all of .NET 3.5 when you run 1.1 applications? Just load 1.1 and call it a day. Yes, it costs more disk space if you install all of them but it also is less RAM intensive.

.NET was designed to be truly version independent in the way descrined above as Java promised it would be and failed abysmally. I'm no fan of MicroSoft but this really does work.

Score: 0

|

users and sysadmins hate .net. Very little benefit for us and a lot of pain.

Developers and Microsoft love it.

Score: 0

|

What about 1.1?

Score: 0

|

Yes, you do have multiple version of .Net Framework.

I have seen applications which required:
- specific language version of 1.1 (worked with one, did not with another)
- specific patch level of 1.1 (or Hasta la Vista, dear Sharepoint)
- required specifically 2.0 SDK
- required 2.0 with sp1
- required 3.0
- required 2.0 and failed to work if there was 3.0 or 3.5 installed (ATI, 8.9 Catalyst, Vista x64)

In short, .Net Framework is one of the most poorly implemented concepts in history... not to mention huge memory footprints, elaborate yet vague error messages and messily distributed access rigths management.

However, on a small scale, with simple applications or with responsible developers who take pains to support them, .Net works fine. Just don't try to build any large scale solutions with that.

Regards,
Ruemere

Score: 0

|

'A pivot from war to peace:' The AMD + Intel armistice, in their own words

An extraordinary day in technology history is recognized by two long-time rivals that mutually decided it's futile to fight anyplace else except the marketplace.

PS3, Xbox to soon get Twitter, Facebook integration

Both Microsoft's Xbox 360 and Sony's PlayStation 3 will integrate with Facebook in the near future.

Windows Marketplace for Mobile now available in browser, iTunes' App Store still not

You can now check out what Windows Marketplace for Mobile has to offer without a Windows Phone.

Microsoft damage control after marketer claims Win7 inspired by Mac

Have you ever said anything you wish you could take back? Ever? No? Not even once? Well then, you won't sympathize with a mid-level Microsoft manager today.

Blockbuster's way down, but poised for a comeback

Though it took a serious beating in 2009, Blockbuster CEO Jim Keyes says the company can turn it around.

iTunes Preview deson't go far enough to create Web-based option for store

Apple has rolled out iTunes Preview, a Web interface for browsing iTunes.

PDC 2009 Preview: The move to Office 2010 and Visual Studio 2010

The major focus of Microsoft's conference next week will likely be explaining why two pillars of its software sales strategy deserve to remain where they are.

Dell's first smartphone aids the Android onslaught

Longtime PC leader Dell has finally announced its Android-based smarphone.

After the Intel + AMD armistice: Do we really want a level playing field?

Scott Fulton On Point: One by one, the reasons for us to continue suspending the course toward open and fair competition in IT, are dropping like flies.

FLO TV launches pocketable, smartphone-like TVs

Qualcomm's FLO TV Personal Television made by HTC launches in retail today.

Google acquires Gizmo5, builds IP telephony portfolio

Google Voice today confirmed rumors that it would acquire IP telephony company Gizmo5