| Corstiaan Smorenburg 2005-04-19, 7:45 am |
| Hi all,
This is my first post to this list, so a quick introduction.
I've worked with Flash since version 2, and a few weeks ago went in the
deep end using MX 2004 AS2. Most project I do use Flash Remoting for
..NET with a C# / SQL serverside. I have the following problem wich I
already posted to FlashCoders, but got no answer yet, so I'm trying
here, forgive the crosspost. Here goes....
When I use Flash remoting I mirror most of my .NET classes with AS2
classes client side. This workst perfect. When in .NET we create an
instance of class "Person", return it to flash it is instanciated as
"Person" bij flash. Works like a charm.
However, I want to return an instance of class "Person" to .NET using:
(for email I left out all includes and imports, namespaces, var
declaration etc. please assume all is in place and working.)
// In AS, class Person:
public function save():Void{
trace("trying to save Person(" + _id + ")");
_pendCall =3D _remotingService._save(_id,this);
_pendCall.responder =3D new
RelayResponder(this,"frSaveResult","frSaveFail");
}
public function frSaveResult(res:ResultEvent):Void{
trace("saving done");
=09
mx.remoting.debug.NetDebug.trace({level:"Debug",message:"Person
saved"});
}
public function frSaveFail(fault:FaultEvent):Void{
trace("saving fail");
=09
mx.remoting.debug.NetDebug.trace({level:"Error",message:fault.fault.faul
tstring});
}
// in C#:
namespace Client.Project.FlashRemoting{
public class PersonService{
public Person _save(){
return null;
}
public Person _save(int personID){
return null;
}
public Person _save(Person personobj){
return Person;
}
public Person _save(int personID, object
personobj){
return ((Person)personobj);
}
}
public class Person : RemoteObject
{
public Person(int id){
this.ID =3D id;
this.ServiceClass =3D
"Client.Project.FlashRemoting.PersonService";
this.ASType =3D "Person";
}
public Person(int id, int order, DateTime
dateCreated){
this.ID =3D id;
this.Order =3D order;
this.DateCreated =3D dateCreated;
this.ServiceClass =3D
"Client.Project.FlashRemoting.PersonService";
this.ASType =3D "Person";
}
}
}
All I get in the Output window is:
trying to save eetdag(2) ---------------------------------------
4/18 11:24:12 [INFO] : Invoking _save on
Client.Project.FlashRemoting.PersonService
and then ... Silence ...
To make sure the Remoting is working at all (namespace correct, includes
in place etc..) we tried an overloaded method in .NET wich only requires
the _id. This works, i get in the Output window:
trying to save eetdag(2) ---------------------------------------
4/18 11:28:43 [INFO] : Invoking _save on
Twa.Eetdagboek.FlashRemoting.EetdagService
saving done
4/18 11:28:44 [INFO] :
Twa.Eetdagboek.FlashRemoting.EetdagService._save() returned null
So, can we not send complex objects to .NET using Flash Remoting, or am
I missing something here? And as a side question, what is the best way
of debugging Flash Remoting? Since I'm using AS2 Remoting code, my
Remoting debugger stopped working. And in .NET, the soonest we can debug
is the contructor of the objects, is there any way of debugging the
de-serialization or Reflection of RemoteObjects?
Thanx for reading, greetz,
Corstiaan,
ZoomBIM, Hilversum, NL
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
|