PDA

View Full Version : Error : Requested Service not found



Sajjad.Aghapour
چهارشنبه 09 بهمن 1387, 18:58 عصر
سلام دوستان....
این خطا در چه صورتی رخ میده....
سرور :


Console.WriteLine("start");
HttpServerChannel channel = new HttpServerChannel(32469);
ChannelServices.RegisterChannel(channel);

RemotingConfiguration.RegisterWellKnownServiceType (typeof(SimpleRemotingAsm1.RemoteMessageObject), "RemoteMsgObj.soap", WellKnownObjectMode.Singleton);

Console.ReadLine();

کلاینت :


[SecurityPermission(SecurityAction.Demand)]
static void Main(string[] args)
{
Console.WriteLine("start client");
HttpClientChannel c = new HttpClientChannel();
ChannelServices.RegisterChannel(c);

object remoteObj = Activator.GetObject(typeof(SimpleRemotingAsm1.Remo teMessageObject), "http://localhost:32469//RemoteMsgObj.soap");

RemoteMessageObject simple = (RemoteMessageObject)remoteObj;

simple.DisplyMessage("hello from client");
Console.WriteLine("server :{0}", simple.ReturnMessage());
Console.ReadLine();
}

لایه عمومی :


public class RemoteMessageObject : MarshalByRefObject
{
public RemoteMessageObject()
{
MessageBox.Show("construct");
}

public void DisplyMessage(string msg)
{
MessageBox.Show("message is :"+ msg);
}

public string ReturnMessage()
{
return "salam";
}
}

Sajjad.Aghapour
چهارشنبه 09 بهمن 1387, 19:52 عصر
اقا حل شد.یه / اضافه گذاشته بودم.......:گیج: