Macromedia Flash Server - RE: Flash Remoting .NET --> AS2 class object not

This is Interesting: Free IT Magazines  
Home > Archive > Macromedia Flash Server > April 2005 > RE: Flash Remoting .NET --> AS2 class object not





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author RE: Flash Remoting .NET --> AS2 class object not
Michael D. Randolph

2005-04-19, 5:45 pm

I've never worked w/ sending custom classes back and forth from AS to
..NET...but to turn your debugger on using the AS2 classes, use this:

mx.remoting.debug.NetDebug.initialize();

Michael Randolph

-----Original Message-----
From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of Corstiaan
Smorenburg
Sent: Tuesday, April 19, 2005 4:21 AM
To: FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
Subject: [FlashComm] Flash Remoting .NET --> AS2 class object not
receivedin Remoting

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 = _remotingService._save(_id,this);
_pendCall.responder = new
RelayResponder(this,"frSaveResult","frSaveFail");
}
public function frSaveResult(res:ResultEvent):Void{
trace("saving done");

mx.remoting.debug.NetDebug.trace({level:"Debug",message:"Person
saved"});
}
public function frSaveFail(fault:FaultEvent):Void{
trace("saving fail");

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 = id;
this.ServiceClass =
"Client.Project.FlashRemoting.PersonService";
this.ASType = "Person";
}
public Person(int id, int order, DateTime
dateCreated){
this.ID = id;
this.Order = order;
this.DateCreated = dateCreated;
this.ServiceClass =
"Client.Project.FlashRemoting.PersonService";
this.ASType = "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



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com