I currently have a WCF client that is able to do ad-hoc service discovery to find (unknown) services running on the local subnet. I would like to implement a way for the user to specify a service endpoint to use by entering a URI into a text box, and for the client to resolve this URI to an EndpointAddress
, and in the process gather additional metadata about the service. Namely, I need to gather the EndpointIdentity
and additional data exposed in the Extensions property of the EndpointDiscoveryBehavior
.
I am trying to achieve this by using DiscoveryClient.Resolve()
, but I am only receiving null for the ResolveResponse.EndpointDiscoveryMetadata
property.
String Address = "net.tcp://machine-name:12345/MyService"
DiscoveryClient discoveryClient = new DiscoveryClient(new UdpDiscoveryEndpoint());
var criteria = new ResolveCriteria()
{
Address = new EndpointAddress(Address)
};
var result = discoveryClient.Resolve(criteria);
//scv is null here.....
var svc = result.EndpointDiscoveryMetadata;
I've found a lot of information out there regarding DiscoveryClient.Find()
, but not so much about DiscoveryClient.Resolve()
.
So my questions are:
- Is this the intended use of
DiscoveryClient.Resolve()
? - Is
MetadataResolver
more appropriate here? - How does one resolve an URI to a
EndpointAddress
and obtain other metadata?