我正在嘗試獲取由MyTSA(https://www.dhs.gov/mytsa-api-documentation)提供的用於安全行等待時間的數據,但我遇到了問題。下面是我的代碼:使用Flex/ActionScript獲取服務器結果
import mx.events.FlexEvent;
import mx.rpc.events.ResultEvent;
[Bindable]
private var url:String = "http://apps.tsa.dhs.gov/MyTSAWebService/GetWaitTimes.ashx?output=xml&ap=SEA";
protected function init(event:FlexEvent):void
{
getWaits.send();
}
protected function getWaitsResult(event:ResultEvent):void
{
data_label.text = getWaits.lastResult.toString();
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:HTTPService id="getWaits" url="{url}" result="getWaitsResult(event)"/>
每當我運行它,我得到的錯誤代碼:[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://apps.tsa.dhs.gov/MyTSAWebService/GetWaitTimes.ashx?output=xml?output=XML&ap=SEA" errorID=2032]. URL: http://apps.tsa.dhs.gov/MyTSAWebService/GetWaitTimes.ashx?output=xml?output=XML&ap=SEA"]
任何想法,我怎麼能得到這個工作?難道我做錯了什麼?
感謝, 雅各