Jan 3, 2010

How to host a remote object in IIS server(2)

Console Application တစ္ခုကုိ အရင္လုပ္ပါမယ္။ TestClient.cs ဆုိျပီးနာမည္ေပးပါမယ္။ Reference မွာ System.Runtime.Remoting နဲ႔ c:\Inetpub\wwwroot\ ထဲက HelloWorldObject.dll ကုိ add ပါမယ္။

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;
using HelloWorldObject;
using System.EnterpriseServices;

namespace Client
{
class TestClient
{
static void Main(string[] args)
{
Hello obj = (Hello)Activator.GetObject(typeof(Hello),
"http://localhost/HelloWorldWeb/SimpleHelloWorld.soap");
Console.WriteLine(obj.HelloWorld(" Client APP: "));
Console.ReadLine();
}
}
}


ျပီးရင္ run ပါ။ ရပါျပီ..IIS server က ကြန္ျပဴတာကုိ ဖြင့္ကတည္းက started ျပီးသားျဖစ္ပါတယ္။
MORE INFO ===>http://support.microsoft.com/kb/312107

No comments:

Post a Comment