2011-04-14 78 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