I'm using the latest version of JayData with the RC for Asp.Net WebAPI OData. When I run the JavaScript function to fetch data from the server, I can see the request and response with JSON data. However, the .then() function never fires so the UI is unaware that data was returned from the server.
Here is my JayData call:
(function(root) {
var context = new Default.Container({
name: 'oData',
oDataServiceHost: '../api/transactions'
});
$(function() {
context.TransactionsByMonth.take(5).toArray().then(function(transactions) {
transactions.forEach(function (transaction) {
alert('Test');
});
});
});
}(window));
Here are the response headers:
Response Headers Cache-Control no-cache Content-Length 1811 Content-Type application/json Date Fri, 21 Dec 2012 08:32:58 GMT Expires -1 Pragma no-cache Server Microsoft-IIS/8.0 X-AspNet-Version 4.0.30319 X-Powered-By ASP.NET X-SourceFiles =?UTF-8?B?YzpcdXNlcnNcanVzdGluXGRvY3VtZW50c1x2aXN1YWwgc3R1ZGlvIDIwMTJcUHJvamVjdHNcVHJlYXNTdXJlLldlYlxUcmVhc1N1cmUuV2ViXGFwaVx0cmFuc2FjdGlvbnNcVHJhbnNhY3Rpb25zQnlNb250aA==?= Request Headers Accept application/atomsvc+xml;q=0.8, application/json;odata=verbose;q=0.5, /;q=0.1 Accept-Encoding gzip, deflate Accept-Language en-US,en;q=0.5 Connection keep-alive Cookie glimpseState=null; glimpseLatestVersion=0.87; glimpseOptions=null; glimpseClientName=null Host localhost:42039 MaxDataServiceVersion 2.0 Referer http://{localhost}/dashboard/test User-Agent Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0
Here is the response:
[
{
"TransactionByMonthId": 1,
"BeginningBalanceAmount": 5970.0,
"FloatAmount": 8027.0,
"InflowsAmount": 8607.0,
"OutflowsAmount": -2057.0,
"EndingBalanceAmount": 33345.0,
"MonthOfYear": 12,
"MonthOfYearName": "MonthOfYearName6136f9ba-95c3-4977-ab29-5ec2e2968c5f",
"QuarterOfYear": 8,
"YearNumber": 2012
},
{
"TransactionByMonthId": 10,
"BeginningBalanceAmount": 9201.0,
"FloatAmount": 4723.0,
"InflowsAmount": 4933.0,
"OutflowsAmount": -2808.0,
"EndingBalanceAmount": 9858.0,
"MonthOfYear": 11,
"MonthOfYearName": "MonthOfYearName7c407e0d-d730-43c3-aff6-d3e56313f992",
"QuarterOfYear": 17,
"YearNumber": 2012
},
{
"TransactionByMonthId": 19,
"BeginningBalanceAmount": 3151.0,
"FloatAmount": 19.0,
"InflowsAmount": 9340.0,
"OutflowsAmount": -6118.0,
"EndingBalanceAmount": 19958.0,
"MonthOfYear": 10,
"MonthOfYearName": "MonthOfYearName504ded96-a4e3-4492-ae22-98da7c9c2ba1",
"QuarterOfYear": 26,
"YearNumber": 2012
},
{
"TransactionByMonthId": 28,
"BeginningBalanceAmount": 3826.0,
"FloatAmount": 7120.0,
"InflowsAmount": 3341.0,
"OutflowsAmount": -9360.0,
"EndingBalanceAmount": 33617.0,
"MonthOfYear": 9,
"MonthOfYearName": "MonthOfYearName5fa907a3-b6a3-4a42-a53b-2229da6e1dc6",
"QuarterOfYear": 35,
"YearNumber": 2012
},
{
"TransactionByMonthId": 37,
"BeginningBalanceAmount": 6832.0,
"FloatAmount": 4412.0,
"InflowsAmount": 2462.0,
"OutflowsAmount": -3726.0,
"EndingBalanceAmount": 40857.0,
"MonthOfYear": 8,
"MonthOfYearName": "MonthOfYearNameb3f6a899-6201-418a-b020-31babb42123b",
"QuarterOfYear": 44,
"YearNumber": 2012
}
]