Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    calling webservice stops after 10 times from Flex

    My webservice is calling every 10 secs for only 10 times, then it stops calling. I have to restart the server again for it to work. let me know what i am doing wrong. Also is this a asynchronous way of calling. I know flex and action script call asynchronously, just want to make sure.

    private var peopleArray:Array = ['X','Y','Z'];
    <mx:Script>
    <![CDATA[
    private function init():void{
    arrCollection = new ArrayCollection(peopleArray);
    var refreshtimer:Timer = new Timer(10000);//call webservice every 10 sec
    refreshtimer.addEventListener(TimerEvent.TIMER,refreshTimerHandler);

    refreshtimer.start();
    webServiceList.addEventListener(LoadEvent.LOAD,onWSDLLoad);

    peopleDatagrid.Values = out;
    }

    public function refreshTimerHandler(event:TimerEvent):void
    {
    if(loaded)
    {
    webServiceList.loadWSDL();
    webServiceList.GetPeopleStatistics.send();
    }

    }

    public function onFaultEvent(evt:FaultEvent):void
    {
    // Alert.show(evt.fault.faultString, evt.fault.faultDetail);
    Alert.show(evt.fault.message);
    trace("loading error");
    refreshtimer.stop();

    }
    private function onWSDLLoad(event:LoadEvent):void
    {
    loaded = true;
    //refreshtimer.start();
    }

    private function showResult(e:ResultEvent):void
    {
    out= e.result as ArrayCollection;
    peopleDatagrid.Values = out;
    }

    ]]>
    </mx:Script>

    <mx:WebService id="webServiceList"

    service = "MyService"
    port = "BasicHttpBinding_SOAPService"
    destination="genesysWS" showBusyCursor="false"
    wsdl="MyService.svc?wsdl"
    useProxy="true" >
    <mx:operation name="GetPeopleStatistics" resultFormat="object"
    fault="mx.controls.Alert.show(event.fault.faultString)"
    result="showResult(event)">
    <mx:request>
    <peopleNames>{arrCollection}</peopleNames>
    </mx:request>
    </mx:operation>
    </mx:WebService>
    Last edited by saha ch; 01-29-2010 at 09:02 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •