当使用 blazeDS 的代理配置时,抛出错误详细信息=“连接被拒绝:连接”
我在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]
我希望有人能帮我解决这个问题,谢谢很多。
I have created a XML file directly under the webroot, named index.jsp, the contents are as follow:
<%@ 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>
And in proxy-config.xml under the WEB-INF/flex:
<destination id="getXML">
<properties>
<url>http://localhost:8080/FlexTest/index.jsp</url>
</properties>
</destination>
In the main.mxml, the httpservice as follow:
<mx:HTTPService id="httpService" destination="getXML" useProxy="true" />
Corresponding DataGrid:
<mx:DataGrid dataProvider="{httpService.lastResult.catalog.product}" x="405" y="130" width="329" height="166"/>
But when I click the button to execute httpService.send(), some errors has been thrown up as follow:
[RPC Fault faultString="Error sending request" faultCode="Server.Proxy.Request.Failed" faultDetail="Connection refused: connect"]
at 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]
at mx.rpc::Responder/fault()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:58]
at mx.rpc::AsyncRequest/fault()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103]
at NetConnectionMessageResponder/statusHandler()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\messaging\channels\NetConnectionChannel.as:581]
at mx.messaging::MessageResponder/status()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\messaging\MessageResponder.as:222]
I hope someone could help me solve it out, thanks a lot.
也许你必须给你的 HTTPService 一个 url,比如
Maybe you have to give to your HTTPService an url, like