2011-04-14 76 views
0

我尝试从移动应用程序访问Web服务时出现问题。 当我在我的浏览器上尝试web服务的地址时,它可以工作,当我在我的应用程序中尝试使用Flash Builder的模拟器时,它可以工作。 但是,当我在手机上试用它时,它不起作用!Flex Webservice和Android

我可以访问我的应用程序中的网页。

我只是在MXML的视图中创建web服务。

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

有人能帮助我吗?

谢谢

回答

0

您可能忘了在清单中添加Internet权限。将其添加到你的app.xml中:

<android> 
    <manifestAdditions> 
    <![CDATA[ 
    <manifest> 
     <uses-permission android:name="android.permission.INTERNET"/> 
    </manifest> 
    ]]> 
    </manifestAdditions> 
</android> 
+0

不,我没有忘记,它在这里。 我可以毫无问题地访问其他webservice。它必须是我的web服务的错误。我写在crossdomain.xml中 它还有什么其他问题? – Snote 2011-04-15 08:48:48

+0

是否正确显示了你的WSDL?你可以发布吗? – 2011-04-15 12:45:27