all groups > dotnet remoting > january 2006 >
You're in the

dotnet remoting

group:

Remoting not remoting... I don't understand why


Remoting not remoting... I don't understand why ThunderMusic
1/30/2006 4:25:10 PM
dotnet remoting:
Hi,
I have a service that accepts remoting connections. On the other hand, I
have a client application that wants to connect to the service and get new
objects. The problem is that when I try to instanciate a remote object, I
always get a local object. I should receive a proxy, but I receive a local
instance. I tried loading the configuration file just before my first call
to the object without success.

Here is the code I'm using right now :

string path =
System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"TeamplateBLL.Client.config");
System.Runtime.Remoting.RemotingConfiguration.Configure(path);
Teamplate.BLL.BUserList bu = new Teamplate.BLL.BUserList();
try
{
string x = bu.GetActiveDirectoryRecords();
System.Windows.Forms.MessageBox.Show(x);
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.ToString());
}

the 'bu' object should be a proxy but instead it is a local
Teamplate.BLL.BUserList object... The method succeed, but local, not
remote... Is there a possible source from here to get a solution or will
you need the configuration files?

Thanks

ThunderMusic

Re: Remoting not remoting... I don't understand why ThunderMusic
1/30/2006 5:06:33 PM
ok, I really need to know what's wrong, so I post the 2 configuration files
so you can see if everything is right (it seems to be)
TeamplateBLL.Client.config :
<configuration>
<system.runtime.remoting>
<application>
<client url="tcp://127.0.0.1:30520">
</client>
<service>
<activated type="Teamplate.BLL.BSession, TeamplateBLL" />
<activated type="Teamplate.BLL.BModel, TeamplateBLL" />
<activated type="Teamplate.BLL.BDocument, TeamplateBLL" />
<activated type="Teamplate.BLL.BFileList, TeamplateBLL" />
<activated type="Teamplate.BLL.BGroup, TeamplateBLL" />
<activated type="Teamplate.BLL.BProcess, TeamplateBLL" />
<activated type="Teamplate.BLL.BFolder, TeamplateBLL" />
<activated type="Teamplate.BLL.BUser, TeamplateBLL" />
<activated type="Teamplate.BLL.BUserList, TeamplateBLL" />
<activated type="Teamplate.BLL.BWorkList, TeamplateBLL" />
<activated type="Teamplate.BLL.EFile, TeamplateBLL" />
<activated type="Teamplate.BLL.RecordList, TeamplateBLL" />
<activated type="Teamplate.BLL.BSharePoint, TeamplateBLL" />
<activated type="Teamplate.BLL.BExchangeDAV, TeamplateBLL" />
<activated type="Teamplate.BLL.BTriggerManager, TeamplateBLL" />
<activated type="Teamplate.BLL.BInfoPath, TeamplateBLL" />
<activated type="Teamplate.BLL.ModelDeployment, TeamplateBLL" />
</service>
</application>
</system.runtime.remoting>
</configuration>

TeamplateBLL.exe.config : (the server)
<configuration>
<system.runtime.remoting>
<application>
<lifetime leaseTime="5M" sponsorshipTimeout="5M" renewOnCallTime="2M"
leaseManagerPollTime="5M"/>

<channels>
<channel ref="tcp" port="30520" machineName="localhost">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
<channel ref="http" port="30521" machineName="localhost" />
</channels>

<service>
<activated type="Teamplate.BLL.BSession, TeamplateBLL" />
<activated type="Teamplate.BLL.BModel, TeamplateBLL" />
<activated type="Teamplate.BLL.BDocument, TeamplateBLL" />
<activated type="Teamplate.BLL.BFileList, TeamplateBLL" />
<activated type="Teamplate.BLL.BGroup, TeamplateBLL" />
<activated type="Teamplate.BLL.BProcess, TeamplateBLL" />
<activated type="Teamplate.BLL.BFolder, TeamplateBLL" />
<activated type="Teamplate.BLL.BUser, TeamplateBLL" />
<activated type="Teamplate.BLL.BUserList, TeamplateBLL" />
<activated type="Teamplate.BLL.BWorkList, TeamplateBLL" />
<activated type="Teamplate.BLL.EFile, TeamplateBLL" />
<activated type="Teamplate.BLL.RecordList, TeamplateBLL" />
<activated type="Teamplate.BLL.BSharePoint, TeamplateBLL" />
<activated type="Teamplate.BLL.BExchangeDAV, TeamplateBLL" />
<activated type="Teamplate.BLL.BTriggerManager, TeamplateBLL" />
<activated type="Teamplate.BLL.BInfoPath, TeamplateBLL" />
<activated type="Teamplate.BLL.ModelDeployment, TeamplateBLL" />
</service>
</application>
</system.runtime.remoting>
</configuration>

The server seems to respond right in telnet and in IE (well, it gives an
error because the protocol is not respected, but at least it does
something).

I found this post and I'm pretty sure the problem is in the config files,
but I can't see where....
http://groups.google.fr/group/microsoft.public.dotnet.framework.remoting/browse_thread/thread/2d783c784fa7694c/6d44ed8454430761?lnk=st&q=%2B%22remoting%22+%2B%22local+object%22&rnum=7&hl=fr#6d44ed8454430761

Please help!!

thanks

ThunderMusic


[quoted text, click to view]

Re: Remoting not remoting... I don't understand why serge calderara
1/30/2006 11:46:38 PM
If you want to receive aproxy object, as far as I could read, you need to
inherits you remote object from the MarshalByref class
I am also deep in remoting, and I have to say is that it is not easy when
you just start as I am

regards
serge

[quoted text, click to view]
Re: Remoting not remoting... I don't understand why oleksa
1/31/2006 1:43:44 AM
Hello.

