| Package | sekati.rpc |
| Class | public class SOAPService |
| Inheritance | SOAPService flash.events.EventDispatcher |
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).
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
| Property | Defined by | ||
|---|---|---|---|
| available : Boolean [read-only]
Return the WebService availability status.
| SOAPService | ||
| service : WebService [read-only]
Return the WebService reference for direct RPC calls.
| SOAPService | ||
| Property | Defined by | ||
|---|---|---|---|
| isServiceLoaded : Boolean = false | SOAPService | ||
| ws : WebService | SOAPService | ||
| Method | Defined by | ||
|---|---|---|---|
|
SOAPService(wsdl:String, service:String = null, port:String = null)
SOAPService Constructor
| SOAPService | ||
| Method | Defined 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 | ||
| available | property |
available:Boolean [read-only]Return the WebService availability status.
Implementation public function get available():Boolean
| isServiceLoaded | property |
protected var isServiceLoaded:Boolean = false
| service | property |
service:WebService [read-only]Return the WebService reference for direct RPC calls.
Implementation public function get service():WebService
| ws | property |
protected var ws:WebService
| SOAPService | () | constructor |
public function SOAPService(wsdl:String, service:String = null, port:String = null)SOAPService Constructor
Parameterswsdl:String — webservice url
|
|
service:String (default = null) — webservice name
|
|
port:String (default = null) — webservice port
|
| 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):voidDispatch information about failures.
Parameterse:FaultEvent |
| serviceLoad | () | method |
protected function serviceLoad(e:LoadEvent):voidMark the WebService WSDL as loaded and accessible for RPC calls.
Parameterse:LoadEvent |
| serviceResult | () | method |
protected function serviceResult(e:ResultEvent):voidDispatch the results of a webservice method call.
Parameterse:ResultEvent |