Geeks With Blogs
mikedopp Geekswithblogs (edition)

Using new features in .NET 3.5 Framework.




What in .NET 3.5 for services:


  • The New HTTP Programming model:
  • New support JSON Services
  • Syndication in .NET 3.5

Service Stack Evolution



one stop shop for services

Myth:WCF is only for enterprise services

Reality:WCF gets around(enterprise and web)

.NET 3.5 WCF web-centric upgrades:

  •    Make REST a 1st class citizenish
  •    Embrace SOAP-less representations
  •      JSON messaging capabilities
  •      Simple working with POX
  •     RSS & Atom syndication support

Run in partial trust (hosting) cool!

Promote web concepts to top status by simplifying the (mapping URIs to application logic, working with HTTP methods and working with Response codes & HTTP Headers)

Support for SOAP/RPC & REST from one or same application.


.NET 3.5 additions:


  •    Type for modeling URI to app semantics
  •     Bind Data to a template, output to URI
  •    Match a URI to a template, retrieve data


  •     Returned from UriTemplate "match"
  •    Get relative paths



Simple URI-to-application mapping -Defaults to query string parameters


Http verbs in WCF Contracts

  •    View it vs Do it separation mimics web

Specify Data Format in WCF:

WebOperationContext.Current provides access to incoming request headers

  • Can also set outgoing response headers

Bindings and ServiceHosts:

WebHttpBinding and WebServiceHost

  • Use WebServiceHost/Factory in most cases

WebHttpBinding endpoint on a ServiceHost

  • Add webhttpBehavior to the endpoint

Interpretive dance of solution for DEMO.

Cassini for services. Sounds fun.

How to reverse a string demo. *you need to know this if you want a job at Microsoft.

public string someMethod(string, input)


char[] chars = input.ToCharArray();


return new string(chars);


Go ahead and cheat. its ok.

0 config setup. Service host holds your config info.

use imperative 'approach"or web.config is by default.


JSON-centric Types:

  • JsonReaderWriterFactory

  -creates XmlDictionaryReader/Writer objects

  • DataContractJsonSerializer

  -Bridges objects & JSON

JSON messaging:

  Set requestsFormat/ ResponseFormat

WebHttpBehavior to endpoint

Intergrates with AJAX

  WebScriptEnablingBehavior to endpoint


Use WebScriptServiceHost/Factory for automatic endpoint creation (0 config)


I have got to get working on this.


Posted on Thursday, March 6, 2008 6:02 PM | Back to top

Comments on this post: MIX08-Building Applications and Services with .NET Framework 3.5

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © mikedopp | Powered by: