[flexcoders] HTTPService.send help needed

2005-04-08 Thread viraf_bankwalla


Hi,

Enclosed is a simple example of a HTTPService.send.  I set the 
result, fault and xmlDecode properties in the call - however, they 
do not appear to be called.

Could someone please shed light on what I am doing wrong. 

Thanks.

--- startup.mxml
?xml version=1.0 encoding=utf-8?
mx:Application 
xmlns:mx=http://www.macromedia.com/2003/mxml; 
xmlns=*
backgroundColor=white
creationComplete=startupApp()
mx:Script
![CDATA[
function startupApp()
{
var handler:ServiceHandler = new 
ServiceHandler(catalogRequest);
handler.getCatalog();
}   
]]
/mx:Script
mx:HTTPService id=catalogRequest url=catalog.xml 
resultFormat=object  showBusyCursor=true/

mx:Text text=This is a test /
/mx:Application

--- ServiceHandler.as
import mx.utils.Delegate;

class ServiceHandler
{
var service:mx.servicetags.HTTPService;

public function ServiceHandler
(service:mx.servicetags.HTTPService)
{
super();
this.service = service;
}

public function getCatalog()
{
var call = service.send();
// call.xmlDecode = Delegate.create( Object( this ), 
this.onDecode )
call.result = Delegate.create( this, this.onResult )
call.fault = Delegate.create( this, this.onResult )

}

public function onResult( event : Object ) : Void
{
trace(onResult);
}

public function onFault( event : Object ) : Void
{
trace(onFault);
}

public function onDecode( node : XMLNode ) : Object
{
trace(onDecode);
return new Object();
}
}






 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] HTTPService.send help needed

2005-04-08 Thread Tracy Spratt

I think you are misusing the call object when you try to set up the
result handler there.

Put the result and fault handlers directly on the HTTPService tag, then
in the handler, use the call object to determine result processing.

Tracy

-Original Message-
From: viraf_bankwalla [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 08, 2005 9:04 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] HTTPService.send help needed



Hi,

Enclosed is a simple example of a HTTPService.send.  I set the 
result, fault and xmlDecode properties in the call - however, they 
do not appear to be called.

Could someone please shed light on what I am doing wrong. 

Thanks.

--- startup.mxml
?xml version=1.0 encoding=utf-8?
mx:Application 
xmlns:mx=http://www.macromedia.com/2003/mxml; 
xmlns=*
backgroundColor=white
creationComplete=startupApp()
mx:Script
![CDATA[
function startupApp()
{
var handler:ServiceHandler = new 
ServiceHandler(catalogRequest);
handler.getCatalog();
}   
]]
/mx:Script
mx:HTTPService id=catalogRequest url=catalog.xml 
resultFormat=object  showBusyCursor=true/

mx:Text text=This is a test /
/mx:Application

--- ServiceHandler.as
import mx.utils.Delegate;

class ServiceHandler
{
var service:mx.servicetags.HTTPService;

public function ServiceHandler
(service:mx.servicetags.HTTPService)
{
super();
this.service = service;
}

public function getCatalog()
{
var call = service.send();
// call.xmlDecode = Delegate.create( Object( this ), 
this.onDecode )
call.result = Delegate.create( this, this.onResult )
call.fault = Delegate.create( this, this.onResult )

}

public function onResult( event : Object ) : Void
{
trace(onResult);
}

public function onFault( event : Object ) : Void
{
trace(onFault);
}

public function onDecode( node : XMLNode ) : Object
{
trace(onDecode);
return new Object();
}
}






 
Yahoo! Groups Links



 







 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/