0

我试图弄清楚为什么我的 flex 中的 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 (ActionScript 3.0) 中的 HttpService:

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 调用它时它可以正确显示。有什么建议么?

4

1 回答 1

0

这是按预期工作的,它对我来说看起来完全陌生。对困惑感到抱歉!请关闭这个。

于 2012-12-14T19:44:03.570 回答