Tag Archives: OData

OData Series Part 4: Adding JSONP support to your OData service

In the fourth episode of the OData screencast series you will learn how you can overcome the limitation of the Same Origin Policy by supporting JSONP in your OData service, and letting the client to control the response format in the URL.

Supporting jSONP in your OData service

The video is hi-res, so 720p and full screen view is recommended.

You can also view the past and future episodes of the OData series here.

 

Technorati-címkék: ,,,,
Advertisements

OData Series Part 3: Accessing an Open Data Protocol feed from jQuery

In the third part of the series I show you how you can use jQuery and the jQuery templates plugin to connect to an OData feed directly from JavaScript.

Accessing an OData feed from jQuery

The video is hi-res, so 720p and full screen view is recommended.

You can also view the past and future episodes of the OData series.

OData Series Part 2: Accessing an Open Data Protocol feed from Excel PowerPivot

In the part 2 of the series you can see how easy it is to use the PowerPivot addon for Excel 2010 to connect to  an OData feed and analyze the published data directly in Excel.

Accessing an OData feed from Excel PowerPivot

The video is hi-res, so 720p and full screen view is recommended.

You can also view the past and future episodes of the OData series.

OData Series Part 1: Open Data Protocol quick and easy

Entering the same data to multiple systems or applications can be really, really frustrating. There are tons of applications and websites on the public internet as well as on private intranets, that do nothing more, but suck in all the data, process them, but don’t share them for other applications.

I strongly believe that the Open Data Protocol can help to change this situation: an open protocol for open data, and open data for the open web.

So with this in mind, I have decided to create a screencast series about OData. This is the first episode that shows you how easy to publish your data via an OData feed with Visual Studio and WCF Data Services.

Open Data Protocol – quick and easy

The video is hi-res, so 720p and full screen view is recommended.

You can also view the other episodes of the OData series.

WCF Data Services vs Web Deployment Projects

If you have an .svc file that acts as a WCF Data Services (OData) endpoint in a Web Site project, you may encounter the following error message when you try to precompile the site with Web Deployment Projects:

Exception type: System.ServiceModel.ServiceActivationException    

Exception message: The service ‘/MyService.svc’ cannot be activated due to an exception during compilation. 

The exception message is: Could not load file or assembly ‘App_global.asax, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.

Inner exception type: System.IO.FileNotFoundException    

Sounds weird, but you will be surprised how elegant the solution is: let’s get rid of the whole .svc file and use ASP.NET routing!

Go to the global.asax file and register a new route:

RouteTable.Routes.Add( "MyService",
  new ServiceRoute( "MyService", 
                    new DataServiceHostFactory(), 
                    typeof( MyService ) ) );

Then implement your WCF Data Service in the MyService class:

public class MyService : DataService<MyDataModel>
{
  public static void InitializeService( DataServiceConfiguration config )
  {
    // Initialize your service here, set accesss rules, page size etc...
  }

  protected override void OnStartProcessingRequest( ProcessRequestArgs args )
  {
    base.OnStartProcessingRequest( args );

    // Set caching and custom headers here...
  }
}

The result: no more problem with Web Deployment Projects and you can have any nice virtual URL you want.