View comments | RSS feed

WebServiceConnector class (Flash Professional only)

Inheritance RPC > WebServiceConnector

ActionScript Class Name mx.data.components.WebServiceConnector

This class allows you to connect to remote web services using ActionScript code instead of component instances on the Stage. To use the WebServiceConnector class, you need to add an instance of the WebServiceConnector component to your library. The component does not need to be placed directly on the Stage. You must import the ActionScript class mx.data.components.WebServiceConnector at the beginning of the script or use the fully qualified class name throughout your code.

Method summary for the WebServiceConnector class

The following table lists the method of the WebServiceConnector class.

Method

Description

WebServiceConnector.trigger()

Initiates a call to a web service.

Property summary for the WebServiceConnector class

The following table lists properties of the WebServiceConnector class.

Property

Description

WebServiceConnector.multiple SimultaneousAllowed

Indicates whether multiple calls can take place at the same time.

WebServiceConnector.operation

Indicates the name of an operation that appears within the SOAP port in a WSDL file.

WebServiceConnector.params

Specifies data that is sent to the server when the next trigger() operation is executed.

WebServiceConnector.results

Identifies data that was received from the server as a result of the trigger() operation.

WebServiceConnector.suppress InvalidCalls

Indicates whether to suppress a call if parameters are invalid.

WebServiceConnector.WSDLURL

Specifies the URL of the WSDL file that defines the web service operation.

Event summary for the WebServiceConnector class

The following table lists events of the WebServiceConnector class.

Event

Description

WebServiceConnector.result

Broadcast when a call to a web service completes successfully.

WebServiceConnector.send

Broadcast when the trigger() method is in process, after the parameter data has been gathered but before the data is validated and the call to the web service is initiated.

WebServiceConnector.status

Broadcast when a call to a web service is initiated, to inform the user of the status of the operation.


Version 8

Comments


No screen name said on Dec 5, 2005 at 12:34 PM :
What happend to the timeout property?
jdehaan said on Dec 5, 2005 at 6:49 PM :
That property was removed from the API/product in Flash 8.
pollymath said on Apr 19, 2006 at 3:52 AM :
BEWARE!!! if you are going to use this to consume public web services.

Allthough all will apear to work fine when you test your movie in Flash, when you try to view your movie in a browser it will not work unless the service provider has placed a crossdomain.xml file in thier root directory.

This is a result of macromedia changing their securtiy policy in a rather reactive way.

Sadly this rather invlidates this component in most circumstances. For most people the only work around will be to proxy the service using the server side script of your choice. ( or if you are very lucky, as i was you might get the provider to include the file)
jdehaan said on Apr 19, 2006 at 11:47 AM :
This is actually not a change with this release/component. You have always had to have a crossdomain policy file to work with this component/public services.
Themicster said on Feb 28, 2007 at 7:16 PM :
So now that the timeout property is gone, what is the default timeout or is there another way to manage how long flash will try to connect and get a response. We have a number of customers using dialup and it could be a long wait.
No screen name said on Sep 8, 2008 at 6:24 AM :
I have been trying to connect Flash 8 AS 2 to a php NuSOAP webservice for the last week and half now, and yet to get this to work.

I have tried the webservice class, webservice connector, crossdomain.xml with <allow-access-from domain="*" />, proxy.php bypass, but nothing seems to work.

Below is my code I copied from LiveDocs, works in the authoring environment, but gives error "Client.Disconnected... Could not load WSDL..." when viewing in IE. (The RD.tce is an online debugger I found on the net - that part works showing the errors)

var wscListener:Object = new Object();
wscListener.result = function(evt:Object) {
RD.tce(evt.target.results);
};
var fault = function (stat) {
if (stat.code == "WebServiceFault"){
RD.tce(stat.data.faultcode);
RD.tce(stat.data.faultstring);
RD.tce(stat.data.detail);
}
};


var wsConn:WebServiceConnector = new WebServiceConnector();
wsConn.addEventListener("result", wscListener);
wsConn.addEventListener("status", fault);

wsConn.WSDLURL = "http://www.flash-mx.com/mm/tips/tips.cfc?wsdl";
wsConn.operation = "getTipByProduct";
wsConn.params = ["Flash"];
wsConn.trigger();

RD.tce("BLAH BLAH BLAH 3 - This is to test the Remote Debugger");

Every forum out of the thousands I have visited duing this time, have had this question numerous times dating back to 2006, either getting the standard reply "include crossdomain.xml" or no replies, or a plead for help from the original poster " no replies.. no one out there"

I'm starting to think Flash is not capable of accessing webservice data???

 

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

Current page: http://livedocs.adobe.com/flash/8/main/00004278.html