View Single Post
  #4 (permalink)  
Old 08-17-2007, 06:53 AM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 72
aramesh is on a distinguished road
Default Re: Web Services in Flash

Hi EveryBody,
Already I have posted how to use the WerbService. Now posted the sample demonstration and a sample.
Using the WebServiceConnector component you can access remote methods exposed by a server using the industry-standard Simple Object Access Protocol (SOAP). A web service method can accept parameters and return a result.

1) Create a Flash Documnet.
2) Drag two Text Input component from the components window and give its Instance name as "inp_txt" and "res_txt".
3) Create one button to trigger the webserviceconnector component and give its instance name as "TestBtn".
4) Drag a WebServiceConnector component on to the stage and give its instance name as "wsconn".
5) Goto the properties window and select the WSDLURL. Enter this url
"http://www.webservicex.net/ValidateEmail.asmx?WSDL"
6) Select the operation properties, a combo box appeared. Click the combo and select the "IsValidEmail" value.
7) Open the Component Inspector window.
8) Select the webserviceconnector component and goto the component Inspector window.
9) Click the Bindings tab and click the plus symbol to bind the value to other UI components.
10) The params object shows the input variables for that webservice. Select the Email variable and click "ok" button.
11) Some properties are shown below, double click the "bound to" properties. It shows the "Bound To" dialog window select the "inp_txt" text box.
12) Click the plus symbol again, to bind the result on another text box.
13) The result object shows the output send from the webservice. Select the result object and click "ok" button.
14) Some properties are shown below, double click the "bound to" properties. It shows the "Bound To" dialog window select the "res_txt" text box.
15) Write the following codes on the main timeline.

TestBtn.onRelease=function(){
if(inp_txt.text!=""){
res_txt.text="";
wsconn.trigger();
}
else{
inp_txt.text="Enter the Email Id To Test.";
}
}

16) Enter the Email ID you want to check in the "inp_txt" textbox and press the Button. The result "True" (when the id is valid) or "False" (when the id is not valid) is shown on the "res_txt" text box.

Last edited by aramesh : 08-17-2007 at 07:03 AM. Reason: Attaching Sample zip file
Reply With Quote