Packagesekati.rpc
Classpublic class SOAPService
InheritanceSOAPService Inheritance flash.events.EventDispatcher

SOAPService provides a SOAP WebService client interface.

WARNING: SOAPService cannot be compiled with the flash IDE as of Flash CS3 due to its dependency on the Flex3 SDK core which is required to be initialized to access mx.rpc.WebService. This means that compilation must take place either within a Flex Project or (thanks to the initFlexCore work-around in a pure actionscript project with mxmlc (e.g. FlexBuilder or FDT).


Example
   ws = new SOAPService( 'http://archive.sekati.com/swsdk/soap_server.php?wsdl', 'SekatiWebServiceKit' );
   
   ws.addEventListener( ServiceEvent.LOAD, loadHandler );
   ws.addEventListener( ServiceEvent.FAULT, faultHandler );
   ws.addEventListener( ServiceEvent.RESULT, resultHandler );
   
   protected function loadHandler(e : ServiceEvent) : void {
    trace( "LOAD HANDLER:###:::::%%%%->" + e.type );
    ws.service.serviceTest( );
    ws.service.helloWorld( 'jason' );
    ws.service.doPercent( 15, 500 );
    ws.service.fakeMethodWillFail( );
   }  
   
   protected function resultHandler(e : ServiceEvent) : void {
    trace( "RESULT.HANDLER:###:::::%%%%=> [" + e.result + "]" );
   } 
   
   protected function faultHandler(e : ServiceEvent) : void {
    trace( "FAULT.HANDLER:###:::::%%%%=> [" + e.fault + "]" );
   }   
  

See also

sekati.events.ServiceEvent


Public Properties
 PropertyDefined by
  available : Boolean
[read-only] Return the WebService availability status.
SOAPService
  service : WebService
[read-only] Return the WebService reference for direct RPC calls.
SOAPService
Protected Properties
 PropertyDefined by
  isServiceLoaded : Boolean = false
SOAPService
  ws : WebService
SOAPService
Public Methods
 MethodDefined by
  
SOAPService(wsdl:String, service:String = null, port:String = null)
SOAPService Constructor
SOAPService
Protected Methods
 MethodDefined by
  
initFlexCore():void
mx.rpc.soap.WebService dies when built in a pure ActionScript projects as it requires the Flex core be initialized (as it is in a flex project), therefore we must fake it to use flex bound classes: really lame.
SOAPService
  
serviceFault(e:FaultEvent):void
Dispatch information about failures.
SOAPService
  
serviceLoad(e:LoadEvent):void
Mark the WebService WSDL as loaded and accessible for RPC calls.
SOAPService
  
serviceResult(e:ResultEvent):void
Dispatch the results of a webservice method call.
SOAPService
Property detail
availableproperty
available:Boolean  [read-only]

Return the WebService availability status.

Implementation
    public function get available():Boolean
isServiceLoadedproperty 
protected var isServiceLoaded:Boolean = false
serviceproperty 
service:WebService  [read-only]

Return the WebService reference for direct RPC calls.

Implementation
    public function get service():WebService
wsproperty 
protected var ws:WebService
Constructor detail
SOAPService()constructor
public function SOAPService(wsdl:String, service:String = null, port:String = null)

SOAPService Constructor

Parameters
wsdl:String — webservice url
 
service:String (default = null) — webservice name
 
port:String (default = null) — webservice port
Method detail
initFlexCore()method
protected function initFlexCore():void

mx.rpc.soap.WebService dies when built in a pure ActionScript projects as it requires the Flex core be initialized (as it is in a flex project), therefore we must fake it to use flex bound classes: really lame.

serviceFault()method 
protected function serviceFault(e:FaultEvent):void

Dispatch information about failures.

Parameters
e:FaultEvent
serviceLoad()method 
protected function serviceLoad(e:LoadEvent):void

Mark the WebService WSDL as loaded and accessible for RPC calls.

Parameters
e:LoadEvent
serviceResult()method 
protected function serviceResult(e:ResultEvent):void

Dispatch the results of a webservice method call.

Parameters
e:ResultEvent