Arkej
2008-07-23 14:12:41 UTC
Hello again with another question,
I want to publish a factory interface on the server side and i do it using
RemotingServices.Marshal. On the client side I use
RemotingServices.Connect(typeof(IFactory), "url of published object") and i
get an IFactory proxy. Until here everything ok, I do have an interface to
the factory object on the server needing no implementation assemblies of the
server. Now if IFactory is as follows:
public interface IFactory
{
IBlaBlaManager GetManager( string managerId);
}
and I call on the client ifactory.GetManager("tubo") I want it to give me an
IBlaBlaManager interface to the remote object on the server implementing the
IBlaBlaManager. But if on the server the implementation of the IFactory is
as follows:
IBlaBlaManager IFactory.GetManager( string managerId)
{
return (IBlaBlaManager)(new BlaManager());
}
and BlaManager does implement IBlaBlaManager. It won't work because it
remotes(serialize) the BlaManager object which is not known on the client.
Is there a way to get only the interface of the BlaManager object rather
than publishing the BlaManager and accessing it form the client in the same
way as the factory is accessed?
Thx
Robert
I want to publish a factory interface on the server side and i do it using
RemotingServices.Marshal. On the client side I use
RemotingServices.Connect(typeof(IFactory), "url of published object") and i
get an IFactory proxy. Until here everything ok, I do have an interface to
the factory object on the server needing no implementation assemblies of the
server. Now if IFactory is as follows:
public interface IFactory
{
IBlaBlaManager GetManager( string managerId);
}
and I call on the client ifactory.GetManager("tubo") I want it to give me an
IBlaBlaManager interface to the remote object on the server implementing the
IBlaBlaManager. But if on the server the implementation of the IFactory is
as follows:
IBlaBlaManager IFactory.GetManager( string managerId)
{
return (IBlaBlaManager)(new BlaManager());
}
and BlaManager does implement IBlaBlaManager. It won't work because it
remotes(serialize) the BlaManager object which is not known on the client.
Is there a way to get only the interface of the BlaManager object rather
than publishing the BlaManager and accessing it form the client in the same
way as the factory is accessed?
Thx
Robert