Server encountered an internal error.  
Author Message
Yassi





PostPosted: .NET Remoting and Runtime Serialization, Server encountered an internal error. Top

Hello,

I am running a .NET remoting client/server application using interface.
When i run both the server and the client on the same machine then client can instantiate the remote object factory class and basically connect to the server.
But when the server is running on another computer, then client cannot get a proxy to the remote object factory and it gives me this vague error message (remoting Exception ):

Server encountered an internal error. To get more info turn on customErrors in the server's config file."

(now, i know i can set the customError of config file to off and receive more detailed error message, but i am not using a config file for my server yet and i don't know how to set the customError programatically). anway, i have searched through and i don't know why client cannot connect.
Here is some more info:
1) The two machines on which the client and the server run seperately are connected properly together and there no firewall on them.
2) the client computer sees the open port on the server computer but still cannot connect.
3) when i run the server and client on the same computer, and i type the URI of the remote object in browser (in the form: http://machineName:portnumber/URI.soap) , i receive:
System.ArgumentNullException: No message was deserialized prior to calling the DispatchChannelSink.
Parameter name: requestMsg

at System.Runtime.Remoting.Channels.DispatchChannelSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.SoapServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.Http.HttpServerTransportSink.ServiceRequest(Object state)
at System.Runtime.Remoting.Channels.SocketHandler.ProcessRequestNow()

But when i run them on two different computers, i receive:

Server encountered an internal error. To get more info turn on customErrors in the server's config file.

I have tried the same thing using ip addresses instead of machine names and exactly the same result.

4) no firewalls on any of the computers
When i telnet the server computer from the client computer, this is what I receive:

HTTP/1.1 500 Server encountered an internal error. To get more info turn on customErrors in the server's config file.
Server: MS .NET Remoting, MS .NET CLR 2.0.50727.42
Content-Length: 106
Connection: Close

Server encountered an internal error. To get more info turn on customErrors in t
he server's config file.

This is all i have done so far and i don't know why i cannot connect to the server when on different machine than the client.

I greatly appreciate any help!
Thanks a lot.


.NET Development29  
 
 
VikasGoyal





PostPosted: .NET Remoting and Runtime Serialization, Server encountered an internal error. Top

hi,

for remoting to work on different machine past .net 1.1 u need to add custom errors tag.

if u r hosting in IIS u can add in web.config .. if tcp host and u can add in application config file.

http://DotNetWithMe.blogspot.com
vikas goyal



 
 
Yassi





PostPosted: .NET Remoting and Runtime Serialization, Server encountered an internal error. Top

I don't understand. How is adding CustomError is relevant to server connection
Is there any way i can do it programmatically
Else, how do I add the custom error tag to config file

thanks!

 
 
Yassi





PostPosted: .NET Remoting and Runtime Serialization, Server encountered an internal error. Top

Problem solved!!!

Turns out that i needed to set the TypeFilterLevel value of automatic deserialization the SoapServerFormatterSink performs to FULL.
I did this programmatically in my code by:

SoapServerFormatterSinkProvider my soapsink = new SoapServerFormatterSinkProvider();
mysoapsink..TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
serverChannel = new HttpServerChannel("ServerChannelName", Port, mysoapsinksinkProvider);
ChannelServices.RegisterChannel(this.serverChannel, false);

before calling RemotingConfiguration.RegisterWellKnownServiceType()

yay!


 
 
Philip K





PostPosted: .NET Remoting and Runtime Serialization, Server encountered an internal error. Top

To programmattically turn off custom errors, so this in your server code:

HttpChannel channel = new HttpChannel(port);

ChannelServices.RegisterChannel(channel, ensureSecurity);

RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;

RemotingConfiguration.RegisterWellKnownServiceType(.....