YOUR FEEDBACK
RingCube Announces Free Desktop Virtualization Software
C wrote: Why don't you guys ever link to the sites and products you discus...
SOAWorld $400 "Gold Pass" Savings Expire October 5 - Register Today!
Did you read today's front page stories & breaking news?

2007 East

  Diamond Sponsor:  
Laszlo
The Browser, the Portal, and the Desktop

  Platinum Sponsors:  

Adobe
'HDUX' - High Definition User Experience with Flex & Apollo
Cynergy
It Takes A Village: Building a World Class RIA Development Group
JackBe
The User is the Killer App. Empower Them!
Tibco
AJAX RIAs and the Service-Oriented Platform

      Gold Sponsors:     
Backbase
AJAX Best Practices
Helmi
Helmi Open Source RIA Platform
ICESoft
Secure Enterprise AJAX with ICEfaces
JetBrains
Is An IDE the Fifth Wheel or Sixth Sense?
Kapow
Serving Mashups from the Long Tail of the Web
Nexaweb
Enterprise Web 2.0 - Programming with Levers, Dials and maybe Switches
Click For 2006 Event Webcasts
SYS-CON.TV
TOP LINKS YOU MUST CLICK ON


Silverlight and Astoria - First Impressions
In short, an Astoria service is a WCF service that sits on top of an Entity Model that allows you to hit services with URLs

Digg This!

Kevin Hoffman's Blog

As you know, Silverlight is a new RIA enabling technology from Microsoft. Slightly less publicized but no less impactful is another technology from Microsoft - Astoria. Astoria is a tool that combines the power of the ADO.NET Entity Framework with the new enhanced power of RESTful POX services using WCF. In short, an Astoria service is a WCF service that sits on top of an Entity Model that allows you to hit services with URLs that look something like this:

http://server/service.svc/Customers/Orders[TotalAmount>25.50]

This will return a bunch of XML corresponding to all of the customer orders that have a total amount greater than $25.50. The syntax / query format of the URL itself is one of the things that makes the Astoria service so unbelievably powerful. You can sort, filter, limit, and paginate all from the URL itself, making client implementations incredibly easy, and incredibly well-suited to lightweight GUI frameworks like AJAX or Silverlight.

