all groups > dotnet remoting > september 2005 >
You're in the

dotnet remoting

group:

.NET Remoting, C#, IIS Server, first remote call succeeds, second fails with "The Underlying connection was closed: Unable to connect to the remote se



.NET Remoting, C#, IIS Server, first remote call succeeds, second fails with "The Underlying connection was closed: Unable to connect to the remote se chugg
9/8/2005 9:14:54 AM
dotnet remoting: I am using IIS Server and .NET Remoting. The code is written using C#.
The code works fine when the client is on the same network as the
server. When the client is moved to a different network, the code
fails. However, the "codes = Manager.GetIrCodeRatingsByCdm(3517);" call
works fine. It returns a list of codes. I wrote debug statements on the
server to verify the server code actually was executed. Indeed it was.
The problem is the line "bool required = !code.Optional;". After a very
long wait, this causes the exception, "The Underlying connection was
closed: Unable to connect to the remote server". It acts as though the
server went away but it hasn't. I placed debug statements in the code
on the server for "code.Optional". This code was never hit. It just
causes the exception. Defaults are used on the client and for the
server. "code.Optional" simply returns a value. There is no major
processing going on so some kind of time out doesn't seem like the
problem. Any ideas?

The client code:

IIrCodeRating code = null;
ArrayList codes = null;
HttpChannel channel = new HttpChannel();
ChannelServices.RegisterChannel(channel);
string url = "http://updater.control4.com:8086/BizFactory.soap";
Manager = (IBizFactory)Activator.GetObject( typeof(IBizFactory), url );

try
{
codes = Manager.GetIrCodeRatingsByCdm(3517);
if (codes.Count > 0)
{
code = (IIrCodeRating)codes[0];
bool required = !code.Optional;
}
}
catch (Exception ex)
{
MessageBox.Show("Verify SQL/Application Server is running. Message: " +
ex.Message,"Error: FillCommandListFromWeb (GetIrCodeRatingsByCdm)");
}
Re: .NET Remoting, C#, IIS Server, first remote call succeeds, second fails with "The Underlying connection was closed: Unable to connect to the remot chugg
9/13/2005 8:32:14 AM
Some additional information. The server code uses MarshalByRefObject.
However, when I changed this to Serialize I still got the same error
back. Again, the problem is that the remoting call returns an array
list my debugging shows that the code really was hit that creates the
ArrayList. However, when I try to access members of one of the Objects
on the ArrayList, it returns the error that the underlying connection
was closed. However, the Remoting Web Service is up and running.

Also, I read from a book that you should stay away from properties when
using Web Services. Most of the server code is written using Web
Services. Are there really any limitations in using properties and Web
Services for remoting? Am I understanding this correctly that
properties are the Get and Set of C#? I added some calls that did not
use properties but still had the problem. Do all properties need to be
removed? What are the limitations of properties and web services?

The web.config file has the following in it.

<system.runtime.remoting>
<application>
<service>
<wellknown
type="Control4.DataRater.DataBiz.BizFactory,
Control4.DataRater.DataBiz"
objectUri="BizFactory.soap"
mode=Singleton" />
</service>
<channels>
<channel ref="http">
</channel>
</channels>
</application>
</system.runtime.remoting>
Re: .NET Remoting, C#, IIS Server, first remote call succeeds, second fails with "The Underlying connection was closed: Unable to connect to the remot chugg
9/13/2005 8:32:21 AM
Some additional information. The server code uses MarshalByRefObject.
However, when I changed this to Serialize I still got the same error
back. Again, the problem is that the remoting call returns an array
list my debugging shows that the code really was hit that creates the
ArrayList. However, when I try to access members of one of the Objects
on the ArrayList, it returns the error that the underlying connection
was closed. However, the Remoting Web Service is up and running.

Also, I read from a book that you should stay away from properties when
using Web Services. Most of the server code is written using Web
Services. Are there really any limitations in using properties and Web
Services for remoting? Am I understanding this correctly that
properties are the Get and Set of C#? I added some calls that did not
use properties but still had the problem. Do all properties need to be
removed? What are the limitations of properties and web services?

The web.config file has the following in it.

<system.runtime.remoting>
<application>
<service>
<wellknown
type="Control4.DataRater.DataBiz.BizFactory,
Control4.DataRater.DataBiz"
objectUri="BizFactory.soap"
mode=Singleton" />
</service>
<channels>
<channel ref="http">
</channel>
</channels>
</application>
</system.runtime.remoting>
AddThis Social Bookmark Button