2

I'm using WS Discovery to dynamically find and connect to endpoints on the local network.

var cli = new DiscoveryClient (new UdpDiscoveryEndpoint ());
var response = cli.Find (new FindCriteria (typeof (IFoo)));

returns net.tcp://localhost:8000/, which is correct. But

var ep = new DynamicEndpoint (
    ContractDescription.GetContract (typeof (IFoo)), new NetTcpBinding ());
var cf = new ChannelFactory<IFoo> (ep);
var ch = cf.CreateChannel ();
ch.SomeMethod ();

throws an EndpointNotFoundException with this message:

"1 endpoint(s) were discovered, but the client could not create or open the channel with any of the discovered endpoints."

I googled for the error message but there were no results! What is happening, and how can I fix this?

mafu
  • 31,798
  • 42
  • 154
  • 247
  • I already found an answer, which I'll post in a second. This question was added just for reference, since it was difficult to google for this error message. – mafu Nov 10 '10 at 09:37

1 Answers1

0

At least in my case the error was due to a wrong binding - its SecurityMode was not set correctly.

mafu
  • 31,798
  • 42
  • 154
  • 247