|
Flex applications can exploit the power of web services. A web service provides an interface of methods in a WSDL document available as a URI and accessible at runtime. The transmission of requests and results (SOAP messages) is accomplished trough standard HTTP protocol.
Focusing the attention on MXML language rather than explicit ActionScript 3.0, the tag which enables the developer to use a web service is <mx.WebService>. Every time such a tag is used in a MXML document, the class 'WebService' is instantiated.
As soon as a 'WebService' object is created, no requests are made to the service. Calls to methods of the service must be explicitly specified with proper code.
Specifying the 'wsdl' attribute in the 'WebService' tag enables the getting and relative parsing of the 'wsdl' document which describes the callable methods.
Below it is shown a sample code useful to create a 'WebService' object pointing to a given 'wsdl' document.
<mx:WebService id="idWebService" wsdl="http://lucabonacorsi.org/exampleWebService?wsdl" />
The 'wsdl' property can accept, as values, both absolute paths and relative paths, either on the same server or on different servers.
|