all groups > macromedia flash flash remoting > june 2004 >
You're in the

macromedia flash flash remoting

group:

From Remoting AS1 to Remoting AS2


From Remoting AS1 to Remoting AS2 initObject
6/16/2004 7:15:38 AM
macromedia flash flash remoting:
hi,

i try to make my remoting app work with the new remoting API AS2.0, i try to
call a remote web service with Flash Remoting, it was working with the
netServices object like this :

#include "NetServices.as"

var myURL = "http://fs27/flashremoting/gateway.aspx";
var myServicePath =
"http://institutionnel.sidf.lille/fr/webservice/fondecran.asmx?wsdl";

var myResult = new Object();

myResult.onResult = function (data) {
trace("Data received from Server : " + data);
};

myResult.onStatus = function (info) {
trace("An error occurred : " + info.description);
};

var myServer = NetServices.createGatewayConnection(myURL);
var myService = myServer.getService(myServicePath, myResult);
myService.recupActualites();

///////////////////////////////////

Now i try to make this work in AS2 with new API like this :

import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;

import mx.remoting.debug.NetDebug;

NetDebug.initialize();

var webService:Service = new Service(
"http://fs27/flashremoting/gateway.aspx",
null,
"http://institutionnel.sidf.lille/fr/webservice/fondecran.asmx?wsdl",
null,
null);

var pc:PendingCall = webService.RecupActualites();
pc.responder = new RelayResponder(this, "getTemp_Result", "getTemp_Fault");

function getTemp_Result(re:ResultEvent):Void
{
trace('hello");
}
function getTemp_Fault(fe:FaultEvent):Void
{
trace( fe.fault.faultstring);
}

///////////////////////////////////////////

But no luck, i don't even know how to check if the connection is successfull
since the NetConnection Debugger does not seems to work, does anybody can help
me ?

tks a lot !
Re: From Remoting AS1 to Remoting AS2 Tmac
6/16/2004 9:30:46 AM
On first glance I see a difference between "myService.recupActualites();" in
the first section and "var pc:PendingCall = webService.RecupActualites();"
in the second section calling the web service method.

[quoted text, click to view]

Re: From Remoting AS1 to Remoting AS2 initObject
6/16/2004 1:51:13 PM
hi, tks for your answer.

i did a modification to the call of the webmethod i replaced this :

var pc:PendingCall = webService.RecupActualites();

by this :

var pc:PendingCall = webService.recupActualites();

but no luck it does not seems to work, i'm still searching, thank you
Re: From Remoting AS1 to Remoting AS2 Tmac
6/19/2004 6:43:24 PM
You can find the Remote DataGrid application in the following folder:
/Program Files/Macromedia/Flash MX 2004/en/First Run/RemotingSamples on your
computerand you'll find a working exanple of the api and connector samples.
[quoted text, click to view]

AddThis Social Bookmark Button