Flex的web服务和Android [英] Flex Webservice and Android

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

问题描述

我有一个问题,当我试图从移动应用程序访问Web服务。 当我尝试在我的浏览器的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.

我刚刚创建的Web服务在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>

我得到这个异​​常

I got this exception

[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()

有人能帮助我吗?

Can someone help me?

感谢您

推荐答案

我发现和解决我的问题。我使用本地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天全站免登陆