Silverlight TV 26: Exposing SOAP, OData, and JSON Endpoints for RIA Services
- Posted: May 13, 2010 at 8:04 AM
- 68,677 Views
- 9 Comments
Download
How do I download the videos?
- To download, right click the file type you would like and pick “Save target as…” or “Save link as…”
Why should I download videos from Channel9?
- It's an easy way to save the videos you like locally.
- You can save the videos in order to watch them offline.
- If all you want is to hear the audio, you can download the MP3!
Which version should I choose?
- If you want to view the video on your PC, Xbox or Media Center, download the High Quality WMV file (this is the highest quality version we have available).
- If you'd like a lower bitrate version, to reduce the download time or cost, then choose the Medium Quality WMV file.
- If you have a Zune, WP7, iPhone, iPad, or iPod device, choose the low or medium MP4 file.
- If you just want to hear the audio of the video, choose the MP3 file.
Right click “Save as…”
- High Quality WMV (PC, Xbox, MCE)
- MP3 (Audio only)
- MP4 (iPod, Zune HD)
- Mid Quality WMV (Lo-band, Mobile)
In this video, John meets with Deepesh Mohnani from the WCF RIA Services team. Deepesh demonstrates how to expose various endpoints from WCF RIA Services. This is a great explanation and walk through of how to open RIA Services domain services to clients, including:
- Silverlight clients (of course)
- Creating an OData endpoint and showing how Excel can use it
- Creating a SOAP endpoint to a domain service and using it from a Windows Phone 7 application
- Creating a JSON endpoint and having an AJAX application talk to it
Relevant links:
- John's Blog and on Twitter (@john_papa)
- Deepesh's Blog and on Twitter (@deepeshm)
- More about RIA Services
Follow us on Twitter @SilverlightTV or on the web at http://silverlight.tv/
Comments Closed
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
You can find the source code here :- http://blogs.msdn.com/deepm/archive/2010/05/14/silverlight-tv-episode-26-exposing-soap-json-and-odata-endpoints-from-ria-services.aspx
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?
Great Video
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 ?
Smitha,
There is update support for both JSON and SOAP endpoint today.
Thanks Deepesh
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?
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?
how can i pass parameters to the json endpoint?
Hello,
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: http://blogs.msdn.com/b/davrous/archive/2010/11/10/how-to-open-a-wcf-ria-services-application-to-other-type-of-clients-review-of-the-initial-application-1-5.aspx
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: http://bookclub.cloudapp.net 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) : http://bookclub.cloudapp.net/WCFRIA_jQueryHTML5.html . I’m also talking about the way to add/delete items with the JSON endpoint.
Enjoy !
David Rousset
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
[ServiceContract()] public interface IAdventureWorks { [OperationContract()] 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
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?
Remove this comment
Remove this thread
close