(Preview)
Package | mx.rpc.soap.mxml |
Class | public dynamic class WebService |
Inheritance | WebService ![]() ![]() ![]() ![]() |
Implements | IMXMLSupport, IMXMLObject |
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |

The <mx:WebService> tag accepts the following tag attributes:
<mx:WebService Properties concurrency="multiple|single|last" destination="No default." id="No default." serviceName="No default." showBusyCursor="false|true" makeObjectsBindable="false|true" useProxy="false|true" wsdl="No default." Events fault="No default." result="No default." />
An <mx:WebService> tag can have multiple <mx:operation> tags, which have the following tag attributes:
<mx:operation Properties concurrency="multiple|single|last" name=No default, required. resultFormat="object|xml|e4x" makeObjectsBindable="false|true" Events fault=No default. result=No default. />An <mx:Operation> tag contains an <mx:request> tag. To specify an XML structure in an <mx:request> tag, you must set the value of the tag's
format
attribute to "xml"
. Otherwise, the body is converted into Objects.
Public Properties
Property | Defined By | ||
---|---|---|---|
serviceName : String Deprecated: Please Use destination | WebService |
Protected Methods
Public Constants
Property Detail
serviceName | property |
serviceName:String
Deprecated: Please Use destination
Implementation
public function get serviceName():String
public function set serviceName(value:String):void
Constructor Detail
Method Detail
Examples How to use this example
WebServiceExample.mxml
<?xml version="1.0" encoding="utf-8"?> <!-- Simple example to demonstrate the WebService tag. --> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"> <!-- Make sure the Flex Data Services proxy-config.xml file contains the following definition: <destination id="DefaultHTTP"> <properties> <dynamic-url>http://ws.invesbot.com</dynamic-url> </properties> </destination> --> <fx:Script> <![CDATA[ import mx.controls.Alert; ]]> </fx:Script> <fx:Declarations> <mx:WebService id="WS" wsdl="http://ws.invesbot.com/stockquotes.asmx?WSDL" useProxy="true" fault="Alert.show(event.fault.faultString), 'Error'"> <mx:operation name="GetQuote" resultFormat="object"> <mx:request> <symbol>{stockSymbol.text}</symbol> </mx:request> </mx:operation> </mx:WebService> </fx:Declarations> <mx:Panel title="WebService Example" height="75%" width="75%" paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> <mx:Label width="100%" color="blue" text="Enter a stock symbol to obtain a quote."/> <mx:TextInput id="stockSymbol" text="ADBE"/> <mx:Button label="Get Quote" click="WS.GetQuote.send()"/> <mx:Text htmlText="Company: {WS.GetQuote.lastResult.GetQuoteResult.StockQuote.Company}"/> <mx:Text htmlText="Current price: ${WS.GetQuote.lastResult.GetQuoteResult.StockQuote.Price}"/> </mx:Panel> </s:Application>
Wed Nov 21 2018, 06:34 AM -08:00