.Net Remoting

Status
Not open for further replies.

Sheriff

Ars Tribunus Militum
1,841
Okay, so ive finally decided to get down and start messing with some serious .Net stuff, and ive run into a little problem when working with .Net Remoting.

right now i am just creating a little app that can access a method on a server side .exe (Using Directhost, not IIS) and have the server print out a message. unfortunately when i run the program and access the method, it gets run locally, not from the server process. let me try and flesh out what i am doing.

right now im working in VB.NET since i am more comfortable with it.

3 projects: RemotingTestClient, RemotingTestServer, and RemotingTestTypes.

Heres the RemotingTestMessage Class:
code:<HR>
Code:
Public Class NetVerseMessage
    Inherits MarshalByRefObject<P>    Public Function ReturnGreeting(ByVal name As [String]) As [String]
        Dim message As [String] = "Hi there " + name + ", you are using .NET Remoting"
        Console.WriteLine(message)
        Return message
    End Function
End Class

now when i load the RemotingTestServer i call RemotingConfiguration.Configure(configfile) where this is the config file:
code:<HR>
Code:
<configuration>
  <system.runtime.remoting>
    <application name="RemotingTestServer"><P>      <service>
        <wellknown mode="SingleCall" type="RemotingTestTypes.RemotingTestMessage, RemotingTestTypes" objectUri="RemotingTestTypes.soap" />
      </service><P>      <channels>
        <channel ref="http" port="8000" />
      </channels><P>    </application>
  </system.runtime.remoting>
</configuration><P>

now when the client starts i call RemotingConfiguration.Configure( config ) with this config file:
code:<HR>
Code:
<configuration>
  <system.runtime.remoting>
    <application name="RemotingTestClient">
    
      <client url="http://localhost:8000/RemotingTestTypes">
        <wellknown type="RemotingTestTypes.RemotingTestMessage, RemotingTestTypes" url="http://localhost:8000/RemotingHello/RemotingTestTypes.soap" />
      </client>
      
      <channels>
        <channel ref="http" />
      </channels>
      
    </application>
  </system.runtime.remoting>
</configuration><P>

As i see it i should then beable to construct an instance of RemotingTestMessage as normal and have that actual create an instance in RemotingTestServer and return a proxy, but it appears that it is all happening locally. ReturnGreeting works clientside, but nothing happens server side.

now i have looked through and read the DirectHost sample in the framework sdk (infact if you are familiar with the sample i am doing an exact copy but with different names, and client isnt a console app) and i cant get it to work.

ive been trying to read other places but there seems to be all kinds of conflicting information out there and i cant find the a good explanation in the configuration formats.

what im asking here is whether or not anyone knows of a good resource for .Net Remoting via .exe, or whether they spot a problem with the configuration files. This stuff is pretty confusing for me right now and i appreciate any help.

-Sheriff

edit: oh i forgot one thing, in the samples provided the client and server import Imports System.Runtime.Remoting.Channels.Http but if i try and import it in Vs.net i cant find the namespace. any ideas?

[This message was edited by Sheriff on February 01, 2002 at 19:21.]
 
Status
Not open for further replies.