在使用Flex的Andr​​oid的Web服务和网络问题 [英] Web Service Network Issue on Android using Flex

查看:285
本文介绍了在使用Flex的Andr​​oid的Web服务和网络问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发移动应用程序部署到iOS和Android的使用Flash Builder和Flex。我在一个地步,我想开始作为一切工作的Flash Builder的模拟器一个物理设备上测试。

I am developing a mobile application to be deployed to both iOS and Android using Flash Builder and Flex. I'm at a point where I want to begin testing on a physical device as everything is working on the Flash Builder emulator.

在我的应用程序被加载并第一个视图显示以下code运行。

When my app is loaded and the first view is displayed the following code is run.

creationComplete="initApp(event)

protected function initApp(event:FlexEvent):void
{               
    pricingAppWebService1.updateApp("RAMISAppUpdate");                          
}   

我的问题是,当我尝试从服务器加载XML数据转换成使用Web服务(如下图所示)的应用程序,它会导致故障。这是奇怪,因为它适用于Flash Builder的模拟器。

My issue is that when I try and load the xml data from the server into the app using the Web Service (shown below), it results in a fault. This is strange as it works on the Flash Builder emulator.

<fx:Declarations>
    <s:WebService id="pricingAppWebService" 
        wsdl="http://dev.ramislive.com/webservice/pricing.asmx?WSDL"
        result="dataSent_resultHandler(event)"
        fault="dataSent_faultHandler(event)" />    
</fx:Declarations>

当应用程序试图得到它击中此时设备显示​​一个OK的pricingAppWebService_faultHandler XML数据/取消在一个输入文本显示在我的机器的本地IP弹出框。

When the app tries to get the xml data it hits the pricingAppWebService_faultHandler at which point the device displays a OK/Cancel pop-up box with the local IP of my machine displayed in a input text.

protected function pricingAppWebService_faultHandler(event:FaultEvent):void
{
    trace(event.fault);
    navigator.pushView(MainMenu);           
}   

跟踪提供了在Flash Builder控制台以下信息。

The trace provides the following information in the Flash Builder Console.

[ RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request"
    faultDetail="Unable to load WSDL. 
    If currently online, please verify the URI and/or format of the WSDL    
    (http://dev.ramislive.com/webservice/pricing.asmx?WSDL)" ]

当然,我认为是设备上的安全设置和以下中的src / main-app.xml的。

Naturally I considered the security settings on the device and the following exists in the android manifest file within src/Main-App.xml.

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

<击>
作为一个说明我已经看过这个问题和解决我的问题可能是非常相似的。但是,我曾尝试与没有成功的IP地址替换域。道歉,如果这个问题太模糊,这是我第一次在网站上。我试图提供尽可能多的细节,我可能可能短了整个MXML文件中。

As a note I have looked at THIS QUESTION and the solution to my problem may be very similar. however i have tried replacing the domain with the IP address with no success. Apologies if this question is too vague, it's my first on the site. I've tried to provide as much detail as I possibly could short of the whole mxml file.

这个问题似乎被投掷某种安全问题 - 这是我承担的弹出框。然而,这只是猜测,但我的服务器注意到单击确定和pressing电话后退按钮尝试并重新加载数据后的反应。

The issue seems to be throwing some kind of security issue - which is what I assume the pop-up box is. This however, is only speculation but my server notices a response after clicking OK and pressing the phone back button to try and reload the data.

推荐答案

重要的是要注意,这个用我的内部无线连接,连接到测试计算机在测试时不发生是可用的(这是IP在框中) 。为了避免这个问题用IPA的发行版来代替。它不会在最终发布版本中显示否则不用担心。

It's important to note this does not happen when testing using my internal wifi connection as the connection to the test computer is available (this is the IP in the box). To avoid the issue use the release version of the ipa instead. Otherwise do not worry it will not be shown in the final release build.

Project --> Export Release Build 

这篇关于在使用Flex的Andr​​oid的Web服务和网络问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