View comments | RSS feed
Packagemx.rpc.soap
Classpublic dynamic class WebService
InheritanceWebService Inheritance AbstractService Inheritance Proxy Inheritance Object
SubclassesWebService

The WebService class provides access to SOAP-based web services on remote servers.

See also

Using RPC Components


Public Properties
 PropertyDefined by
 InheritedchannelSet : ChannelSet
Provides access to the ChannelSet used by the service.
AbstractService
 Inheritedconstructor : 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.
WebService
  destination : String
The destination of the service.
WebService
  endpointURI : String
The location of the WebService.
WebService
  headers : Array
[read-only] Returns the array of SOAPHeaders registered for the WebService.
WebService
  makeObjectsBindable : Boolean
When this value is true, anonymous objects returned are forced to bindable objects.
WebService
 Inheritedoperations : 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
WebService
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
 InheritedrequestTimeout : 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.
WebService
  service : String
Specifies the service within the WSDL document that this WebService should use.
WebService
  useProxy : Boolean
Specifies whether to use the Flex proxy service.
WebService
  wsdl : String
The location of the WSDL document for this WebService.
WebService
Public Methods
 MethodDefined by
  
WebService(destination:String = null, rootURL:String = null)
Creates a new WebService.
WebService
  
Adds a header that will be applied to all operations of this web service.
WebService
  
addSimpleHeader(qnameLocal:String, qnameNamespace:String, headerName:String, headerValue:String):void
Add a header that will be applied to all operations of this WebService.
WebService
  
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.
WebService
 Inherited
Disconnects the service's network connection and removes any pending request responders.
AbstractService
  
getHeader(qname:QName, headerName:String = null):SOAPHeader
Returns a header if a match is found based on QName localName and URI.
WebService
 Inherited
Returns an Operation of the given name.
AbstractService
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
  
loadWSDL(uri:String = null):void
Instructs the WebService to download the WSDL document.
WebService
 Inherited
Logs the user out of the destination.
AbstractService
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
removeHeader(qname:QName, headerName:String = null):void
Removes the header with the given QName from all operations.
WebService
 Inherited
setCredentials(username:String, password:String):void
Set the credentials for the destination accessed by the service.
AbstractService
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
setRemoteCredentials(remoteUsername:String, remotePassword:String):void
The username and password to authenticate a user when accessing the webservice.
WebService
  
Represents an instance of WebService as a String, describing important properties such as the destination id and the set of channels assigned.
WebService
 Inherited
Returns the primitive value of the specified object.
Object
Protected Methods
 MethodDefined by
 Inherited
callProperty(name:*, ... rest):*
Overrides the behavior of an object property that can be called as a function.
Proxy
 Inherited
Overrides the request to delete a property.
Proxy
 Inherited
Overrides the use of the descendant operator.
Proxy
 Inherited
getProperty(name:*):*
Overrides any request for a property's value.
Proxy
 Inherited
Overrides a request to check whether an object has a particular property by name.
Proxy
 Inherited
Checks whether a supplied QName is also marked as an attribute.
Proxy
 Inherited
Allows enumeration of the proxied object's properties by index number to retrieve property names.
Proxy
 Inherited
Allows enumeration of the proxied object's properties by index number.
Proxy
 Inherited
nextValue(index:int):*
Allows enumeration of the proxied object's properties by index number to retrieve property values.
Proxy
 Inherited
setProperty(name:*, value:*):void
Overrides a call to change a property's value.
Proxy
Events
 EventSummaryDefined by
 Inherited The fault event is dispatched when a service call fails and isn't handled by the Operation itself.AbstractService
 Inherited The invoke event is dispatched when a service Operation is invoked so long as an Error is not thrown before the Channel attempts to send the message.AbstractService
   The LoadEvent.LOAD is dispatched when the WSDL document has loaded successfully.WebService
 Inherited The result event is dispatched when a service call successfully returns and isn't handled by the Operation itself.AbstractService
Public Constants
 ConstantDefined by
  DEFAULT_DESTINATION_HTTP : String = "DefaultHTTP"
[static]
WebService
  DEFAULT_DESTINATION_HTTPS : String = "DefaultHTTPS"
[static]
WebService
Property detail
descriptionproperty
description:String  [read-write]

The description of the service for the currently active port.

Implementation
    public function get description():String
    public function set description(value:String):void
destinationproperty 
destination:String  [read-write]

The destination of the service. This value should match a destination entry in the services-config.xml file.

Implementation
    public function get destination():String
    public function set destination(value:String):void
endpointURIproperty 
endpointURI:String  [read-write]

The location of the WebService. Normally, the WSDL document specifies the location of the services, but you can set this property to override that location.

Implementation
    public function get endpointURI():String
    public function set endpointURI(value:String):void
headersproperty 
headers:Array  [read-only]

Returns the array of SOAPHeaders registered for the WebService.

Implementation
    public function get headers():Array
makeObjectsBindableproperty 
makeObjectsBindable:Boolean  [read-write]

When this value is true, anonymous objects returned are forced to bindable objects.

Implementation
    public function get makeObjectsBindable():Boolean
    public function set makeObjectsBindable(value:Boolean):void
