Ken Kolda
10/1/2004 2:56:00 PM
See comments inline below...
"José Manuel Chávez" <desarrollodotnet[at]yahoo[dot]com> wrote in message
news:3DA90E2C-F86F-4F71-8733-544DD4F98765@microsoft.com...
> The first question is : My Remotable class is:
> Telefonica.Morosos.BusinessLogic.Facade.Agencia
>
> I distribute only the Interface called: IAgencia which is in the assembly:
> Telefonica.Morosos.BusinessLogic.IFacade
>
> Is the following ok?
> <wellknown type="Telefonica.Morosos.BusinessLogic.Facade.Agencia,
> Telefonica.Morosos.BusinessLogic.IFacade"
> objectUri="Morosos.Agencia"
> mode="Singleton" />
>
No -- you must supply the name for a concrete type for the wellknown type on
the server. Consider this: when a request comes in for your object and all
you've supplied to the remoting infrastructre is an interface type, what
class should it instantiate to service those requests? The remoting system
is going to call "new IFacade()" which, of course, makes no sense. That
said, just because you expose the concrete type doesn't mean the client
needs this object's complete definition -- it can access it using the
interface only.
> Second Question: Do I need to add a reference in my windows service
project
> to both Projects:
> Telefonica.Morosos.BusinessLogic.Facade and
> Telefonica.Morosos.BusinessLogic.IFacade
> ?
I believe you will, but even if you don't have to explicitly add the
reference, both assemblies are dependencies and .NET will automatically
detect this and copy both to the bin folder for the service's project.
>
>
> Third question:
> In My Web Aapplication (Client) I have the following in the Globla.asax:
>
> protected void Application_Start(Object sender, EventArgs e)
> {
> RemotingConfiguration.Configure(Server.MapPath("Remoting.config"));
> }
>
I believe that when using a web app you must place your ermoting
configuration information inside your web.config file. It will then be
automatically read without the need to call
RemotingConfiguration.Configure(). Give that a shot and see if it works for
you.
Ken