8 Replies Latest reply on Mar 8, 2007 4:48 PM by ntsiii

    Problems with Web Service pulling XML into Flex

    cardinalsupport
      Hi,

      I am using a ColdFusion CFC that is setup to output a string of XML. It is running on ColdFusion MX 6.1 and is setup as a remote web service. I have tested the call and it returns the string of XML fine when called from some other non Flex based method. My problem is this simple Flex app I wrote below to call the same function via a web service. I cannot get it to ouput the results, keeps showing as NULL. I cant use the HTTP call from Flex for remoting because i am not running MX7. Does anyone know what is wrong with my code? BTW i do have the cross-domain.xml file working to call the cfc ,let me know if you want to test and i can add your domain. thanks!

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">

      <!-- Define the Web Service to get XML data of course catalog -->
      <mx:WebService
      id="cd"
      wsdl=" http://training.wonderware.com/components/courses.cfc?wsdl"
      load="cd.getCourseCatalogXML.send()"
      showBusyCursor="true" fault="Alert.show(event.fault.message), 'Error'" result="cdResult(event)">
      <mx:operation name="getCourseCatalogXML" resultFormat="e4x">
      <mx:request>
      <calendarid>3</calendarid>
      </mx:request>
      </mx:operation>
      </mx:WebService>

      <mx:Script>
      <![CDATA[
      import mx.controls.Alert;
      import mx.rpc.events.ResultEvent;
      import mx.rpc.events.FaultEvent;

      [Bindable]
      public var outputString:String

      public function cdResult(event:ResultEvent):void
      {
      outputString = event.result as String
      }
      ]]>
      </mx:Script>

      <mx:Canvas horizontalScrollPolicy="off" verticalScrollPolicy="off">
      <mx:Text width="100%" paddingLeft="4" paddingRight="4" paddingTop="4">
      <mx:text>OUTPUT:{outputString}</mx:text>
      </mx:Text>
      </mx:Canvas>

      </mx:Application>