11 Replies Latest reply on Nov 6, 2011 6:43 AM by yancaoshi

    flex blazeds ios problem

    Daniel Bogn.

      Hi,

       

      I've created a small test app (Burrito Mobile Application / Flex Hero SDK) that connects to a remote Blazeds server (Tomcat, Port 8400). The application does 2 simple tasks: it 1. connects as a Consumer to the amf streaming destination and 2. calls a proxy service, both handled by Blazeds. Works in Desktop-Air and Browser-Flash. However, when I create an .ipa file all parts of the app are handled correctly (e.g. HTTPService parsing xml), except the Blazeds functionality. No error message and no data is displayed. Tried to switch the ports on the Tomcat to 8080, again same result, all working except IOS. It is strange that Consumer's subscribe() method works and is true but then happens nothing.

       

      Does anybody have an idea?

       

      Daniel

        • 1. Re: flex blazeds ios problem
          Daniel Bogn. Level 1

          Can anybody confirm that blazeds works on ios / android at least?

          • 2. Re: flex blazeds ios problem
            mark dong

            I got the same problem and using LCDS.  I'm using remoteObject with AMFChannel and HTTPChannel. I guess it is caused by AMF serialization.

            • 3. Re: flex blazeds ios problem
              Daniel Bogn. Level 1

              It also does not work with WebORB, so it is not a BlazeDS/LCDS/WebORB fault.

               

              I find this is a critical issue, especially in the current situation when Adobe is praising the portability to mobile devices - i still cannot believe that streaming / remoting does not work on mobile devices or that nobody has an idea about it.

              • 4. Re: flex blazeds ios problem
                mark dong Level 1

                I just found the problem is not caused by BlazeDS/LCDS. It works if you call remoteObject using pure AS3 or MXML directly. My problem is caused by other reason.

                • 5. Re: flex blazeds ios problem
                  mark dong Level 1

                  I think problem is not caused by any remoting/streaming code because it works in my environment (Using remoteObject + LCDS with 7001 port).   Maybe you can check some codes which handle server's response . 

                  • 6. Re: flex blazeds ios problem
                    yancaoshi

                    Have you ever tried blazeDS on iPad? My case works fine on android but not on iPad.

                     

                    I got below error message from Faultevent:

                    Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'http://192.168.1.100:80/test/messagebroker/amfpolling'

                     

                    Nothing happens on server side because nothing is logged though I switched on all levels.

                     

                    Regards,

                    • 7. Re: flex blazeds ios problem
                      alinator11 Level 2

                      I have no problems with Blaze and Android or iOS.  I use MXML to declare and AS3 for everything else:

                       


                      <fx:Declarations>


                      <s:ChannelSet id="channelSet">



                      <s:AMFChannel id="amfChannel" url="{getChannelDestination()}"/>


                      </s:ChannelSet>


                      <s:RemoteObject



                      id="serviceObject"




                      destination="HSBlazeService"





                      channelSet="{channelSet}"



                      fault="faultHandler(event)"



                      result="resultHandler(event)"/>

                      </fx:Declarations>

                       

                      When I tried to do the above with AS alone, it never worked. But, could have had some other problem. Nonetheless, I use MXML as above and then do everything else in AS such as:

                       




                      public function aBlazeFunction(anObject:MyObject, userID:String) {




                      this.anObject =anObject




                      this.functionCalled = "afunction";




                      serviceObject.runMethod(userID);



                      }

                       

                      My result handler looks like:

                       

                      private function resultHandler(event:ResultEvent):void {

                                      if(functionCalled == "afunction") {

                                          functionCalled = "";

                                          callBackObject.setCallBackInfo(String(event.result));

                                      }

                      ...

                      }

                      • 8. Re: flex blazeds ios problem
                        yancaoshi Level 1

                        Thanks for your attention but I am not able to get it work. WOuld you please so kind to check my sample coding? My blazeDS works and destination bp provides a method getSystemTime which simply returns server time.

                        It returns NetConnection.Call.Failed on iPad though I am assure it works fine on android.

                         

                        Regards,

                         

                         

                         

                        <?xml version="1.0" encoding="utf-8"?>
                        <components:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                             xmlns:s="library://ns.adobe.com/flex/spark"
                             xmlns:components="spark.components.*"
                             creationComplete="view1_creationCompleteHandler(event)" title="HomeView">
                         <fx:Script>
                          <![CDATA[
                           import mx.events.FlexEvent;
                           import mx.messaging.ChannelSet;
                           import mx.messaging.channels.AMFChannel;
                           import mx.rpc.events.FaultEvent;
                           import mx.rpc.events.ResultEvent;
                           protected function view1_creationCompleteHandler(event:FlexEvent):void
                           {
                            serviceObject.getSystemTime();
                           }
                           
                           protected function serviceObject_faultHandler(event:FaultEvent):void
                           {
                            testResult.text += event.toString();
                           }
                           
                           protected function serviceObject_resultHandler(event:ResultEvent):void
                           {
                            testResult.text += event.result.toString();
                           }
                           
                          ]]>
                         </fx:Script>
                         <fx:Declarations>
                          <!-- Place non-visual elements (e.g., services, value objects) here -->
                           <s:ChannelSet id="channelSet"> 
                            <s:AMFChannel id="amfChannel"
                                 url="http://192.168.1.100:8080/ordersyssrv/messagebroker/amf"/> 
                           </s:ChannelSet> 
                           <s:RemoteObject id="serviceObject" channelSet="{channelSet}" destination="bp"
                               fault="serviceObject_faultHandler(event)"
                               result="serviceObject_resultHandler(event)"/> 
                          
                         </fx:Declarations>
                         <s:TextArea id="testResult" width="366" height="434">
                          
                         </s:TextArea>
                        </components:View>
                        
                        • 9. Re: flex blazeds ios problem
                          alinator11 Level 2

                          Hey yancaoshi. Sorry I missed this. Were you able to get it to work? I think I saw another thread on this and perhaps it was answered for you? In that thread it was suggested to update your url to the actual remote server instead of the interal address. I can attest to that having been a problem for me at one point in the past as well.

                          • 10. Re: flex blazeds ios problem
                            yancaoshi Level 1

                            My apology for having not update the thread ASAP.

                            I found out the root cause last Friday actually and that is win7 firewall. Still not know which setting blocks the request out.

                            I used win7 32bit version at home which installs tomcat and doesn't get request from iPad until I close the firewall. And the same application works in my office PC which has win7 64bit and tomcat installed no matter firewall is on or off.

                             

                            Anyway, it proves that iPad can interact with blazeDS fine.

                             

                            Thanks and regards,

                            • 11. Re: flex blazeds ios problem
                              yancaoshi Level 1

                              Another point. Before I close firewall to make it run, I set the channel manually in the class generated by data service. Otherwise, it doesn't work either.

                               

                               

                                   protected override function preInitializeService():void
                                  {
                                      super.preInitializeService();
                                      // Initialization customization goes here
                                      // Here I set the channelSet manually because I find it's null when debugging
                                      channelSet = new ChannelSet();
                                      var amfChannel:AMFChannel = null;  
                                      amfChannel = new AMFChannel("my-amf", "http://192.168.1.100:80/test/messagebroker/amfpolling");
                                      amfChannel.pollingEnabled = false;
                                      channelSet.addChannel(amfChannel);
                                  }