2

I'm having a lot of trouble trying to implement WS-Discovery in Metro. There doesn't seem to be support for Discovering services:

I'd like to do the following in Metro, but don't think I'm able to from the examples from .NET 4.0 (I'd like to do the equivalent in 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");

Does anyone have any ideas?

Looking at the API: http://msdn.microsoft.com/en-us/library/windows/apps/hh454057(v=vs.85).aspx

There doesn't seem to be a whole lot of support for discovery. Would it be best to implement my own discovery mechanism using DatagramSocket?

LB.
  • 13,730
  • 24
  • 67
  • 102
  • You seem to be missing the description of the actual problem you're facing. Please elaborate? – M.Babcock Apr 11 '12 at 03:00
  • Simply, how do you perform udp discovery of services with the Metro APIs? – LB. Apr 11 '12 at 03:03
  • You said the code included doesn't work. What doesn't work about it? – M.Babcock Apr 11 '12 at 03:03
  • 1
    Please read the question fully before commenting. – LB. Apr 11 '12 at 03:08
  • 1
    These APIs are not available in Metro, I was wondering what the equivalent was with the new Metro APIs. – LB. Apr 11 '12 at 03:09
  • It's a perfectly valid question as it could be a missing feature within the WinRT libraries. Was wondering if anyone has gotten around it. I've flagged this so that mods can take a look and will let them decide. – LB. Apr 11 '12 at 03:13
  • Posting code that you think should work without reasonable understanding of why it should work on the framework your compiling against makes your question not constructive. Pretending to have _tried something_ is not a reasonable attempt at actually _trying_ or _researching_ something. – M.Babcock Apr 11 '12 at 03:15
  • That's an assumption you've made on my part. Read the question again, it may be clearer to you. Arguing on here won't help the matter, please flag the post if you feel it's not a valid question. They can deal with it from there. – LB. Apr 11 '12 at 03:18
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/9941/discussion-between-lb-and-m-babcock) – LB. Apr 11 '12 at 03:19
  • 1
    What is the end goal you are trying to accomplish using WS-Discovery. I suspect that it goes against what the goals of Metro Style apps. Could you elaborate? – Alan Apr 11 '12 at 03:22
  • End goal of using WS-Discovery is to discover the services on a subnet that my Windows Metro Client are able to connect to without knowing the endpoint in the first place. Normally this is accomplished via Udp Discovery endpoints via UDP announcements that it responds with. – LB. Apr 11 '12 at 03:26
  • The reason I've posted a sample code is to illustrate the fact that in .NET 4.0 I was able to leverage the DiscoveryClient class to search. In WinRT, I haven't found an equivalent and was wondering if I would need to roll my own or if there was something I was missing out on. I haven't been able to figure it out from looking at the new API docs. – LB. Apr 11 '12 at 03:29

0 Answers0