Amazon.com Widgets

.NET Client Application Services

Update:  hree are some MSDN docs that cover this topic: Exposing Web Services to Client Script and ASP.NET Application Services Overview  

One of my favorite features in Orcas is the ability to leverage the ASP.NET Application services from any client application (ASP.NET, Ajax, WinForms, WPF, or even Silverlight!)..  This allows you to do things like share a common membership, role management and profiles across a number of presentation tiers.  It also enables very easy roaming user state...

Check out how easy it is to use the profile store... here I am using Windows Authentication, but of course you can use forms or your own system just as well.  In fact any system can be rolled into the ASP.NET Auth system (there is a whole book on the subject).

 

Part 1: Create the web site.

1. In Orcas Beta1, Create a new ASP.NET Web Application

2. Fill in the profile section of the web.config.  Notice, you have to enable anonymous for the client designer functionality in Beta1 to work...

3. Enable this property to be accessed via web services by adding this section to Web Config

 

Part 2: Create the client app.

1. Right click on the solution and add a new project (works the same for WPF or WinForms)

2. Right click on the new client project and select properties

3. In the Services tab, enable application services, select windows auth and fill in the services url.  For now it is the development server, URL, in production this would be your ASP.NET web site.

 

4. In the settings tab, click on Load Web Settings... this will pull down all the metadata for the profile properties you defined on the server.     You can just hit "skip login" on the prompt for you credentials... Because we enabled anonymous auth, it is not needed

 

You are now ready to go!    You can have strongly typed, async read-write access from WPF, WinForms, Silverlight, ASP.NET and Ajax.  And all the user settings will stay in sync no mater where you change them, they are reflected everywhere!

 Check out a few examples

ASP.NET Server side code

Client side JavaScript

 

 

See the attached solution for all the code!

 

Looking for more?

 

Client Application Services in Windows Forms: End-to-End Walkthrough Available

What’s new in for clients apps in Orcas deck

Client application Services Screen webcast

Information about SQL Server Compact - Offline rocks! 

DEV10 - Extending the Browser Programming Model with Silverlight

Update... You can get the demo code for how to do this from Silverlight here.. The StockClient/StockService samples make use of the profile (to store the selected stock symbol) and isolated storage (to cache the stock data of the selected stock symbol).

Published 23 May 07 08:40 by BradA
Attachment(s): AppServicesDemo.zip

Comments

# Brad Abrams : .NET Client Application Services said on May 24, 2007 12:14 AM:

PingBack from http://blogs.msdn.com/brada/archive/2007/05/23/net-client-application-services.aspx

# Anon said on May 24, 2007 7:50 AM:

"presentation tears."...tears...as in crying. I think you mean Tiers.

# Jason said on May 24, 2007 7:57 AM:

Thanks for this great nice post, but now I have tiers in my eyes, because the images are so blurry and very hard to read :)

# BradA said on May 24, 2007 10:10 AM:

Thanks, I fixed the type-o...

Jason - Sorry about theimages, I know they suck... I tried to resize a bit to make them more clear... But no luck.. I am open to suggestions ;-)  The full code is attached, feel free to read it iin your editor of choice!

# Don said on May 24, 2007 2:48 PM:

Please tell me that the blurry screenshots are because you dialed in too much compression and not because you used the camera on your phone to take screenshots.

-Don

# Daniel Moth said on May 24, 2007 3:45 PM:

Client Application Services in "Orcas"

# Damian said on May 25, 2007 7:06 AM:

Those blurry images... are you pasting into Windows Live Writer? If so don't  use drop shadow border option.

# Nicholas said on May 29, 2007 4:47 PM:

Damian,

It doesn't matter. Live Writer eats the images up any way you slice it. I've mentioned this bug to them multiple times and have yet to see a fix. It's the main reason why I still use BlogJet (and pay for it..)

# preeti said on May 31, 2007 3:40 AM:

good

# Brian said on May 31, 2007 5:03 PM:

"You are not ready to go!"  I assume you meant "You are now ready to go"?  Or is this one of those "Paging Dr. Freud" moments? :)

-B

# BradA said on May 31, 2007 6:18 PM:

Brian -- thanks!  fixed!

# Mike Taulty's Blog said on June 3, 2007 6:05 AM:

I spent my first few minutes experimenting with the new Client Application Services in "Orcas" today...

# Guy Burstein's Blog said on June 3, 2007 2:12 PM:

This Teched in Orlando the new client application framework called " Acropolis " will be announced. From

# どっとねっとふぁんBlog said on June 4, 2007 4:42 AM:

.NET Client Application Services Client Application Services in Windows Forms: End-to-End Walkthrough...

# Beth Massi - Sharing the goodness that is VB said on June 7, 2007 1:47 AM:

In my first post on parameterized queries I built a simple login form that really was a contrived example

# Beth Massi - Sharing the goodness that is VB said on June 7, 2007 1:48 AM:

In my first post on parameterized queries I built a simple login form that really was a contrived example

# alikl said on June 7, 2007 3:04 AM:

Re blurry images - in Live Writer use "Inherit From Web Log" option for borders configuration, try it and you will notice the difference immediately

# Fred said on July 28, 2007 3:23 AM:

Is there any way to link things in a bigger way than simply sharing the backend authentication / profiles providers functionality? I'm interested in using a WPF application to leverage it's great UI facilities, but maintaining an existing ASP.Net Web Application for most of what I need to do. Is there any way I can provide a click-through experience, where a user that is authenticated in my WPF application can seamlessly enter the web-app without needing to supply credentials again? Having only one membership, roles and profiles store is great, but linking things up on the UI is almost as important!

- Fred

# Szymon Kobalczyk's Blog said on August 9, 2007 2:11 AM:

Our first .NET geek dinner was great!

# Nick's .NET Travels said on August 29, 2007 10:00 AM:

One of the neat features that Windows Forms developers get with the .NET Framework 3.5 and Visual Studio

# Noticias externas said on September 8, 2007 4:30 AM:

Today, let me talk about enhancements to ASP.NET that you will see with Visual Studio 2008 and .NET FX

# Joycode@Ab110.com said on September 11, 2007 6:23 AM:

[原文地址] ASP.NET enhancements in VS2008 and .NET FX3.5 [原文发表时间] Saturday, September 08, 2007 12:24 AM 今天

# Brad Abrams said on May 5, 2008 10:31 AM:

In ASP.NET 2.0, we introduced a very powerful set of application services in ASP.NET ( Membership , Roles

New Comments to this post are disabled

Search

Go

This Blog

Syndication

Page view tracker