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

macromedia flash flash remoting

group:

Trouble with Object response


Trouble with Object response darac79
8/4/2004 12:20:46 PM
macromedia flash flash remoting:
I'm Using MX2004 Prof, OC4j App.Server and openAMF
The response of the remoting Method sends an Ressource/ASObject - but I can't
access the properties of my userdefined Class Ressource in this case a simple
String attribute "_name"

In trace re is an Object -> re.result,re.result._name,re._name
are all undefined
it should work if I believe the macromedia tutorials but I don't know what I'm
Doing Wrong


CODE

FLASHSIDE

class wdr.Ressource extends Object {
public var _name:String="test";
function Ressource(str:String){
this._name=str;
}
}

function FlashRemoteServer(pop:wdr.CommunicationManagerInterface ){
this.vater=pop;
this.gatewayPath = "";//variable
this.servicePath = "";//variable
this.serviceConnection = new Object();
this.serviceObject = new Object();
Object.registerClass("wdr.Eintrag", Eintrag);
Object.registerClass("wdr.Ressource", Ressource);
this.init();
}


//-----------------------------------VerbindungsMethoden------------------------
--------------------
public function init():Void {
this.gatewayPath = "http://localhost:9999/gateway";
this.servicePath = "flashserver.FlashRemoteServer";
this.setServiceObject();
}
private function setServiceObject():Void {
NetServices.setDefaultGatewayUrl(this.gatewayPath);
this.serviceConnection = NetServices.createGatewayConnection();
this.serviceObject = this.serviceConnection.getService(this.servicePath,
this);
}
public function getRessource(){
this.setServiceObject();
this.serviceObject.getRessource();
}
public function getRessource_Result(re:ResultEvent):Void{
trace(re.result._name+"/"+re.result+"/"+re);
}


SERVERSIDE in JAVA


1.Version Server Side---------------------------------------------------
public Ressource getRessource(){
Ressource[] b=test.getRessourcen();
return b[0];
}
2. Version Server Side
public Ressource getRessource(){
Ressource[] b=test.getRessourcen();
ASObject a=(ASObject) new ASTranslator().toActionScript(b[0]);
a.setType("Ressource");
return a;
}


package flashserver;
import java.io.Serializable;
public class Ressource implements Serializable{
public String _name="meinName";
public Ressource(String name) {
this._name=name;
}

}


APPSERVER OUTPUT

04.08.2004 13:51:02 org.openamf.invoker.JavaServiceInvoker getServiceMethod
INFO: topRankedMethod: name=getRessource rank=100.0
04.08.2004 13:51:02 org.openamf.DefaultGateway service
INFO: RESPONSE:
[AMFBody: {serviceName=null, serviceMethodName=null, response=null,
type=UNKNOWN
, value=Ressource@933bcb}]

04.08.2004 13:51:02 org.openamf.io.AMFSerializer serializeMessage
INFO: Serializing Message, for more info turn on debug level


I would be really pleased for a little HINT!
Re: Trouble with Object response mfo NO[at]SPAM synapsys.ch
3/9/2005 11:38:06 AM
AddThis Social Bookmark Button