【问题标题】:When using blazeDS's proxy-config throw faultDetail="Connection refused: connect"使用 blazeDS 的 proxy-config 时 throw faultDetail="Connection denied: connect"
【发布时间】:2011-05-23 06:06:30
【问题描述】:

我在webroot下直接创建了一个xml文件,命名为index.jsp,内容如下:

<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<?xml version="1.0" encoding="utf-8"?>
<catalog>
<product>
    <name>Product 1</name>
    <description>Product 1 is good</description>
    <price>5</price>
</product>

<product>
    <name>Product 2</name>
    <description>Product 2 is good</description>
    <price>15</price>
</product>

<product>
    <name>Product 2</name>
    <description>Product 2 is good</description>
    <price>25</price>
</product>   
</catalog>

并且在 WEB-INF/flex 下的 proxy-config.xml 中:

<destination id="getXML">
 <properties>
  <url>http://localhost:8080/FlexTest/index.jsp</url>
 </properties>
</destination>

在main.mxml中,httpservice如下:

<mx:HTTPService id="httpService" destination="getXML" useProxy="true" />

对应的DataGrid:

 <mx:DataGrid dataProvider="{httpService.lastResult.catalog.product}" x="405" y="130" width="329" height="166"/> 

但是当我点击按钮执行httpService.send()时,出现如下错误:

[RPC Fault faultString="Error sending request" faultCode="Server.Proxy.Request.Failed" faultDetail="Connection refused: connect"]

在 mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\autobuild\3.5.0\frameworks\projects\rpc\src \mx\rpc\AbstractInvoker.as:290] 在 mx.rpc::Responder/fault()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:58] 在 mx.rpc::AsyncRequest/fault()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103] 在 NetConnectionMessageResponder/statusHandler()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\messaging\channels\NetConnectionChannel.as:581] 在 mx.messaging::MessageResponder/status()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\messaging\MessageResponder.as:222]

希望有人能帮我解决一下,非常感谢。

【问题讨论】:

    标签: apache-flex blazeds


    【解决方案1】:

    也许你必须给你的 HTTPService 一个 url,比如

    <mx:HTTPService id="httpService" url="http://localhost:8080/FlexTest/index.jsp" destination="getXML" useProxy="true"/>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-08-11
      • 1970-01-01
      • 2020-10-23
      • 2021-04-12
      • 1970-01-01
      • 2014-06-17
      • 2016-01-27
      • 2021-12-16
      相关资源
      最近更新 更多