Handling Webservice using Flex Rukovanje Webservice koristeći Flex
In this tutorial we are going to handle Webservice file from Flex. In this tutorial ćemo se nositi Webservice datoteku iz Flex. Before going deep into this Prije odlaska dublje u ovu
tutorial, Let us see what is a Webservice first. udžbenik, Neka nam vidjeti što je Webservice prvi.
Webservice: Webservice:
The term Web services describes a standardized way of integrating Web-based applications using the Pojam Web usluge opisuje standardizirani način integriranja web-based aplikacije koristeći
XML, SOAP, WSDL and UDDI open standards over an Internet protocol backbone. XML, SOAP, WSDL i UDDI otvorene standarde na okosnicu Interneta protokola. XML is used to tag the XML se koristi za oznaku
data, SOAP is used to transfer the data, WSDL is used for describing the services available and podataka, SOAP se koristi za prijenos podataka, WSDL se koristi za opis usluge dostupne i
UDDI is used for listing what services are available. UDDI se koristi za unos koje usluge su dostupne. Used primarily as a means for businesses to Koristi se prvenstveno kao sredstvo za tvrtke
communicate with each other and with clients, Web services allow organizations to communicate data komuniciraju međusobno i sa strankama, web-usluge omogućuju organizacijama da komuniciraju podataka
without intimate knowledge of each other's IT systems behind the firewall. bez intimni poznavanje međusobnih IT sustavima iza vatrozida.
The basic Web services platform is XML + HTTP. Osnovni Web usluge platforma je XML + HTTP.
XML provides a language which can be used between different platforms and programming languages and XML omogućuje jezik koji može biti korišten između različitih platformi i programskih jezika i
still express complex messages and functions. još uvijek izraziti složene poruke i funkcije.
The HTTP protocol is the most used Internet protocol. HTTP protokol se najviše koriste internet protokol.
Unlike Flash Flex has built in Webservice Component Za razliku od Flash Flex je izgrađen u Webservice komponente
<mx:WebService> <mx:WebService>
In webService we will be defining its ID and wsdl, wsdl points to the U WebService ćemo se definira njegov ID i WSDL, WSDL bodova
http://www.webservicex.net/ValidateEmail.asmx?WSDL external location. http://www.webservicex.net/ValidateEmail.asmx?WSDL vanjsku lokaciju.
<mx:Operation> <mx:Operation>
Operation defines the webservice operation, here we will also mention result and fault event. Operacija definira webservice operacije, ovdje također ćemo spomenuti rezultat i greške događaju.
<mx:request> <mx:request>
request to send parameters to the webservice, if we are invoking an operation that does not need Zahtjev za slanje parametre Web server, ako smo zazivajući operaciji koju nije potrebno
parameter then no need to use tag. parametra onda nema potrebe za korištenje oznake.
once the webservice component is finished we will be invoking the webservice operation by jednom Webservice komponenta je završio ćemo zazivajući webservice operaciji
email.IsValidEmail.send(); email.IsValidEmail.send ();
Here email is webservice id, IsValidEmail is operation. Ovdje je e-mail webservice identifikacija, IsValidEmail je rad.
FullCode FullCode
<?xml version="1.0" encoding="utf-8"?> <? Xml version = "1.0" encoding = "utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <mx:Script> <![CDATA[ <! [CDATA [ import mx.rpc.events.FaultEvent; uvoz mx.rpc.events.FaultEvent; import mx.controls.Alert; uvoz mx.controls.Alert; import mx.rpc.events.ResultEvent; uvoz mx.rpc.events.ResultEvent; private function onValidate(event:ResultEvent) : void privatnim funkciju onValidate (događaj: ResultEvent): void { ( mx.controls.Alert.show(String(event.result)); mx.controls.Alert.show (String (event.result)); } ) private function onError(event:FaultEvent) : void privatnim funkciju onError (događaj: FaultEvent): void { ( mx.controls.Alert.show(String(event.fault.faultDetail)); mx.controls.Alert.show (String (event.fault.faultDetail)); } ) ]]> ]]> </mx:Script> </ Mx: Script> <mx:VBox> <mx:VBox> <mx:TextInput id="text1"/> <mx:TextInput id="text1"/> <mx:Button id="ValidateEmail" label="ValidateEmail" <Mx: Button id = "ValidateEmail" label = "ValidateEmail" click="email.IsValidEmail.send();"/> klikni = "email.IsValidEmail.send ();"/> </mx:VBox> </ Mx: vbox> <mx:WebService id="email" wsdl="http://www.webservicex.net/ValidateEmail.asmx?WSDL" showBusyCursor="true"> <mx:WebService id="email" wsdl="http://www.webservicex.net/ValidateEmail.asmx?WSDL" showBusyCursor="true"> <mx:operation name="IsValidEmail" result="onValidate(event);" <Mx: operacija name = "IsValidEmail" result = "onValidate (događaj);" fault="onError(event);"> kvara = "onError (događaj);"> <mx:request> <mx:request> <Email>{text1.text}</Email> <Email> () Text1.text </ Email> </mx:request> </ Mx: upit> </mx:operation> </ Mx: rad> </mx:WebService> </ Mx: WebService> </mx:Application> </ Mx: Primjena>












































Leave your response! Ostavite odgovor!