You are developing a Windows Communication Foundation (WCF) service that must be discoverable.
You need to ensure that the ServiceHost instance supports multiple discovery versions. What should you do?
A.
– Specify a unique DiscoveryVersion parameter for each endpoint constructor.
– Use the same value for the Address property of each endpoint.
B.
– Use the endpoint constructor without the DiscoveryVersion parameter.
– Use a unique value for the Address property of each endpoint.
C.
– Specify a unique DiscoveryVersion parameter for each endpoint constructor.
– Use a unique value for the Address property of each endpoint.
D.
– Use the endpoint constructor without the DiscoveryVersion parameter.
– Use the same value for the Address property of each endpoint.
Explanation:
Supporting Multiple UDP Discovery Endpoints for Different Discovery Versions on a Single Service HostYou may want to expose multiple UDP Discovery Endpoints for different discovery versions on a single service host.
To do this you must specify a unique address for each UDP discovery endpoint. The following example shows how to do this.UdpDiscoveryEndpoint newVersionUdpEndpoint = new UdpDiscoveryEndpoint(DiscoveryVersion.WSDiscovery11);
UdpDiscoveryEndpoint oldVersionUdpEndpoint = new UdpDiscoveryEndpoint(DiscoveryVersion.WSDiscoveryApril2005);newVersionUdpEndpoint.Address = new EndpointAddress(newVersionUdpEndpoint.Address.Uri.ToString() + “/version11”);
oldVersionUdpEndpoint.Address = new EndpointAddress(oldVersionUdpEndpoint.Address.Uri.ToString() + “/versionAril2005”);serviceHost.AddServiceEndpoint(newVersionUdpEndpoint);
serviceHost.AddServiceEndpoint(oldVersionUdpEndpoint);Discovery Versioning
(http://msdn.microsoft.com/en-us/library/dd456799.aspx)
C