【问题标题】:Flex Webservice and AndroidFlex 网络服务和安卓
【发布时间】:2011-04-14 15:37:53
【问题描述】:

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

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

我只是在 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()

有人可以帮我吗?

谢谢

【问题讨论】:

    标签: apache-flex web-services flex4 air mxml


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      您可能忘记在清单中添加互联网权限。在你的 app.xml 中添加这个:

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

      【讨论】:

      • 不,我没有忘记,它就在这里。我可以毫无问题地访问其他网络服务。我的网络服务一定是错误的。我在 crossdomain.xml 中写了 还有什么问题?
      • 您的 WSDL 是否正确显示?可以发一下吗?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-08
      • 2013-01-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多