3/1/2012 11:02 PM
In LightSwitch 2011, the team ripped out the guts and replaced the WCF RIA engine with an OData engine. The following are some techniques to observe how LightSwitch communicates using OData. This is important when you are making your own OData calls using the following method:
Accessing Your Visual Studio 2011 LightSwitch Application Using OData
F12 In IE Is Your Friend
Pull up a LightSwitch 2011 (or higher) in the web browser.
Hit the F12 key in Internet Explorer 9+ (or you can use Fiddler)
Select the Network tab and then click Start capturing.
Refresh the page.
After the calls to set-up the page we see the OData calls to retrieve the data. We can tell because type is xml or atom+xml.
The Clear button clears the results.
We can see what happens when we retrieve data in the application.
For example selecting an item in a list to load the record details.
We can see the OData calls.
If we make an update to a value …
… and click Save …
… we see the url.
We can double-click on it to see the details.
We can click on the Request body tab to see what was sent.
If we save the contents to an .xml file, we can open up the .xml file in Internet Explorer to see it properly formatted.
More on making OData Calls
The Microsoft article, Accessing Data Service Resources (WCF Data Services), explains a lot of the syntax used:
Accessing Data Service Resources (WCF Data Services)
Calling Service Operations (WCF Data Services)
Does OData Data Source Connection Support JSON Format?