public class myObj: MarshalByRefObject { // ... }
<configuration> <system.runtime.remoting> <application> <service> <wellknown mode="SingleCall" type="myNamespace.myObj, myObj" objectUri="myObj.soap" /> </service> </application> </system.runtime.remoting> </configuration>
<configuration> <system.runtime.remoting> <application name="Client"> <client url="http://andy2k/myIISObj"> <wellknown type="myNamespace.myObj, myObj" url="http://andy2k/myIISObj/myObj.soap"/> </client> <channels> <channel ref="http" /> </channels> </application> </system.runtime.remoting> </configuration>
//Load the Http Channel from the config file try { RemotingConfiguration.Configure("client.config"); } catch{} //instantiate the remote object on the server //(this is really just a proxy object here) myNamespace.myObj anObj = new myNamespace.myObj();
Public string getCompName() { return System.Environment.MachineName; }
Build Your Own ASP.NET Website Using C# & VB.NET