Hi,
I'm trying to use Zend_Auth with Zend_Amf_Server together. When
authentication is fails Zend_Amf_Server_Execetion is thrown but i have
no idea how to catch exception (i.e obtain code and message) on the
Flex side.
When I dumped response from the server _handle() method I got following:
Zend_Amf_Response_Http Object
(
[_objectEncoding:protected] => 3
[_bodies:protected] => Array
(
[0] => Zend_Amf_Value_MessageBody Object
(
[_targetUri:protected] => /1/onStatus
[_responseUri:protected] =>
[_data:protected] =>
Zend_Amf_Value_Messaging_ErrorMessage Object
(
[extendedData] =>
[faultCode] => -3
[faultDetail] => <stack trace removed>
[faultString] => Authentication failed:
Invalid credentials
[rootCause] =>
[correlationId] =>
B08A2774-6C89-526C-3998-79C354A3A07B
[clientId] => 627B06A6-D3E5-2849-3A4F-000006784729
[destination] =>
[messageId] => 4D349BA4-E9C9-5A89-E2A3-0000443594C4
[timestamp] => 125617329200
[timeToLive] => 0
[headers] => stdClass Object
(
)
[body] =>
)
)
)
[_headers:protected] => Array
(
[0] => Zend_Amf_Value_MessageHeader Object
(
[name] => AppendToGatewayUrl
[mustRead] =>
[length] =>
[data] => ?PHPSESSID=k0h79tgdb9dek0n8o1dtij3ar0
)
)
[_outputStream:protected] =>
)
As you can see, exception is there but It seems that is not serialized
into the response. I did dump but there is nothing similar to the
"Authentication failed: Invalid credentials" message. I have no idea
how to get exception code, message in the Flex. I use this code as a
fault handler on the Flex side:
private function faultHandler(fault:FaultEvent):void
{
Alert.show("code:\n" + fault.fault.faultCode +
"\n\nMessage:\n" + fault.fault.faultString + "\n\nDetail:\n" +
fault.fault.faultDetail);
}
Which results in following message:
code:
Client.Error.MessageSend
Message:
Send failed
Detail:
Channel.Ping.Failed error <stack trace removed>
How could I get exception data on the Flex side? When I created simple
method like this:
class Service {
public test() { throw new Exception('test!'); }
}
I got back what I expected i.e:
code:
0
Message:
test!
PS: production mode is set to false (via setProdunction(false))
Thanks,
--
Ondrej Ivanic
([email protected])