Windows Scripting
  Home arrow Windows Scripting arrow Creating a Silverlight 2.0 Application tha...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Creating a Silverlight 2.0 Application that Consumes a WCF Service
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2008-11-05

    Table of Contents:
  • Creating a Silverlight 2.0 Application that Consumes a WCF Service
  • Configuring for Silverlight
  • Writing Code
  • Adding a Project

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating a Silverlight 2.0 Application that Consumes a WCF Service


    (Page 1 of 4 )

    This is my second article in a series focusing on Silverlight 2.0 (beta 2) development using Visual Studio 2008. This article is for beginners who are quite new to Silverlight development and need a practical introduction to developing Silverlight applications which consume WCF services using Visual Studio 2008.

    If you are new to Silverlight 2.0 development, please refer my first article in this series titled “Beginning Silverlight 2.0 Development Using Visual Studio 2008.”

    If you want to learn about the WCF Service and the WCF Service Library, consider reading my WCF articles listed at http://www.aspfree.com/cp/bio/Jagadish-Chatarji.

    In this article, we will create a new WCF Service and consume it using the Silverlight 2.0 application. Technically, we will have a Silverlight 2.0 Datagrid control consuming rows from a regular WCF Service.

    My development machine is equipped with following environment:

    • Windows Server 2003 with SP2

    • IIS

    • SQL Server 2008

    • Visual Studio 2008 (comes with .NET 3.5) with SP1

    • Microsoft Silverlight Tools Beta 2 for Visual Studio 2008 (includes Silverlight, Silverlight SDK and Tools for VS 2008)

    To make this article simple, I created a new database named “Sample” with the following table (“emp”) on my machine (Fig 01):


    The entire source code for this article is available in the form of a free downloadable zip file. The solution was developed using Microsoft Visual Studio 2008 Team Edition (with SP1) with Microsoft SQL Server 2008 Developer Edition on Microsoft Windows Server 2003 Standard Edition (with SP3) with Silverlight 2.0 Beta 2. I didn’t really test it in any other environment. I request that you post in the discussion area if you have any problems in execution.

    Developing WCF Service using Visual Studio 2008: Creating the project

    Let us start our development with WCF Service.

    Create a blank solution (DemoSln) as follows:


    • Go to File || New || Project.

    • At the top of the “New Project” dialog, make sure that you have selected “.NET Framework 3.5” as your target .NET version.

    • In the “Project Type” (left pane of “New Project” dialog), open “Visual Studio Solutions” in “Other Project Types.”

    • In the “Templates” (right pane of “New Project” dialog), select “Blank Solution.”

    • Provide “DemoSln” as the "Name," your own location, and click “OK.”

    Add a new WCF Service Application as follows:

    • Go to File || Add || New Project (to the existing solution).

    • In “Add New Project,” make sure “.NET Framework 3.5” is selected at the top.

    • Open “Visual Basic” || “Web” in the “Project Types” list.

    • Select “WCF Service Application” as the template.

    • Provide “DemoEmpService” as the name (Fig 02) and click on “OK.”


    More Windows Scripting Articles
    More By Jagadish Chaterjee


       · Hello guys,This is my second article in series focusing on "Siverlight 2.0...
     

    WINDOWS SCRIPTING ARTICLES

    - Working With Arrays in VBScript
    - Compressed Folders in WSH
    - Using .NET Interops in VBScript
    - Nilpo`s Scripting Secrets, Vol I
    - Database operations using Silverlight 2.0 WC...
    - Modifying XML Files in WSH
    - Reading XML Files in WSH
    - Visual Basic 2005 XML Programming Using XML ...
    - Creating an XML Document in WSH
    - Introducing Two-Way Data Binding using Silve...
    - Silverlight 2.0 Application Development with...
    - Burning Multisession CDs with IMAPI2 in WSH
    - Creating a Silverlight 2.0 Application that ...
    - Burning CDs with the IMAPI2 Control
    - Burning CDs in Windows XP with WSH

     
    Best Practices for Windows Vista Migration Presentation
    Dell and Microsoft recently held a series of face-to-face seminars entitled, &qu....

     
    Creating a Culture for Code Reuse
    If you oversee development teams you know that like it or not proprietary and ex....

     
    Keys to Web Application Acceleration: Advances in Delivery Systems
    Accelerate Web apps by up to 5x. Ensure significantly faster access to the Web a....

     
    Optimizing Application Monitoring
    Tired of finding out from your customers that you're offline? This white paper e....

     
    Solaris to Solaris Migration -- Migrating applications from Sun SPARC to Dell PowerEdge R900
    This comprehensive Migration Guide reviews the approach that Principled Technolo....

     




    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT