|
-
July 25th, 2005, 10:36 AM
#1
need help with config file
i have a remote object in the server side which implements an interface that declared in a dll.
something like that:
DLL-
interface Iremote{..}
Server Side-
class RemoteClass implements Iremote{..}
Client Side-
//connect to server
//Activator.GetObject --> typeof Iremote!!
till now everything is ok
now im trying to put it in a configuration file:
<service>
<wellknown mode="Singleton"
type="ServerSide.RemoteClass ,ServerSide" />
</service>
but what should i write in the "type"??
i know ServerSide.RemoteClass is wrong,
the type supposed to be - new RemoteClass().GetType()
but how to write that in the config?
thanks in advanced
-
July 25th, 2005, 12:36 PM
#2
Re: need help with config file
I assume that the config file is on the client side. So since ServerSide.RemoteClass implements the interface IRemote you can simply write:
<service>
<wellknown mode="Singleton"
type="<IRemoteNamespace>.IRemote, <IRemoteNamespace>" />
</service>
Where <IRemoteNamespace> is the namespace of the IRemote interface.
Hope this works for you.
Mario
-
July 26th, 2005, 02:35 AM
#3
Re: need help with config file
actually the config file is on the server side
so i tried that-
<service>
<wellknown mode="Singleton" type="IRemoteNamespace.IRemote,IRemoteNamespace" objectUri="Server.rem"/>
</service>
but its not working.
what else can it be?
thanks
-
July 28th, 2005, 02:21 AM
#4
Re: need help with config file
-
July 28th, 2005, 02:32 AM
#5
Re: need help with config file
Don't know any specifics but the following links may give you more background information
.NET Remoting FAQ
(Maybe) in particular: HOWTO: Use Interface-based remote objects with config files
Useful? Then click on (Rate This Post) at the top of this post.
-
July 28th, 2005, 03:18 AM
#6
Re: need help with config file
thanks but id didnt found there what i need...
any more ideas?
-
July 28th, 2005, 04:53 AM
#7
Re: need help with config file
I for one find it diificult to debug code I cannot see...
Any chance you can post the client, server and shared library code, as well as the client and server config files?
Useful? Then click on (Rate This Post) at the top of this post.
-
July 28th, 2005, 11:08 AM
#8
Re: need help with config file
ok, here is the code-
//class library
public interface IRemoteObject
{
Guid register();
}
//client side(inside main)
TcpChannel chan=new TcpChannel();
ChannelServices.RegisterChannel(chan);
IRemoteObject obj=(Library.IRemoteObject)Activator.GetObject(typeof(Library.IRemoteObject),"tcp://localhost:8085/Server");
Guid id=obj.register();
//server side(inside main)
RemotingConfiguration.Configure("ServerSide.exe.config");
//server side (config)
<system.runtime.remoting>
<application>
<channels>
<channel name="channel1" ref="tcp" port="8085"></channel>
</channels>
<service>
<wellknown mode="Singleton" type="ServerSide.TasksManagement,ServerSide" objectUri="ServerSide.rem"/>
</service>
</application>
</system.runtime.remoting>
//server side(remote object)
public class TasksManagement: MarshalByRefObject,IRemoteObject
{
public Guid register()
{ return System.Guid.NewGuid();
}
}
-
July 29th, 2005, 01:26 AM
#9
Re: need help with config file
Quick guess: Shouldn't "tcp://localhost:8085/Server" match your server config ie. "tcp//localhost:8055/ServerSide.rem" ?
Useful? Then click on (Rate This Post) at the top of this post.
-
July 29th, 2005, 02:01 AM
#10
Re: need help with config file
ok so i changed it in the server side to-
IRemoteObject obj=(Library.IRemoteObject)Activator.GetObject(typeof(Library.IRemoteObject),"tcp://localhost:8085/ServerSide/TasksManagement.rem");
and in he config on the server side i wrote-
<wellknown mode="Singleton" type="ServerSide.TasksManagement,ServerSide" objectUri="TasksManagement.rem"/>
but it still not working...
-
July 29th, 2005, 02:25 AM
#11
Re: need help with config file
This is still wrong:
"tcp://localhost:8085/ServerSide/TasksManagement.rem"
Should be:
"tcp://localhost:8085/TasksManagement.rem"
This may still not work but it definitely won't work with such obvious mistakes.
Useful? Then click on (Rate This Post) at the top of this post.
-
July 29th, 2005, 03:05 AM
#12
Re: need help with config file
PS. I assume your server code actually is
Code:
RemotingConfiguration.Configure("ServerSide.exe.config");
Console.ReadLine();
Useful? Then click on (Rate This Post) at the top of this post.
-
July 29th, 2005, 03:10 AM
#13
Re: need help with config file
-
July 29th, 2005, 03:18 AM
#14
Re: need help with config file
Useful? Then click on (Rate This Post) at the top of this post.
-
July 29th, 2005, 03:21 AM
#15
Re: need help with config file
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|