Why My WCF Data Service isn’t Returning JSON Format?

Monday, January 28, 2013

Why My WCF Data Service isn’t Returning JSON Format? Lately, I had the need to use WCF Data Services in a project. It has been a while since I used and wrote about WCF Data Services and a lot was changed in the framework. The scenario I needed to implement was calling a data service using jQuery. So I wrote the relevant service and used the code I wrote a few years ago and nothing happened… I got a HTTP error – HTTP Error 415 Unsupported media type. Since I know that WCF Data Services support JSON format,...
2 comments

WCF Data Services Processing Pipeline

Monday, May 2, 2011

WCF Data Services Processing Pipeline First I must confess. Even tough I like OData and WCF Data Services, in the last couple of months I didn’t have the chance to work or use them. This is why when .NET 4 was shipped I haven’t noticed a new and interesting extension point in the framework – the processing pipeline. In the last MIX11 I got a little introduction to that extension point in Mike Flasko’s session. In this post I’ll explain what is the WCF Data Services' server side processing pipeline. WCF Data Services Processing Pipeline In...
no comments

Making a JSONP Call to a WCF Data Service using datajs

Sunday, April 24, 2011

Making a JSONP Call to a WCF Data Service using datajs During MIX11 I attended a very interesting session about datajs which was presented by Asad Khan and Marcelo Lopez Ruiz. As I promised in my previous post, in this post I’ll show you how to make a JSONP call to a WCF Data Service using datajs library. A Little About datajs datajs is a very promising JavaScript library which is currently being built by Microsoft as an open source in CodePlex. The library as described in its CodePlex site is “a new cross-browser JavaScript library...

Combining WCF Data Services, JSONP and jQuery

Combining WCF Data Services, JSONP and jQuery During Mike Flasko’s session at MIX11, he showed how to create a JSONP aware WCF Data Service with a JSONPSupportBehavior attribute that is available for download from MSDN code gallery (and is supposed to be a part of Microsoft.Data.Services.Extensions namespace). In this post I’ll show a simple example that uses the attribute and jQuery in order to make a JSONP cross domain call for a WCF Data Service. Setting up the Environment First I started by creating two different ASP.NET web applications. The first application includes the...
no comments

Configuring WCF Data Services using Lambda Expressions

Thursday, April 21, 2011

Configuring WCF Data Services using Lambda Expressions One of the things that I avoid when I’m writing code is the use “magic strings”. Hardcoded strings are a code smell and should be rarely used. When using WCF Data Service configuration object you’ll have to pass the entity set’s string name to the configuration methods which as I wrote I would like to avoid. This is why in today’s post I’m going to extend the DataServiceConfiguration object to support lambda expressions instead of string parameters. Data Service Configuration Extensions I’ve created a simple static class that includes two new extension methods: SetEntitySetAccessRule<DataSource>...
no comments

Sela SDP Conference Sessions Slide Deck and Demos

Thursday, March 17, 2011

Sela SDP Conference Sessions Slide Deck and Demos Yesterday Sela SDP Conference ended after 4 intensive days. In the conference I had two breakout sessions about OData and about Code First in Entity Framework. First of all I want to thank all the attendees in those sessions. I hope that you had good time and that you enjoyed the sessions and of course the whole conference. As always I published the sessions slide decks and demos for you to download. The recording...

My SDP Lecturer Interview

Sunday, February 27, 2011

My SDP Lecturer Interview Last week Sela conducted a live broadcast with trailers to the sessions that will be presented on stage in the SDP conference. The broadcast was recorded if you want to see me “making a fool” of myself in the live broadcast you can watch the recording of my interview here (in Hebrew). I’m reminding that I’m going to have two sessions: Creating OData Services with WCF Data Services Data is a first-class element of every application. The Open Data Protocol (OData) applies web technologies such as HTTP,...

MIX11 Open Call Voting Has Started Today

Tuesday, January 25, 2011

MIX11 Open Call Voting Has Started Today MIX conference is the biggest Microsoft web conference which occurs every year in Las Vegas. As in every year Microsoft asked the developers and designers communities to propose sessions that will be part of a community voting. The sessions that will be chosen will be performed on stage at this year’s conference. Since I’m going to MIX11 as in last year, I proposed two sessions and they were chosen to the open call voting. This is the session descriptions: Building Data-Driven MVC Applications with Entity Framework Code...

Using EF DbContext with WCF Data Services

Saturday, December 11, 2010

Using EF DbContext with WCF Data Services One of the questions that you may ask yourself with the new EF feature CTP5 is how to embed the new DbContext object inside an OData service or more particularly inside WCF Data Service. This post will supply the solution. DbContext as WCF Data Service Data Source Entity Framework has a good integration with WCF Data Services. All you need to do when you create a WCF Data Service with EF is to put the generated ObjectContext as a data source of the service. The following code is a...

Exposing a Stored Procedure in WCF Data Service

Monday, October 25, 2010

Exposing a Stored Procedure in WCF Data Service Today I answered a question in the data platform development forums. The question was simple – how to expose a stored procedure which is mapped to an Entity Framework model through a WCF Data Service. This post will show you exactly how to do this. The Stored Procedure First I’ve created a the following stored procedure: CREATE PROCEDURE dbo.GetCoursesOrderByTitle AS BEGIN SET NOCOUNT ON ...