Ok,
This is my first shot at remoting so please excuse my ignorance
I created a class library called RemotingLib.DLL. I have one class in this library
Public Class HelloWorld
Inherits MarshalByRefObject
'--------------------------------------------------------------------
' Testing .NET remoting
'--------------------------------------------------------------------
private m_Text as String = "Hello World!"
public property HelloString as String
Get
return m_Text
End Get
Set(ByVal value As String)
m_Text = value
End Set
End Property
End Class
I've compiled the dll, created a virtual directory on another machine and added a bin directory. I placed the assembly in the bin directory.
Also, in the IIS virtual directory I added a web.config file that looks like this.
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="SingleCall" type="RemotingLib.HelloWorld, RemotingLib"
objectUri="HelloWorld.soap" />
</service>
</application>
</system.runtime.remoting>
</configuration>
Now, on my development machine, I created a client app. I added a reference to my RemotingLib.dll.
I created a client.config file that looks like this
<configuration>
<system.runtime.remoting>
<application name="Client">
<client url="http://myserver/RemoteTest">
<wellknown type="RemotingLib.HelloWorld, RemotingLib"
url="http://myserver/RemoteTest/HelloWorld.soap"/>
</client>
<channels>
<channel ref="http" />
</channels>
</application>
</system.runtime.remoting>
</configuration>
Here's the code in my client app
Try
system.Runtime.Remoting.RemotingConfiguration.Configure("client.config", False)
dim MyTestObject as New RemotingLib.HelloWorld
dim MyString as String
MyString = MyTestObject.HelloString()
'This displays the initalz property setting
msgbox("Text = " & MyString)
MyTestObject.HelloString = "BLAH"
'This also displays the initial setting
MyString = MyTestObject.HelloString()
msgbox ("Text = " & MyString)
Catch ex As Exception
msgbox ("Ex " & ex.ToString)
End Try
I've used System.Environment.MachineName in my remote object so I know that it's loading from the host, however, I can't manipulate the property of the class. It seems to have no effect on the value. No matter what I try to set it to it returns "Hello World!" Does anyone have an idea as to what I may be doing wrong?
Thanks in advance to all replies.