Take a look at MSDN help where Remoting basics are described.
I've wrote some tests available at
<http://gzip.rsdn.ru/File/35065/DIvsRef.zip> but VS 2005 required.
Performance tests could be skipped. Take a look at Factory class that
implements IFactory interface. This class is available only on the
server side and activated from the client application on
Activator.CreateInstance call. Client application knows only about
IFactory interfaces and has no reference to the server assembly.
Remoting infrastructure is configured via app.config configuration
files for server and client accordingly.
Re: Remoting not remoting... I don't understand why ThunderMusic
1/31/2006 10:31:21 PM
Hi,
For those who were seeking for the problem, you may be pleased to know we
found the solution. In fact, I don't really know why it works, but now, it
works (and seem to work fine, but I did not test myself, but did not have
any more remarks about it, so I assume it works), we just transfered all the
<service> part into the <Client> part into the client's config file, and now
it works... we receive the transparent proxy objects and they seem to
contain the information from the server (not local information), so I assume
it's ok.

Now I have another question... WHY? (the eternal one...) I mean, those
objects are supposed to be server activated (or did I miss something?), so
why must I put them into the <client> part of the client's config file while
they are in the <service> part of the server's config file, shouldn't they
be in the same part of the config file?!?

Thanks to those who helped with the other posts (Serge Calderara & Oleksa)

ThunderMusic

"ThunderMusic" <NOdanlatSPAM@hotmaildotcom> a écrit dans le message de news:
OMAH4leJGHA.3120@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

Re: Remoting not remoting... I don't understand why oleksa
2/1/2006 1:23:06 AM
Client should know where server objects are hosted so URI was placed in
the clients configuration file. You may put those URI into the code
like string constant but it is ugly IMHO.
Re: Remoting not remoting... I don't understand why serge calderara
2/1/2006 4:32:27 AM
hi,

could you please post your client and server config file, I would be
interresting to see how did you configure it
just to be sure that I have understand as well

thnaks

[quoted text, click to view]
Re: Remoting not remoting... I don't understand why ThunderMusic
2/1/2006 8:37:53 AM
it was posted higher in the thread, but I'll post with the revisions here...

Server config:
<configuration>
<system.runtime.remoting>
<application>
<lifetime leaseTime="5M" sponsorshipTimeout="5M" renewOnCallTime="2M"
leaseManagerPollTime="5M"/>

<channels>
<channel ref="tcp" port="30520" machineName="localhost">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
<channel ref="http" port="30521" machineName="localhost" />
</channels>

<service>
<activated type="Teamplate.BLL.BSession, TeamplateBLL" />
<activated type="Teamplate.BLL.BModel, TeamplateBLL" />
<activated type="Teamplate.BLL.BDocument, TeamplateBLL" />
<activated type="Teamplate.BLL.BFileList, TeamplateBLL" />
<activated type="Teamplate.BLL.BGroup, TeamplateBLL" />
<activated type="Teamplate.BLL.BProcess, TeamplateBLL" />
<activated type="Teamplate.BLL.BFolder, TeamplateBLL" />
<activated type="Teamplate.BLL.BUser, TeamplateBLL" />
<activated type="Teamplate.BLL.BUserList, TeamplateBLL" />
<activated type="Teamplate.BLL.BWorkList, TeamplateBLL" />
<activated type="Teamplate.BLL.EFile, TeamplateBLL" />
<activated type="Teamplate.BLL.RecordList, TeamplateBLL" />
<activated type="Teamplate.BLL.BSharePoint, TeamplateBLL" />
<activated type="Teamplate.BLL.BExchangeDAV, TeamplateBLL" />
<activated type="Teamplate.BLL.BTriggerManager, TeamplateBLL" />
<activated type="Teamplate.BLL.BInfoPath, TeamplateBLL" />
<activated type="Teamplate.BLL.ModelDeployment, TeamplateBLL" />
</service>
</application>
</system.runtime.remoting>
</configuration>


Client config:
<configuration>
<system.runtime.remoting>
<application>
<client url="tcp://127.0.0.1:30520">
<activated type="Teamplate.BLL.BSession, TeamplateBLL" />
<activated type="Teamplate.BLL.BModel, TeamplateBLL" />
<activated type="Teamplate.BLL.BDocument, TeamplateBLL" />
<activated type="Teamplate.BLL.BFileList, TeamplateBLL" />
<activated type="Teamplate.BLL.BGroup, TeamplateBLL" />
<activated type="Teamplate.BLL.BProcess, TeamplateBLL" />
<activated type="Teamplate.BLL.BFolder, TeamplateBLL" />
<activated type="Teamplate.BLL.BUser, TeamplateBLL" />
<activated type="Teamplate.BLL.BUserList, TeamplateBLL" />
<activated type="Teamplate.BLL.BWorkList, TeamplateBLL" />
<activated type="Teamplate.BLL.EFile, TeamplateBLL" />
<activated type="Teamplate.BLL.RecordList, TeamplateBLL" />
<activated type="Teamplate.BLL.BSharePoint, TeamplateBLL" />
<activated type="Teamplate.BLL.BExchangeDAV, TeamplateBLL" />
<activated type="Teamplate.BLL.BTriggerManager, TeamplateBLL" />
<activated type="Teamplate.BLL.BInfoPath, TeamplateBLL" />
<activated type="Teamplate.BLL.ModelDeployment, TeamplateBLL" />
</client>
<channels>
<channel ref="tcp"/>
</channels>
<service>
</service>
</application>
</system.runtime.remoting>
</configuration>

I hope it helps

ThunderMusic


"serge calderara" <sergecalderara@discussions.microsoft.com> wrote in
message news:EA89CB9F-3B2A-4C69-9641-8CDEBAD63676@microsoft.com...
[quoted text, click to view]
AddThis Social Bookmark Button