Why is ember requesting XML instead of JSON?
XML Response according to firebug:
XML-processing defect: No element found address: moz-nullprincipal:{664ded3f-7063-4f92-b404-3895f595c584} Row No. 1, Column 1: [my translation into English]
Ember Data Request (Not Working)
Request Header:
Accept text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Response Header:
Content-Type application/xml; charset=utf-8
Ajax Request (Working)
Request Header:
Accept application/json, text/javascript, /; q=0.01
Response Header:
application/json; charset=utf-8
My store and Adapter
App.store = DS.Store.create({
revision: 11,
});
DS.RESTAdapter.reopen({
url: '.../json/ember'
});
My nested Model
App.Line = DS.Model.extend({
lineIdentifier: DS.attr('string'),
shifts: DS.hasMany('App.Shift'),
});
App.Shift = DS.Model.extend({
name: DS.attr('string'),
line: DS.belongsTo('App.Line'),
});
My WCF Interface
[OperationContract]
[WebInvoke(
Method = "GET",
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "/json/ember/lines"
)]
LinesArray LinesEmber();
My JSON
{
"Line":[
{"Shift":[{},{},{},{}],...},
{"Shift":[{},{},{},{}],...}]
}
Well response would be fantastic, it's the last big coding step for my master thesis. :) Thanks in advance.
[Update]
Failed ember call: For me it's surprising, that ember requests xml...
Successful ajax call