.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

|

PDC 2009: What have we learned this week?

There was the freebie that no one will forget, the heebie-jeebies courtesy of Scott Guthrie, and a teensy bit clearer picture of how this cloud thingie should work.

Live report: Will Google Chrome OS change Linux?

The mysteries of just what Chrome OS is, and how much of an operating system it truly is, may be resolved today.

PDC 2009: Microsoft cares about Web browser performance

The effort to give users of the world's dominant Web browser the impression of quality, is a personal one for the man who leads that battle.

Nokia re-affirms its commitment to Symbian, sort of

Maemo won't necessarily be replacing Symbian in the Nokia N-Series, but that's definitely a place where it will be found.

E-book readers will be in short supply this holiday season

E-readers are hot this year, and a lot of compelling new products have been released, but are there enough electrophoretic displays to go around?

Sony looks to finally open a single storefront for downloads

Sony has had many different download portals for movies, music, e-books, and games, and now it's looking to make a single shop for all of it.

Tuning out the tablet: Time to give the endless speculation a rest

Wide Angle Zoom: Wishing and hoping and thinking and praying....won't put an iTablet on the market.

Five improvements for IT managers in 2010

If businesses are to improve their efficiency for next year, they need to stop and reassess the basic tenets of their job.

AOL's spinoff from Time Warner to shed 2,500 jobs

As AOL moves toward become an independent company again, it will cut nearly a third of its workforce.

Gartner: SMS-based money transfer will be bigger than mobile browsing, search

Gartner issues its predictions for the 10 things our phones will be doing in 2012.

Don't forget to upgrade to Firefox 3.6 beta 3 today

Mozilla has released the latest beta its Firefox 3.6 browser software, just over one week after beta 2.