我试图弄清楚为什么我的flexService中的HTTPService结果返回多个XML头..
C#WebAPI服务:
[HttpPost, HttpGet]
public List<vwRecord24Category> GetClientCategories(int companyId)
{
var categories = Db.Fetch<vwRecord24Category>(@"SQLQUERY", companyId);
return categories;
}
此Web服务调用的结果是;
<ArrayOfvwRecord24Category xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Record24Entities">
<vwRecord24Category>
<CategoryName>John Doe</CategoryName>
<Name>adsf</Name>
</vwRecord24Category>
<vwRecord24Category>
<CategoryName>John Doe</CategoryName>
<Name>df</Name>
</vwRecord24Category>
<vwRecord24Category>
<CategoryName>John Doe</CategoryName>
<Name>new thing 4</Name>
</vwRecord24Category>
<vwRecord24Category>
<CategoryName>John Doe</CategoryName>
<Name>Surgery Center 1</Name>
</vwRecord24Category>
</ArrayOfvwRecord24Category>
我在Flash Builder中的HttpService(ActionScript 3.0):
params.companyId = clientData.data.companyId;
httpService.method = 'POST';
httpService.url = 'http://****.domain.com/record24api/content/GetClientCategories';
httpService.contentType = "application/json";
httpService.resultFormat = "e4x";
httpService.addEventListener(ResultEvent.RESULT, onLibrariesLoaded);
httpService.addEventListener(FaultEvent.FAULT, onLibraryLoadError);
httpService.send(JSON.stringify(params));
好吧,所以当成功事件被触发后,我的response.result看起来像这样:
我一直在争论这个问题好几个小时,我已经缩小了它不能成为我的网络服务,因为当我通过chrome或IE进行调用时它正确显示。有什么建议吗?
答案 0 :(得分:0)
这是按预期工作的,它看起来对我来说完全是陌生的。对困惑感到抱歉!请关闭它。