Dot Net Remoting
-
Hi I have a VB.Net 2005 Remoting Project. A service that is exposing the dot net remoting object on the server and a windows application as a client. But when I run the client form any pc I get the following error "A remote side security requirement was not fulfilled during authentication. Try increasing the ProtectionLevel and/or Impersonationlevel." If any one can help Thanks in Advance :confused:
-
Hi I have a VB.Net 2005 Remoting Project. A service that is exposing the dot net remoting object on the server and a windows application as a client. But when I run the client form any pc I get the following error "A remote side security requirement was not fulfilled during authentication. Try increasing the ProtectionLevel and/or Impersonationlevel." If any one can help Thanks in Advance :confused:
Is the server object exposed in a service? Is the service running?? Is the server running on a seperate machine from your client?? What account is it running under?? Are both machines in the same domain or they in a workgroup configuration?? Is the server running on Windows XP?? If so, does this machine have simple file sharing turned OFF??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Is the server object exposed in a service? Is the service running?? Is the server running on a seperate machine from your client?? What account is it running under?? Are both machines in the same domain or they in a workgroup configuration?? Is the server running on Windows XP?? If so, does this machine have simple file sharing turned OFF??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Hi Dave The Service is running,one can access the port and Ip form another machine using telnet. The service is running on a seprate machine to the client. The Machines are on the same network so in other words they are connecting directly to each other. Simple file Sharing is turned off on the client and on the server. Thanks in Advance :confused:
-
Hi Dave The Service is running,one can access the port and Ip form another machine using telnet. The service is running on a seprate machine to the client. The Machines are on the same network so in other words they are connecting directly to each other. Simple file Sharing is turned off on the client and on the server. Thanks in Advance :confused:
Are the machines in a domain enivronment or workgroup?? What user account in the service running under?? What user account is client code running under??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Are the machines in a domain enivronment or workgroup?? What user account in the service running under?? What user account is client code running under??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Are the machines in a domain enivronment or workgroup?? What user account in the service running under?? What user account is client code running under??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Are the machines in a domain enivronment or workgroup?? What user account in the service running under?? What user account is client code running under??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Are the machines in a domain enivronment or workgroup?? What user account in the service running under?? What user account is client code running under??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Hi Dave I have played around with the TcpChannel Properties but the problem I am running into now is the following error: The server has rejected the client credentials. Thanks in advance
Under remoting, the code on the server instantiates an object using the context of the CLIENT, not the server. Your user account that your logged in under on the client machine becomes part of your context. This context is a security boundry. In a workgroup environment, the account you're using on the client, even though it has the exact same name, is different from the account on the server. Each machine maintains it's own list of user accounts and does not trust the accounts of another machine. In a domain, the machines in it all trust the same list of user accounts. So, in your setup, the Administrator account on your client workstation is NOT trusted by the server instantiating your remote object, thus the object can't be created. The server tries to create the object using the clients account and gets denied because the client account has no permission on the server. So, what does the remoting config in your app.config files look like, both server AND client?? Remember to check the little box that says "Ignore HTML tags..." before you click "Post Message".
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Under remoting, the code on the server instantiates an object using the context of the CLIENT, not the server. Your user account that your logged in under on the client machine becomes part of your context. This context is a security boundry. In a workgroup environment, the account you're using on the client, even though it has the exact same name, is different from the account on the server. Each machine maintains it's own list of user accounts and does not trust the accounts of another machine. In a domain, the machines in it all trust the same list of user accounts. So, in your setup, the Administrator account on your client workstation is NOT trusted by the server instantiating your remote object, thus the object can't be created. The server tries to create the object using the clients account and gets denied because the client account has no permission on the server. So, what does the remoting config in your app.config files look like, both server AND client?? Remember to check the little box that says "Ignore HTML tags..." before you click "Post Message".
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Hi Dave The system I am working on doesn't use a configuration file But here is the code ================================================================ Server : This code is run onstart of the service ================================================================ Protected Overrides Sub OnStart(ByVal args() As String) ' Add code here to start your service. This method should set things ' in motion so your service can do its work. RemotingConfiguration.ApplicationName = "Indicium" Dim ChannelProps As New Dictionary(Of String, Object) ChannelProps.Add("port", "50000") ChannelProps.Add("secure", "false") ChannelProps.Add("name", "Server") Dim cProv As New BinaryClientFormatterSinkProvider Dim sProv As New BinaryServerFormatterSinkProvider sProv.TypeFilterLevel = Runtime.Serialization.Formatters.TypeFilterLevel.Full Dim myChannel As New TcpChannel(ChannelProps, cProv, sProv) ChannelServices.RegisterChannel(myChannel, True) RemotingConfiguration.RegisterWellKnownServiceType(GetType(RemotingGateway), _ "Indicium", WellKnownObjectMode.SingleCall) RemotingConfiguration.RegisterWellKnownServiceType(GetType(KVGenerator), _ "KVGenerator", WellKnownObjectMode.SingleCall) RemotingConfiguration.RegisterWellKnownServiceType(GetType(Importers.BankImporter.Gateway), _ "BankImporter", WellKnownObjectMode.SingleCall) RemotingConfiguration.RegisterWellKnownServiceType(GetType(Stats.clsGateway), _ "Stats", WellKnownObjectMode.SingleCall) RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.RemoteOnly SSIDataInterface.ClientPlug.Init("", "", "") End Sub ====================================================================== Client ====================================================================== Dim serverIP As String = _MyConfig.serverIP Dim serverPort As String = _MyConfig.serverPort _serverAddress = "tcp://" & serverIP & ":" & serverPort Dim serverURI As String = _serverAddress & "/Indicium" ' Create a connection to the Indicium Server... Dim ChannelProps As New Dictionary(Of String, Object) ChannelProps.Add("name", "Client") ChannelProps.Add("port", serverPort) ChannelProps.Add("secure", "false") ChannelProps.Add("username", "Petrus") ChannelProps.Add("pas
-
Hi Dave The system I am working on doesn't use a configuration file But here is the code ================================================================ Server : This code is run onstart of the service ================================================================ Protected Overrides Sub OnStart(ByVal args() As String) ' Add code here to start your service. This method should set things ' in motion so your service can do its work. RemotingConfiguration.ApplicationName = "Indicium" Dim ChannelProps As New Dictionary(Of String, Object) ChannelProps.Add("port", "50000") ChannelProps.Add("secure", "false") ChannelProps.Add("name", "Server") Dim cProv As New BinaryClientFormatterSinkProvider Dim sProv As New BinaryServerFormatterSinkProvider sProv.TypeFilterLevel = Runtime.Serialization.Formatters.TypeFilterLevel.Full Dim myChannel As New TcpChannel(ChannelProps, cProv, sProv) ChannelServices.RegisterChannel(myChannel, True) RemotingConfiguration.RegisterWellKnownServiceType(GetType(RemotingGateway), _ "Indicium", WellKnownObjectMode.SingleCall) RemotingConfiguration.RegisterWellKnownServiceType(GetType(KVGenerator), _ "KVGenerator", WellKnownObjectMode.SingleCall) RemotingConfiguration.RegisterWellKnownServiceType(GetType(Importers.BankImporter.Gateway), _ "BankImporter", WellKnownObjectMode.SingleCall) RemotingConfiguration.RegisterWellKnownServiceType(GetType(Stats.clsGateway), _ "Stats", WellKnownObjectMode.SingleCall) RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.RemoteOnly SSIDataInterface.ClientPlug.Init("", "", "") End Sub ====================================================================== Client ====================================================================== Dim serverIP As String = _MyConfig.serverIP Dim serverPort As String = _MyConfig.serverPort _serverAddress = "tcp://" & serverIP & ":" & serverPort Dim serverURI As String = _serverAddress & "/Indicium" ' Create a connection to the Indicium Server... Dim ChannelProps As New Dictionary(Of String, Object) ChannelProps.Add("name", "Client") ChannelProps.Add("port", serverPort) ChannelProps.Add("secure", "false") ChannelProps.Add("username", "Petrus") ChannelProps.Add("pas
I always use a config file for remoting. It saves having to make changes, compile, and reploy if something has to change. In your ChannelProps dictionary, you're specifying the
port
andsecure
properties as strings. Remove the quotes and let them be the types they actually are.Dim props As New HashTable() props("port") = 50000 props("secure") = False
You can get rid of the
username
andpassword
properties. They're not valid properties for a server-side TcpChannel. You can also get rid of the MsgBox in your OnStart code when you call RegisterChannel. You'll never see it if it does pop up. Replace this with either writing to your own log file or one of the Event Logs.A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
I always use a config file for remoting. It saves having to make changes, compile, and reploy if something has to change. In your ChannelProps dictionary, you're specifying the
port
andsecure
properties as strings. Remove the quotes and let them be the types they actually are.Dim props As New HashTable() props("port") = 50000 props("secure") = False
You can get rid of the
username
andpassword
properties. They're not valid properties for a server-side TcpChannel. You can also get rid of the MsgBox in your OnStart code when you call RegisterChannel. You'll never see it if it does pop up. Replace this with either writing to your own log file or one of the Event Logs.A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Dear Dave The error I am Exsperiancing now is No Connection could be made becase the target machine actively refused it Is this type of setup possible for WorkGroup And if so what needs to be changed on the configuration for this to work. Thanks in advance :confused: