开发者

When using blazeDS's proxy-config throw faultDetail="Connection refused: connect"

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::Mess开发者_如何学运维ageResponder/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.


Maybe you have to give to your HTTPService an url, like

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