Flex Web 服务和 Android [英] Flex Webservice and Android

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

问题描述

当我尝试从移动应用程序访问网络服务时遇到问题.当我在浏览器上尝试 web 服务的地址时,它可以工作,当我在 Flash Builder 模拟器上的应用程序中尝试时,它可以工作.但是当我在手机上尝试时,它不起作用!

I have a problem when I try to access to a webservice from a mobile application. When I try the address of the webservice on my browser, it works, when I try in my application on the emulator of Flash Builder, it works. But when I try it on my phone, it doesn't work!

我可以在我的应用程序中访问网络.

I have access to the web in my application.

我只是在 MXML 的视图中创建网络服务.

I just create the webservice in a view in MXML.

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark" 
        title="WebService">
    <fx:Declarations>
        <s:WebService id="webService" wsdl="http://serverweb/Service.asmx?WSDL">
    </s:WebService>
    </fx:Declarations>
</s:View>

我遇到了这个异常

[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://serverweb/Service.asmx?WSDL)"]
at mx.rpc.wsdl::WSDLLoader/faultHandler()[E:\dev\hero_private_beta\frameworks\projects\rpc\src\mx\rpc\wsdl\WSDLLoader.as:103]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at HTTPOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:\dev\hero_private_beta\frameworks\projects\rpc\src\mx\rpc\http\HTTPService.as:993]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\hero_private_beta\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:350]
at mx.rpc::Responder/fault()[E:\dev\hero_private_beta\frameworks\projects\rpc\src\mx\rpc\Responder.as:68]
at mx.rpc::AsyncRequest/fault()[E:\dev\hero_private_beta\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:113]
at DirectHTTPMessageResponder/errorHandler()[E:\dev\hero_private_beta\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:410]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()

有人可以帮我吗?

谢谢

推荐答案

我发现并解决了我的问题.我使用本地 Web 服务器,但电话不会将主机名转换为 IP 地址.所以代替 http://serverweb/Service.asmx?WSDL,我把 http://192.168.0.5/webservice.asmx?wsdl(其中192.168.0.5是serverweb的ip)

I have found and fix my problem. I use a local web server and the phone doesn't translate the hostname into the IP address. So instead of http://serverweb/Service.asmx?WSDL, I put http://192.168.0.5/webservice.asmx?wsdl (where 192.168.0.5 is the ip of serverweb)

这篇关于Flex Web 服务和 Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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