portproperty 
port:String  [read-write]

Specifies the port within the WSDL document that this WebService should use

Implementation
    public function get port():String
    public function set port(value:String):void
rootURLproperty 
rootURL:String  [read-write]

The URL that the WebService should use when computing relative URLs. This property is only used when going through the proxy. When the useProxy property is set to false the relative URL is computed automatically based on the location of the SWF running this application. If not set explicitly rootURL is automatically set to the URL of mx.messaging.config.LoaderConfig.url.

Implementation
    public function get rootURL():String
    public function set rootURL(value:String):void
serviceproperty 
service:String  [read-write]

Specifies the service within the WSDL document that this WebService should use.

Implementation
    public function get service():String
    public function set service(value:String):void
useProxyproperty 
useProxy:Boolean  [read-write]

Specifies whether to use the Flex proxy service. The default value is false. If you do not specify true to proxy requests though the Flex server, you must ensure that Flash Player can reach the target URL. You also cannot use destinations defined in the services-config.xml file if the useProxy property is set to false.

The default value is false.

Implementation
    public function get useProxy():Boolean
    public function set useProxy(value:Boolean):void
wsdlproperty 
wsdl:String  [read-write]

The location of the WSDL document for this WebService. If you use a relative URL, make sure that the rootURL has been specified or that you created the WebService in MXML.

Implementation
    public function get wsdl():String
    public function set wsdl(value:String):void
Constructor detail
WebService()constructor
public function WebService(destination:String = null, rootURL:String = null)

Creates a new WebService. The destination, if specified, should match an entry in services-config.xml. If unspecified, the WebService uses the DefaultHTTP destination. The rootURL is required if you intend to use a relative URL find the WSDL document for this WebService.

Parameters
destination:String (default = null)
 
rootURL:String (default = null)
Method detail
addHeader()method
public function addHeader(header:SOAPHeader):void

Adds a header that will be applied to all operations of this web service.

Parameters
header:SOAPHeader — Actual header.
addSimpleHeader()method 
public function addSimpleHeader(qnameLocal:String, qnameNamespace:String, headerName:String, headerValue:String):void

Add a header that will be applied to all operations of this WebService.

Parameters
qnameLocal:String — the localname for the header QName
 
qnameNamespace:String — the namespace for header QName
 
headerName:String — the name of the header
 
headerValue:String — the value of the header
canLoadWSDL()method 
public function canLoadWSDL():Boolean

Returns a Boolean value that indicates whether the WebService ready to load a WSDL (does it have a valid destination or wsdl specified).

Returns
Boolean
clearHeaders()method 
public function clearHeaders():void

Clears the headers that applied to all operations.

getHeader()method 
public function getHeader(qname:QName, headerName:String = null):SOAPHeader

Returns a header if a match is found based on QName localName and URI.

Parameters
qname:QName — QName of the SOAPHeader.
 
headerName:String (default = null) — Name of a header in the SOAPHeader content (Optional)

Returns
SOAPHeader
loadWSDL()method 
public function loadWSDL(uri:String = null):void

Instructs the WebService to download the WSDL document. The WebService calls this method automatically WebService when specified in the WebService MXML tag, but it must be called manually if you create the WebService object in ActionScript after you have specified the destination or wsdl property value.

Parameters
uri:String (default = null) — If the wsdl hasn't been specified previously, it may be specified here.
removeHeader()method 
public function removeHeader(qname:QName, headerName:String = null):void

Removes the header with the given QName from all operations.

Parameters
qname:QName — QName of the SOAPHeader.
 
headerName:String (default = null) — Name of a header in the SOAPHeader content (Optional)
setRemoteCredentials()method 
public override function setRemoteCredentials(remoteUsername:String, remotePassword:String):void

The username and password to authenticate a user when accessing the webservice. These will be passed as part of the HTTP Authorization header from the proxy to the endpoint. If useProxy is false this property will be ignored.

Parameters
remoteUsername:String — the username to pass to the remote endpoint
 
remotePassword:String — the password to pass to the remote endpoint
toString()method 
public function toString():String

Represents an instance of WebService as a String, describing important properties such as the destination id and the set of channels assigned.

Returns
String
Event detail
loadevent 
Event object type: mx.rpc.soap.LoadEvent
LoadEvent.type property = mx.rpc.soap.LoadEvent.LOAD

The LoadEvent.LOAD is dispatched when the WSDL document has loaded successfully.

The LOAD event type.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
Constant detail
DEFAULT_DESTINATION_HTTPconstant
public static const DEFAULT_DESTINATION_HTTP:String = "DefaultHTTP"
DEFAULT_DESTINATION_HTTPSconstant 
public static const DEFAULT_DESTINATION_HTTPS:String = "DefaultHTTPS"




Take a survey


Comments


No screen name said on Jul 19, 2007 at 9:49 AM :
For anyone experiencing weird errors (ioerrors), the answer could be that your webservice is returning http status code 500 which this webservice class is not able to read.

see: http://livedocs.adobe.com/flex/201/langref/mx/rpc/soap/WebService.html

For more information (maybe this should be added in the docs here too).

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flex/201/langref/mx/rpc/soap/WebService.html