0 Replies Latest reply on Jul 17, 2006 2:58 PM by NedKost

    WebServices Through Script

    NedKost
      I'm trying to take call a WSDL WebService using the CScript block inside an MXML page (using FLEX2). I was wondering what would be the best way to do this? I want to bind the result to an Array for manipulation inside another CScript function. I looked at the Example provided inside the Help file, but didn't see a way to specify the WSDL path, nor the operation name.

      Here is what I would like to do:

      quote:


      <mx:Script>
      <![CDATA[
      import mx.collections.ArrayCollection;
      import mx.utils.ArrayUtil;

      public var qData:ArrayCollection = new ArrayCollection();

      public function populateQuestionData():void
      {
      <!-- CALL WEB SERVICE TO GET DATA HERE, AND CONTINUE IF SUCCESSFUL-->
      var success:Boolean = getQuestionData();

      <!-- I AM TRYING TO BIND THE RESULT TO THE ARRAY HERE, CURRENTLY I'M USING A WEB SERVICE VARIABLE THAT IS OUTSIDE THE SCRIPT-->
      var qResults:Array = ArrayUtil.toArray(wsTest.RetrieveQuestionData.lastResult.RetrieveQuestionDataResult.NewDa taSet);
      var test:String = "test";

      }
      ]]>
      </mx:Script>




      Thanks,
      -Ned