# Problem with webservice / pendingcall : help please!

**URL:** <https://forum.kirupa.com/t/problem-with-webservice-pendingcall-help-please/267379>\
**Category:** Uncategorized\
**Created:** [July 31, 2008, 12:41pm UTC](https://forum.kirupa.com/t/problem-with-webservice-pendingcall-help-please/267379 "2008-07-31T12:41:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandcar](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@sandcar](https://forum.kirupa.com/u/sandcar)\
**Post date:** [July 31, 2008, 12:41pm UTC](https://forum.kirupa.com/t/problem-with-webservice-pendingcall-help-please/267379/1 "2008-07-31T12:41:38Z")

</div>

Hi all,

I’m buiding a class to retrieve a result from a webservice call.

everything is working fine except this:

I need to set the return value of callWS equal to onCallResult result

is there any way that i can do this ?

---------------- test sample code

public function callWs(method:String):String {

```
	var pc: PendingCall = ws[method].("arg1","arg2"...argN)

	pc.onResult = this.onCallResult;
	pc.onFault = this.onCallFault;
       return ; [COLOR="DarkOrange"]// here i whant return the onCallResult result[/COLOR]

}
private function onCallFault(fault:Object):Void {
	trace("Error&gt; "+fault.faultcode);
	trace("Errot faultstring&gt; " +fault.faultstring);
}
private function onCallResult(res:String) {
          // [COLOR="darkorange"]this is the result from the webservice call[/COLOR]
	trace("result&gt;&gt;&gt; "+res);
	//return res;
}

```

thanks in advance 🙂
