3 Replies Latest reply on Dec 5, 2008 8:23 AM by wkolcz

    Web Service Help

    wkolcz Level 1
      I am attempting to switch from Remote Object to Web Service on a Flex Video Player/Tracker I am building for the University since we use Blue Dragon instead of real ColdFusion.

      In my AS, I included in the function that stops the video a call to a web service to count, in the database, based information:

      var trackerDAO:WebService = new WebService();
      trackerDAO.wsdl = "https://umm/prmc/videotrack/trackerDAO.cfc?wsdl";
      trackerDAO.addEventListener(FaultEvent.FAULT, alertFault);
      trackerDAO.countIt(addOne, results, action, source);

      I know the CFC is in that location and it is set to remote for the access, but nothing seems to happen, nor am I getting an Error. Is there something I am missing?

      Here is the simple CFC:
      <cfcomponent displayname="VideoTrackerDAO" hint="I manage the reporting of video plays">

      <cffunction name="countIt" access="remote" returntype="void" output="false" hint="I add the number of video plays">
      <cfargument name="addOne" type="numeric" required="yes">
      <cfargument name="duration" type="numeric" required="yes">
      <cfargument name="action" type="string" required="yes">
      <cfargument name="videoFile" type="string" required="yes">
      <cfquery name="countIt" datasource="webstatistics-test">
      Insert Into tracker (clickCount, duration, action, videoFile, datePlayed)
      VALUES(#arguments.addOne#, #arguments.duration#, '#arguments.action#', '#arguments.videoFile#', #Now()#)
      </cfquery>
      </cffunction>

      </cfcomponent>
        • 1. Re: Web Service Help
          wkolcz Level 1
          Ok, while scowering the internet for more examples to help. I see that i missed a very big step in not including the Operation call. I modified my code to include it, but seems like everyones examples are to simply get info from other sites and not passmultiple variables. What am I missing my my code below. I need to pass 4 varbales to the CFC (addOne, duration, action, VideoFile)

          var trackerDAO:WebService = new WebService();
          trackerDAO.wsdl = "https://umm/prmc/videotrack/trackerDAO.cfc?wsdl";
          trackerDAO.loadWSDL();
          var operation:Operation = new Operation(null, "countIt");
          operation.addEventListener(FaultEvent.FAULT, alertFault);
          operation.request(addOne, results, action, source); <---Wrong??
          operation.send();
          • 2. Re: Web Service Help
            wkolcz Level 1
            I further modified my code to this:

            var trackerDAO:WebService = new WebService(" http://ummcstqa16vm/prmc/videotracking/trackerDAO.cfc?wsdl");
            var operation:Operation = new Operation(trackerDAO,"countIt");
            operation.addEventListener(FaultEvent.FAULT, alertFault);
            operation.countIt(addOne, results, action, source);

            Now I am getting this Error:
            Call to a possibly undefined method countIt through a reference with static type mx.rpc.soap:Operation.
            • 3. Re: Web Service Help
              wkolcz Level 1
              Do I have to change it to:

              var trackerDAO:WebService = new WebService(" http://ummcstqa16vm/prmc/videotracking/trackerDAO.cfc?wsdl");
              var operation:Operation = new Operation(trackerDAO,"countIt");
              operation.addEventListener(FaultEvent.FAULT, alertFault);
              trackerDAO.countIt(addOne, results, action, source);