coxfrederic commented on issue #119: Request to AMFPHP fails to return any 
fault or result event
URL: https://github.com/apache/royale-asjs/issues/119#issuecomment-366331048
 
 
   I have made the following sample using Flex 4.16 AIR 27 which should 
resemble the exact same thing as the code for royale above. This sample is 
working fine in AIR.
   
   ```
   <?xml version="1.0" encoding="utf-8"?>
   <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"; 
                                           
xmlns:s="library://ns.adobe.com/flex/spark" 
                                           
xmlns:mx="library://ns.adobe.com/flex/mx" 
applicationComplete="windowedapplication_applicationCompleteHandler(event)">
        <fx:Script>
                <![CDATA[
                        import mx.events.FlexEvent;
                        import mx.rpc.events.FaultEvent;
                        import mx.rpc.events.ResultEvent;
                        import mx.rpc.remoting.RemoteObject;
                        
                        private var remoteObject:RemoteObject;
                        protected function 
windowedapplication_applicationCompleteHandler(event:FlexEvent):void
                        {
                                remoteObject = new RemoteObject;
                                remoteObject.endpoint = 
"https://clients.cityfashion.dev.exuvis.com/amfphp/gateway.php";;
                                remoteObject.source = "Meta";
                                remoteObject.destination = "Meta";
                                
remoteObject.getOperation("getPackages").addEventListener(FaultEvent.FAULT, 
getPackagesFaultHandler, false, 0, true);
                                
remoteObject.getOperation("getPackages").addEventListener(ResultEvent.RESULT, 
getPackagesResultHandler, false, 0, true);
                                
remoteObject.getOperation("getPackages").arguments = null;
                                testLabel.text = "Requesting via AMF..";
                                remoteObject.getOperation("getPackages").send();
                        }
                        
                        private function 
getPackagesFaultHandler(evt:FaultEvent):void{
                                testLabel.text = "AMF returned fault event";
                        }
                        
                        private function 
getPackagesResultHandler(evt:ResultEvent):void{
                                testLabel.text = "AMF returned result event";
                        }
                ]]>
        </fx:Script>
        
        <s:Label id="testLabel" />
        
   </s:WindowedApplication>
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to