public void SyncCall() { string serviceUrl = System.Configuration.ConfigurationManager.AppSettings["ServiceURL"]; RemoteObject.MyObject app = (RemoteObject.MyObject)Activator.GetObject(typeof(RemoteObject.MyObject), serviceUrl); Response.Write("[Sync]app.Add(18, 22) = " + app.Add(18, 22) + "<br/>"); }
static void Main(string[] args) { RemoteObject.MyObject app = (RemoteObject.MyObject)Activator.GetObject(typeof(RemoteObject.MyObject), System.Configuration.ConfigurationSettings.AppSettings["ServiceURL"]); Console.WriteLine(app.Add(1, 2)); Console.ReadLine(); }