我在尝试在Metro中实现WS-Discovery时遇到了很多麻烦。似乎没有对发现服务的支持:
我想在Metro中执行以下操作,但不要认为我能够从.NET 4.0的示例中获取(我想在WinRT中执行等效操作):
DiscoveryClient discoveryClient = new DiscoveryClient(new UdpDiscoveryEndpoint());
FindResponse discoveryResponse= discoveryClient.Find(new FindCriteria(typeof(ISampleService)));
EndpointAddress address = discoveryResponse.Endpoints[0].Address;
SampleServiceClient service = new SampleServiceClient(new BasicHttpBinding(), address);
service.Echo("WS-Discovery test");
有没有人有任何想法?
查看API:http://msdn.microsoft.com/en-us/library/windows/apps/hh454057(v=vs.85).aspx
似乎没有大量支持发现。是否最好使用DatagramSocket实现我自己的发现机制?