| Package | mx.rpc.soap.mxml |
| Class | public dynamic class WebService |
| Inheritance | WebService WebService AbstractWebService AbstractService Proxy Object |
| Implements | IMXMLSupport, IMXMLObject |
Hide MXML Syntax
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.
| Property | Defined By | ||
|---|---|---|---|
![]() | channelSet : ChannelSet
Provides access to the ChannelSet used by the service.
| AbstractService | |
| concurrency : String
Value that indicates how to handle multiple calls to the same service.
| WebService | ||
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | |
![]() | description : String
The description of the service for the currently active port.
| AbstractWebService | |
![]() | destination : String
The destination of the service.
| AbstractWebService | |
![]() | endpointURI : String
The location of the WebService.
| AbstractWebService | |
![]() | headers : Array
[read-only]
Returns the array of SOAPHeaders registered for the WebService.
| AbstractWebService | |
![]() | httpHeaders : Object
Custom HTTP headers to be sent to the SOAP endpoint.
| AbstractWebService | |
![]() | makeObjectsBindable : Boolean
When this value is true, anonymous objects returned are forced to
bindable objects.
| AbstractWebService | |
![]() | operations : Object
The Operations array is usually only set by the MXML compiler if you
create a service using an MXML tag.
| AbstractService | |
![]() | port : String
Specifies the port within the WSDL document that this WebService should
use
| AbstractWebService | |
| protocol : String
Deprecated, use the appropriate destination instead, or if using a url, use DefaultHTTP or DefaultHTTPS.
| WebService | ||
![]() | prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object | |
![]() | ready : Boolean
[read-only]
Specifies whether the WebService is ready to make requests.
| AbstractWebService | |
![]() | requestTimeout : int
Provides access to the request timeout in seconds for sent messages.
| AbstractService | |
![]() | rootURL : String
The URL that the WebService should use when computing relative URLs.
| AbstractWebService | |
![]() | service : String
Specifies the service within the WSDL document that this WebService
should use.
| AbstractWebService | |
| serviceName : String | WebService | ||
| showBusyCursor : Boolean
If true, a busy cursor is displayed while a service is executing.
| WebService | ||
![]() | useProxy : Boolean
Specifies whether to use the Flex proxy service.
| AbstractWebService | |
![]() | wsdl : String
The location of the WSDL document for this WebService.
| WebService | |
![]() | xmlSpecialCharsFilter : Function
Custom function to be used to escape XML special characters before
encoding any simple content.
| AbstractWebService | |
| Method | Defined By | ||
|---|---|---|---|
|
WebService(destination:String = null)
Creates a new WebService component.
| WebService | ||
![]() |
Adds a header that will be applied to all operations of this web service.
| AbstractWebService | |
![]() |
addSimpleHeader(qnameLocal:String, qnameNamespace:String, headerName:String, headerValue:String):void
Add a header that will be applied to all operations of this WebService.
| AbstractWebService | |
![]() |
Returns a Boolean value that indicates whether the WebService ready to
load a WSDL (does it have a valid destination or wsdl specified).
| WebService | |
![]() |
Clears the headers that applied to all operations.
| AbstractWebService | |
![]() |
Disconnects the service's network connection and removes any pending
request responders.
| AbstractService | |
![]() |
Returns a header if a match is found based on QName localName and URI.
| AbstractWebService | |
|
Returns an Operation of the given name.
| WebService | ||
![]() |
Indicates whether an object has a specified property defined.
| Object | |
|
Called automatically by the MXML compiler if the WebService is setup using a tag.
| WebService | ||
![]() |
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter.
| Object | |
![]() |
Instructs the WebService to download the WSDL document.
| WebService | |
![]() |
Logs the user out of the destination.
| AbstractService | |
![]() |
Indicates whether the specified property exists and is enumerable.
| Object | |
![]() |
Removes the header with the given QName from all operations.
| AbstractWebService | |
![]() |
Sets the credentials for the destination accessed by the service when using Data Services on the server side.
| AbstractService | |
![]() |
Sets the availability of a dynamic property for loop operations.
| Object | |
![]() |
The username and password to authenticate a user when accessing
the webservice.
| AbstractWebService | |
![]() |
Represents an instance of WebService as a String, describing
important properties such as the destination id and the set of
channels assigned.
| WebService | |
![]() |
Returns the primitive value of the specified object.
| Object | |
| concurrency | property |
concurrency:String [read-write] Value that indicates how to handle multiple calls to the same service. The default value is multiple. The following values are permitted:
public function get concurrency():String
public function set concurrency(value:String):void
| protocol | property |
public var protocol:String
Deprecated, use the appropriate destination instead, or if using a url, use DefaultHTTP or DefaultHTTPS.
The deprecated behavior will simply update the destination if the default is being used.
| serviceName | property |
serviceName:String [read-write] public function get serviceName():String
public function set serviceName(value:String):void
| showBusyCursor | property |
showBusyCursor:Boolean [read-write]
If true, a busy cursor is displayed while a service is executing. The default
value is false.
public function get showBusyCursor():Boolean
public function set showBusyCursor(value:Boolean):void
| WebService | () | Constructor |
public function WebService(destination:String = null)
Creates a new WebService component.
Parametersdestination:String (default = null) — the destination of the WebService, should match a destination name in the services-config.xml file.
|
| getOperation | () | method |
public override function getOperation(name:String):AbstractOperation
Returns an Operation of the given name. If the Operation wasn't
created beforehand, a new mx.rpc.soap.mxml.Operation is
created during this call. Operations are usually accessible by simply
naming them after the service variable
(myService.someOperation), but if your Operation name
happens to match a defined method on the service
(like setCredentials), you can use this method to get the
Operation instead.
Parameters
name:String — Name of the Operation.
|
AbstractOperation — Operation that executes for this name.
|
| initialized | () | method |
public function initialized(document:Object, id:String):void
Called automatically by the MXML compiler if the WebService is setup using a tag. If you create the WebService through ActionScript you may want to call this method yourself as it is useful for validating any arguments.
Parameters
document:Object — the MXML document on which this WebService lives
|
|
id:String — the id of this WebService within the document
|
<?xml version="1.0"?>
<!-- Simple example to demonstrate the WebService tag. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<!-- 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>
-->
<mx:Script>
<![CDATA[
import mx.controls.Alert;
]]>
</mx:Script>
<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>
<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>
</mx:Application>