Silverlight TV 26: Exposing SOAP, OData, and JSON Endpoints for RIA Services

Play Silverlight TV 26: Exposing SOAP, OData, and JSON Endpoints for RIA Services

The Discussion

  • User profile image
  • User profile image

    Is it the intention that RIA and WCF Data Services will become one technology in the future? When update support is added, will that leave any unique features of Data Services?

  • User profile image

    Great Video Smiley


    Great to know the power of RIA service for WPF, WinForms and especially Win Mobile application. When can we expect the Update support...? any probable date ?



  • User profile image


    There is update support for both JSON and SOAP endpoint today.

    Thanks Deepesh

  • User profile image

    This is great, thanks... can you tell me how I then configure all the DataServiceConfiguration properties that I normally would in DataService<T>.InitializeService when using oData in the 'normal' way?

  • User profile image

    When using SOAP to access the WCF methods, the whole idea of passing the objectquery (from ria services client to server) does not work.

    In the Ria Services I have the method :

    public IQueryable<Item> GetItems()


      return this.Context.Items;


    And In my database there are 10 items.

    When executing this in silverlight client like:
    var items = srv.GetItems().Take(5);

    There are only 5 items retrieved from database.

    But when using a normal SOAP call, the method call
    var items = srv.GetItems().Take(5);

    retrieves all 10 items from the database and does a Take(5) on the client only.

    Is this correct ? Is there a way to avoid this?

  • User profile image

    how can i pass parameters to the json endpoint?

  • User profile image


     As this is a frequent topic during my customers’ meetings, I’ve used your excellent webcast: “Silverlight TV 26: Exposing SOAP, OData, and JSON Endpoints for RIA Services” as a base to write a series of articles on my blog. The first 4 articles are online :

    1 – Review of the initial application: 
    2 – How to expose the service as an OData stream consumed by Excel and from a web application built with WebMatrix
    3 – How to expose the service as a “standard” WCF Service used from a WPF application and a Windows Phone 7 application
    4 – How to expose the service as a JSON stream to be used by a HTML5/jQuery web application 
    5 – Step by step procedure to publish this WCF RIA Services application to Windows Azure & SQL Azure

     And I’ll try to write the last one before going on vacation. I’ve got the same articles in French also.

     The main Silverlight application is hosted in Azure here: and I’ve just slightly modified the original application to add a viewbox control and some webcam logic while you create a new user.

     The second article uses WebMatrix and its OData helper to connect to the OData feed of WCF RIA Services. I’ve tried also to explain the differences with the OData feed available with WCF Data Services.

     The third article shows simple WPF & Windows Phone 7 clients connected to the SOAP endpoint and handling the authentication cookie.

     The fourth article shows an HTML5/jQuery application displaying the books in a fun way using the Galleriffic jQuery plug-in, some CSS3 and an animation based on <canvas>.You can test it here in IE9 (or Chrome/FF/Opera/Safari) : . I’m also talking about the way to add/delete items with the JSON endpoint.

    Enjoy !

    David Rousset

  • User profile image

    Shouldn't you just be able to expose the methods via the standard decoration of the method like in a regular WCF service?

    For example:

    Create contract: IAdventureWorks.cs

    public interface IAdventureWorks
    IQueryable<Product> GetProducts(); [OperationContract()]
     Product GetProduct(int id);

    Implement in your DomainService and decorate method with WebGet(..) : AdventureWorks.cs

    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class AdventureWorksService : LinqToEntitiesDomainService<AdventureWorksEntities>, IAdventureWorks
      [WebGet(UriTemplate = "Products", ResponseFormat = WebMessageFormat.Xml)]
      public IQueryable<Product> GetProducts()
       return this.ObjectContext.Products;
      }  [WebGet(UriTemplate = "Products?id={0}", ResponseFormat = WebMessageFormat.Xml)]
      public Product GetProduct(int id)
       return this.ObjectContext.Products.Where(p => p.ProductID == id).FirstOrDefault();  }


    Add .svc to Web Project : AdventureWorksExtService.svc

    <%@ ServiceHost Service="ServiceExample.Web.Services.AdventureWorksService"%>

    Add necessary config settings to web.config.


    I realize that is not the case, but would follow the conventions that WCF has establiished outside of RIA.  Future addition?

Add Your 2 Cents