Ultrashock Forums > Flash > Flex
Flex AbstractService

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
Flex AbstractService
Old 2008-01-18

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:

Code:
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:

Code:
<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.
postbit arrow 2 comments | 1375 views postbit arrow Reply: with Quote   
Registered User
akhtar is offline
seperator
Posts: 274
2004-07-13
Age: 26
akhtar lives in Pakistan
seperator

Ultrashock Member Comments:
akhtar akhtar is offline akhtar lives in Pakistan 2008-01-20 #2 Old  
Anyone! Nutrox, i need help man.
Reply With Quote  
akhtar akhtar is offline akhtar lives in Pakistan 2008-01-21 #3 Old  
i am sorry guys, it was easy, i figured it out, thanks anyways.

var token:AsyncToken = AsyncToken(service.getBAmount());

need to be changed as
var token:AsyncToken = AsyncToken(service.getBAmount(arg1, arg2, arg3));
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: