...

calling webservice stops after 10 times from Flex

saha ch
01-28-2010, 08:46 PM
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>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum