English 中文(简体)
• 如何在吉大港山区开发协会的过错手勒获得吉大港山区地位法
原标题:How to get HTTP status code in HTTPService fault handler

我正在从客户方面通过吉大港山区服务站使用服务器方法。 服务器是ResFul网络服务,可使用许多吉大港山区应用方案错误代码之一(例如,400个错误,404个错误,409个错误)。 我一直在设法确定服务器发送的确切错误代码是什么。 我已经为我过错的手勒居住的FaultEvent走了全部树苗,但没有告诉我错误的代码。 这一缺失的功能是否在灵活性上?

My code looks like this: The HTTP Service declaration:

    <mx:HTTPService id="myServerCall" url="myService" method="GET" 
resultFormat="e4x" result="myServerCallCallBack(event)" fault="faultHandler(event)">
            <mx:request>
                <action>myServerCall</action>
                <docId>{m_sDocId}</docId>
            </mx:request>
        </mx:HTTPService>

我的过错手法也一样:

private function faultHandler(event : FaultEvent):void
{
 Alert.show(event.statusCode.toString() + " / " + event.fault.message.toString()); 
}
问题回答

我可能在此失踪,但:

<代码>event.statusCode

我向我介绍了吉大港山区应对方案的现状。

因此,在我的过错的手职中,我能够成功地做这样的事情:

public function handleFault(faultEvent:FaultEvent):void
{
    if (faultEvent.statusCode == 401)
    {
        Alert.show("Your session is no longer valid.", "", Alert.OK, this, loginFunc);
    }
    else
    {
        Alert.show("Failed with error code: " + faultEvent.statusCode as String);
    }
}

闪电器需要浏览器的帮助,才能查阅吉大港山区地位法;因此,在所有平台上都无法提供。 对我来说,它没有与闪电器10.3.183.11和3.6.26合作,而是与电算器8在视窗7上合作。

Theobe help for the FaultEvent.statusCode property hints at this, but 遗憾的是,没有详细内容:

该财产提供了查阅《吉大港山区应对地位法》(如果有的话),否则价值为0。

因此,如果你绝对需要地位法,坏uck;如果它只是为了某些经常的错误条件而生成一个更好或更友好的错误信息,那么它就足够了。

https://github.com/gabriel/as3http://client”rel=“nofollow>as3 httpclient 如罗森所示,只要你重新制定《国际投资报告》,而不是以浏览器为基础的评估,那么你就可以恢复《吉大港山区地位法》。

我无法从浏览器获得3http://client,即使向同一来源提出请求。 http://www.adobe.com/devnet/flasher/articles/socket_policy_files.html” rel=“nofollow” 文件 说你需要建立一个袖珍政策档案服务器,以便做到这一点。 对我们的用途来说,我没有计算能力,因此,我在同一东道方安装了一台Proxy网络服务机,运行弹性套。

我利用人权高专署向将申请转交目的地的代理网络服务机构发出呼吁,代用网络服务公司将“地位代码”和电文机构退回到设在xml的吉大港山区。

Try using this instead of HTTPService: http://code.google.com/p/as3httpclient/





相关问题
Disable button tooltip in AS3

I want to disable the tooltip on certain buttons. The tooltip manager seems to be an all or nothing solution. Is it possible to disable the tooltip for just one or two buttons?

Multiple Remote call made simultenously

I was making multiple remote calls and they are done sequentially and when I am getting a result event back it s triggering calls to all the methods with ResultEvent as an argument . I am supposed to ...

Attaching a property to an event in Flex/AS3

I have a parameter that needs to be passed along with an event. After unsuccessful attempts to place it on the type by extending the class, I ve been advised in another SO question to write a custom ...

Clearing RSL in Cache

I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...

What s a good way of deserializing data into mock objects?

I m writing a mock backend service for my flex application. Because I will likely need to add/edit/modify the mock data over time, I d prefer not to generate the data in code like this: var mockData =...

AS3 try/catch out of memory

I m loading a few huge images on my flex/as3 app, but I can t manage to catch the error when the flash player runs out of memory. Here is the what I was thinking might work (I use ???? because i dont ...

热门标签