|
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??
|
|
|
|
|
The Client and the server Service is both running on the administrator account. The network setup is a work group.
|
|
|
|
|
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".
|
|
|
|
|
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("password", "hallo1231983")
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)
Try
ChannelServices.RegisterChannel(myChannel, True)
Catch ex As Exception
MsgBox("Channel Feed Back : " & ex.ToString())
End Try
IndiciumGateway = CType(Activator.GetObject(GetType(IGateway), serverURI), IGateway)
=================================================================================================
If you suggest i use a configuration file do I use on the server
RemotingConfiguration.Configure()
and would it look like this and what do I need to change to make it work for my setup and what type of assembly should be named in the activated type of assembly and the wellknown type Assembly
<Configuration>
<system.runtime.remoting>
<application>
<service>
<welknown mode="SingleCall" Type="RemotingGateway,IndiciumServer" objecturi="Indicium" />
<activated type="ClientActivatedType, TypeAssembly"/>
</service>
</application>
</system.runtime.remoting>
</Configuration>
PS: Is the assembly type the project name that contains the class that is marshallbyrefOject
|
|
|
|
|
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 and secure 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 and password 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.
|
|
|
|
|
Dear 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
|
|
|
|
|
Hi Dave
Sorry about all the questions
But if the remoting server is sitting on a domain and the client pc wants to connect through the internet is it possible.
Tanks in advance
|
|
|
|
|
Hi Dave
Can one get dot net remoting to work on a workgroup and a domain with out changing the code.
Thanks in advance
|
|
|
|
|
Hi I need to use a 2 dimensional array that stores a filed of type string in the first column and a field of type integer in the second. I tried using system.array but there is cast type problems. What can i use?
mr oizo
|
|
|
|
|
You can't combine those two in the same array, though you can create you're own class or structure to hold these.
Public Class MyDataItem
Private _someString As String
Private _someNumber As Integer
Public Sub New(ByVal name As String, ByVal number As Integer)
_someString = name
_someNumber = number
End Sub
Public Property SomeString As String
Get
Return _someString
End Get
Set(ByVal value As String)
_someString = value
End Set
End Property
...
End Class
And then you just create an array or collection of these little objects. I prefer to use a Generic List(Of T).
Dim myList As New List(Of MyDataItem)
myList.Add(New MyDataItem("Something", n))
|
|
|
|
|
Thanks for the help again.....
Mr Oizo
|
|
|
|
|
I need help with code.
The app I'm building I have a combo box for drive letters
I want the combo box to only have the cd/dvd drives listed instead of having A-Z
also when i change the selection I want it to display disc volume label and capacity to 2 separate text boxes.
The rest of app is in 1.1 so I'm looking for a 1.1 solution.
Please help me out.
|
|
|
|
|
What you're looking for comes from WMI and the Win32_LogicalDisk[^] class. All you need is the Windows Management Instrumentation classes in the .NET Framework under the System.Management[^] namespace.
|
|
|
|
|
Well that page is talking about windows script.
and not sure how I can convert it to .net 1.1
|
|
|
|
|
No, that page is talking about a WMI class. The example on it is in VBScript.
The second link is about using WMI in the .NET Framework.
|
|
|
|
|
Could anyone please make me a hotel management system using VB.NET.pLEASE ITS KIND OF AGENT.i WILL HIGHLY APPRECIATE.tHANK YOU.
|
|
|
|
|
For a reasonable fee, sure no problem - make me an offer.
Maybe you should have started your homework/assignment earlier, then it wouldn't be urgent.
|
|
|
|
|
Ok,what amount should it cost me?Make it fair and try me this time.I will help you one day.Its just that i was held-up abit.
|
|
|
|
|
Sure, i can do that for $3000
Next time dont tell us what to do, you dont pay us
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Why you complaining,i kind of requested and i used please!!!
|
|
|
|
|
you should not come here, and say "KIND OF AGENT"
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Lemme think about it. ehhhh....NO! This forum is for getting help, not doing projects for people! Get to work!
---------------------------
Both optimists and pessimists are important in technology. The optimist invented the aeroplane; the pessimist invented the parachute.
Regards,
Hesbon Ongira
Nairobi, Kenya.
|
|
|
|
|
i can never do it for him , am just annoyed when he comes here and ask us to do a Project for him "Urgently".
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Come on Hesbon,u kenyan like me,you know what it entails to work on multiple projects.I just needed help urgently.....
|
|
|
|