Good day, People.
I am facing a slight problem, i have a flex MXML Application which contains two binded Components (forms) consuming one single
webservice class:
package BControl
{
import mx.rpc.AbstractService;
import mx.rpc.soap.mxml.WebService;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
public class Connections
{
private static var serviceRES:AbstractService;
public static function getRESService():AbstractService {
if(serviceRES == null) {
var ws:WebService = new WebService();
ws.wsdl = "http://imran12/ourservices/service.asmx?wsdl";
ws.useProxy = false;
ws.showBusyCursor = true;
ws.loadWSDL();
serviceRES = ws;
}
return serviceRES;
}
}
}
One of the function of webservice recieves two arguments, i am unable to send the Arguments (Request) through AbstractService.
My Component code is:
<mx:Script>
<![CDATA[
import mx.rpc.AsyncRequest;
import BControl.TokenResponder;
import mx.rpc.AsyncToken;
import mx.collections.ArrayCollection;
import mx.rpc.AbstractService;
import mx.rpc.events.ResultEvent;
import BControl.Connections;
import mx.rpc.IResponder;
import BControl.Fetch;
import mx.controls.Alert;
private var service:AbstractService;
[Bindable]
public var getBAmt:Number;
[Bindable]
public var vc:String;
[Bindable]
public var getUAmt:Number;
private function initApp():void {
service = Connections.getRESService();
var token:AsyncToken = AsyncToken(service.getBAmount());
token.addResponder(new TokenResponder(myFunc));
}
private function myFunc(event:ResultEvent):void {
getBAmt = Number(event.result.bAm);
getUAmt = Number(event.result.utlAm);
}
]]>
</mx:Script>
i will appreciate help and little explanation, thanks.
2 REPLIES
- Log in or join for free to make a comment.
Topic Categories


