Home » Flex

Handling Webservice using Flex

28 April 2009 No Comment
Share on Facebook

In this tutorial we are going to handle Webservice file from Flex. Before going deep into this

tutorial, Let us see what is a Webservice first.


The term Web services describes a standardized way of integrating Web-based applications using the

XML, SOAP, WSDL and UDDI open standards over an Internet protocol backbone. XML is used to tag the

data, SOAP is used to transfer the data, WSDL is used for describing the services available and

UDDI is used for listing what services are available. Used primarily as a means for businesses to

communicate with each other and with clients, Web services allow organizations to communicate data

without intimate knowledge of each other’s IT systems behind the firewall.

The basic Web services platform is XML + HTTP.

XML provides a language which can be used between different platforms and programming languages and

still express complex messages and functions.

The HTTP protocol is the most used Internet protocol.

Unlike Flash Flex has built in Webservice Component


In webService we will be defining its ID and wsdl, wsdl points to the

http://www.webservicex.net/ValidateEmail.asmx?WSDL external location.


Operation defines the webservice operation, here we will also mention result and fault event.


request to send parameters to the webservice, if we are invoking an operation that does not need

parameter then no need to use tag.

once the webservice component is finished we will be invoking the webservice operation by

Here email is webservice id, IsValidEmail is operation.


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
   import mx.rpc.events.FaultEvent;
   import mx.controls.Alert;
   import mx.rpc.events.ResultEvent;
   private function onValidate(event:ResultEvent) : void
   private function onError(event:FaultEvent) : void
  <mx:TextInput id="text1"/>
  <mx:Button id="ValidateEmail" label="ValidateEmail"
  <mx:WebService id="email" wsdl="http://www.webservicex.net/ValidateEmail.asmx?WSDL" showBusyCursor="true">
   <mx:operation name="IsValidEmail" result="onValidate(event);"

No related posts.


We don't share your email anywhere, grab our rss via feedburner