1 Reply Latest reply on Aug 23, 2011 9:40 AM by saisri2k2

    New Flex user trying to connect to ColdFusion

    bennykleid Level 1

      Hello.  The code below is intended to call the "getNews" method in news.cfc, then display the "headline" field in the list component.  The error message is: faultCode="Channel.Call.Failed" faultDetail="NetConnection.Call.Failed: HTTP: Status 404"]

       

      I suspect the problem is with the source attribute of RemoteObject, and I can't seem to find an explanation of the required syntax.  My cfc is located in c:\ColdFusion9\wwwwroot\LitchfieldNews5-debug\.

       

      Can anyone point out the problem?  Thanks in advance.

       

       

      <?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="News" destructionPolicy="never" viewActivate="init()">

       

          <fx:Declarations>
              <s:RemoteObject id="newsService" destination="ColdFusion" source="LitchfieldNews5-debug.news" endpoint="http://127.0.0.1:8500/flex2gateway/ ">
              </s:RemoteObject>
          </fx:Declarations>
         
          <fx:Script>
              <![CDATA[
                  import mx.rpc.events.FaultEvent;
                  import mx.rpc.events.ResultEvent;
                 
                  protected function init():void
                  {
                      newsService.getNews();
                  }           
              ]]>
          </fx:Script>
         
          <s:List id="resultsList" width="100%" height="100%" dataProvider="{newsService.getNews.lastResult}"
                  labelField="headline" />
         
      </s:View>