To keep it short and simple, here's what I did (using the "Orcas" beta 1 w/Silverlight toolkit installed AND Astoria toolkit installed):

  1. Create a new ASP.NET Web Application. Warning!! - I couldn't get this to work unless I created this using File -> New -> Project -> ASP.NET Web Application. For some reason, the current beta of Silverlight/Astoria have compatibility issues with File -> New -> Website.
  2. Right-click the ASP.NET Web Application and choose "Add new item", then pick "ADO.NET Entity Data Model". In my case, I generated it from an existing database that had a couple of sample tables, including a Ledger table containing transactions.
  3. Right-click the ASP.NET project and choose "Add new item". Pick "Web Data Service". Make sure it has the word data in it, otherwise you're going to get a vanilla Web Service and not an Astoria Web Service. There's a huge difference.
  4. Double-click your .svc.cs file and change the TODO item from a TODO comment to the actual classname of the object context created in step 2. In my case, this was FinanceManager.FinanceModel.
  5. Right-click the solution and choose "Add new Project", select "Silverlight Project".
  6. At this point, you should have a solution with a Silverlight project (make sure this builds), and a file-based ASP.NET web application that contains an entity data model. You should also have an Astoria service sitting on top of your EDM. To test things out before integrating Silverlight, build and run your app and hit the Astoria service, e.g. http://server/service.svc/tablename. You should get some XML showing you the contents of the table. If not, something went horribly wrong :) :)
  7. Now right-click the ASP.NET file-based web application and choose "Add Silverlight link". This will set your solution up so that your Silverlight app's DLL and any dependent DLLs will be copied to the client binary output directory of the ASP.NET application. You are not done!
  8. Drag a copy of silverlight.js from your Silverlight app to the ASP.NET app (you'll see why this is crucial shortly)
  9. Drag your TestPage.html file from the Silverlight app to your ASP.NET app. The reason you need to do this is because you will now be launching your Silverlight app from the ASP.NET app, not from the original Silverlight app location. This is because Silverlight cannot currently make cross-domain networking calls and you need to communicate using the BrowserWebHttpRequest object with the Astoria service.
  10. Now add some GUI to your Silverlight app, make a button responder, do some asynchronous stuff - all goodies you can find quick and dirty samples for elsewhere. Use the XmlReader object to consume the raw (no envelopes!! Down with WSDL!!) XML produced by the Astoria service.

In the end, I ended up with some "smoke test" (read: not yet pretty-fied) GUI that grabs Ledger entities from the Astoria service and uses the "ListBox" sample control from the SDK to do the rendering.

The transaction ID numbers and transactions actually came from my financial ledger service, which is an Astoria service sitting on top of an Entity Data Model.  

More to come!!

tags:    
links: digg this  del.icio.us  technorati  reddit

About Kevin Hoffman
Kevin Hoffman, editor of SYS-CON's "iPhone Developer's Journal" is one of the most popular "iPhone" and "Silverlight" bloggers on the Net. Kevin has been programming since he was 10 and has written everything from DOS shareware to n-tier, enterprise Web applications in VB, C++, Delphi, and C. He is coauthor of Professional .NET Framework (Wrox Press) and co-author with Robert Foster of Microsoft SharePoint 2007 Development Unleashed. Kevin authors "The .NET Addict's Blog" at ".Net Developer's Journal" (dotnetaddict.dotnetdevelopersjournal.com).

SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
In It? Reprint It! Contact advertising(at)sys-con.com for reprints!

Want to write? Send your article to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

ENTERPRISE OPEN SOURCE MAGAZINE LATEST STORIES . . .
Concurrent Expands NightStar LX Platform Support
Concurrent's NightStar LX debugging and analysis toolkit is now available for two additional Linux distributions - Red Hat Enterprise Linux 5 and openSUSE 10.2 from Novell. NightStar is an integrated Qt-based GUI tool set for developing and tuning time-critical 32-bit and 64-bit applic
MySQL AB to Optimize Its Open Source Database for SAP NetWeaver
MySQL AB has plans to optimize the MySQL Enterprise Server for the SAP NetWeaver platform. MySQL and SAP AG also announced that the sales and support of the MaxDB database will revert back to SAP, in order to unify the product's development, distribution, and support under one organiza
2007 Linux and Enterprise Open Source Readers' Choice Awards
SYS-CON's Readers' Choice Awards program, widely considered to be the most prestigious award program in the software industry, is a community-driven process in which the products participating in the program are nominated by the industry's vendors, customers, and users, as well as by t
Interface21 Partners with Tasktop to Develop Spring Tool Suite
Interface21 has partnered with Tasktop Technologies, creators of the Eclipse Mylyn project, to develop the Spring Tool Suite. This new Spring-specific tool solution will build on Eclipse and Mylyn to dramatically reduce the complexity of enterprise Java application development and main
Swedish National Police Move to Open Source Infrastructure
MySQL AB has announced that the Swedish National Police are implementing an enterprise-wide project for building all future IT systems on an open source software (OSS) infrastructure based upon Linux, MySQL, and JBoss. Several existing systems are currently being migrated and all futur
Levanta 6.0 Brings Automation Capabilities to Linux-Based Data Centers
Specialists in Linux data center automation, Levanta marries virtualization technology with comprehensive Linux life-cycle management. With the release of Levanta 6.0, Levanta adds end-to-end automation capabilities to its existing line of Intrepid Linux life-cycle management solutions
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
Receive Breaking i-Technology News as it Happens...
AJAX Newsletter
Java Newsletter
Open Source/Linux Newsletter
Microsoft .NET Newsletter
Flex Newsletter
Internet TV Newsletter
IT Solution's Guide Newsletter
 
SOA/Web Services Newsletter
Virtualization Newsletter
Web 2.0 Newsletter
ColdFusion Newsletter
PowerBuilder Newsletter
XML Newsletter
Eclipse Newsletter
Your E-Mail: 
State: 
Zip Code: 



TODAY'S TOP LINKS YOU MUST CLICK ON !
ADS BY GOOGLE