私はクライアントアプリケーションとサーバーアプリケーションを持っています。 クライアントはwcfサービスを呼び出し、サーバーがクライアント側でwcfサービスをコールバックするマシン名に基づいて、マシン情報 をサーバーに渡します。 ます。public void RegisterTasks(MachineConfig machineInfo) { 文字列は= exeProxy.Endpoint.Addressを追加します。 だからこれを達成するために、私はちょうどEndPointAddressを変えていますが、それは NoEndPointFoundExceptionを投げ、私はそれを修正する方法を、以下のコードです。 Uri.Scheme + "://" + machineInfo.MachineName.Trim()+ "/" + exeProxy.Endpoint.Address.Uri.Segments [1];WCFのEndPointアドレスはどのように変更できますか?
Uri uri = new Uri(add);
EndpointAddress eadd = new EndpointAddress(add);
WSHttpBinding whttpBinding = new WSHttpBinding(SecurityMode.None);
//ServiceReference1.ExecuteTaskClient newProxy = new ExecuteTaskClient(whttpBinding , eadd);
//EndpointAddress endPointAddress = ;
exeProxy.Endpoint.Address = eadd;
//exeProxy.Endpoint.Binding = new System.ServiceModel.BasicHttpBinding("httpBinding");
// we just execute the task by
// calling the wcf service on client side
foreach (Task task in machineInfo.Tasks)
{
exeProxy.ExecuteTask(task.TaskID);
// newProxy.ExecuteTask(task.TaskID);
}
}
赤ちゃんを使用するための+1は、「確実にこれはすでに前に行われています...」または「これを行うより良い方法があるはずです...」 – Travis