Sunny,
thanks for your response, you are right; there is no direct connect.
I thought when I do so, all parameters will be passed through the proxy
computer and not that the asp.net computer will try to connect directly to
the computer hosting the dll.
Does anybody know how can I force the connection to be established through
the proxy computer and not directly?
Thanks again
Stefan
"Sunny" <sunny@newsgroups.nospam> schrieb im Newsbeitrag
news:%23QkgsYIHFHA.3624@tk2msftngp13.phx.gbl...
[quoted text, click to view] >
> "Stefan Rosi" <stefan.rosi_remove_all_underscores_gmail_com> wrote:
>
> > Hallo everybody,
> >
> > I wrote a dll to manage the operations with the database; this dll
> > includes only one class inherited from MarshalByRefObject
> >
> > and almost all its functions take and/or return DataSets(i.e.
serializable
> > objects).
> >
> > This dll should be accessed remotely from the ASp.Net component. For
> > security reasons the ASP.NET computer should have no
> >
> > direct access to the computer hosting this dll.
> >
> > So I programmed a wrapper class which just gets a proxy to the hosted
> > object and returns it (remotely) to the ASP.NET layer.
> >
> > All objects are hosted using the IIS and the standard HttpChannel.
> >
> > Anyways I was getting the error "The underlying connection was closed".
> >
> > When I modified the proxy class (i.e. the class which retrieves the data
> > component and returns it to the ASP.NET) so that
> >
> > it just returns a locally instantiated object everything worked ok.
When
> > I prevented the proxy class from acting like a server
> >
> > and tried to get the remote data component everything works also ok.
> >
> > I GUESS when the proxy class receives a request from the ASP.NET
component
> > it breaks the connection with it in order to
> >
> > establish a connection with the server hosting the dll (maybe because
both
> > connection use the http channel on port 80). But I
> >
> > don't know what to do.
> >
> >
> >
> > Can anybody help me to solve this problem? Or does any body know a
better
> > approach to do it.
> >
> >
> >
> > The proxy class looks like this
> >
> >
> > Class ProxyClass
> > {
> > public DataComp GetDataComp()
> > {
> > DataCom dComp = (DataComp)
> > Activator.GetObject(typeof(DataComp),"theDataCompURL");
> > // pass the network credential
> > return dComp;
> > }
> > }
> >
> > And on the ASP.NET server i use
> >
> > ProxyClass prox = (ProxyClass)
> > Activator.GetObject(typeof(ProxyClass),"theDataCompURL");
> > DataComp dComp = prox.GetDataComp();
> >
> > Thanks alot in advance
> > Stefan
>
> Stefan,
> You mean - no direct network access?
>
> If so, it's normal that it does not work. When you return the object from
> your wrapper, actually you pass only ObjRef, so the receiving component
> will try to connect to the original object directly. And if there is no
> direct network access, it will fail.
>
> If I do not understand you correctly, please clarify.
>
> Sunny