[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

mac

7/1/2004 2:58:00 PM

Hello.
I got a remote object that has some method "foo(some_object o)", that
somehow changes the "o" object.
From client i create some_object o, pass it to the remote method, but "o"
doesn't changes!

Server class:

public void foo(some_object o) {
o.some_property = ......
}

Client:
some_object o = new some_object();

........
server.foo(o);

// o.some_property don't change!!!!!!!!!!


What am i doing wrong?


1 Answer

Ken Kolda

7/1/2004 3:45:00 PM

0

You have two choices for resolving this:

1. Change the foo() call to be: "foo(ref some_object o)".
2. Change your some_object class to derive from MarhsalByRefObject. In this
case, the object will reside on the client and, when the server sets its
properties, it will call back to the client to do so.

Given that you made your class serializable, option #1 is probably what you
want. The cost is that your object will be serialized/deserialized twice --
once when passed to the server and once when passed back.

Ken


"mac" <mactemp@ua.fm> wrote in message
news:uZfVQv3XEHA.2972@tk2msftngp13.phx.gbl...
> Hello.
> I got a remote object that has some method "foo(some_object o)", that
> somehow changes the "o" object.
> From client i create some_object o, pass it to the remote method, but "o"
> doesn''t changes!
>
> Server class:
>
> public void foo(some_object o) {
> o.some_property = ......
> }
>
> Client:
> some_object o = new some_object();
>
> ........
> server.foo(o);
>
> // o.some_property don''t change!!!!!!!!!!
>
>
> What am i doing wrong?
>
>