Question

i am new in wcf. Dynamic Endpoint is a standard endpoint which performs discovery and automatically selects a matching service that i know. here is a code sample for DynamicEndpoint.

DynamicEndpoint dynamicEndpoint = new DynamicEndpoint(ContractDescription.GetContract(typeof(ICalculatorService)), new WSHttpBinding());
CalculatorServiceClient client = new CalculatorServiceClient(dynamicEndpoint);

Console.WriteLine("Invoking CalculatorService");
Console.WriteLine();

double value1 = 100.00D;
double value2 = 15.99D;

double result = client.Add(value1, value2);
Console.WriteLine("Add({0},{1}) = {2}", value1, value2, result);

i do not understand from the code that it is assumed that we added service reference and then we work with dynamic endpoint. when we add wcf service reference at client side then endpoint related setting automatically added in config file at client end.

could anyone please tell how dynamic endpoint discover my service address at run time just if we pass the contract. suppose if we have no config file at client end then how dynamic endpoint can discover my service?

could anyone please tell me in what kind of situation dynamic endpoint is used and only option ?

please discuss all my points in details. thanks

Was it helpful?

Solution

There are multiple ways of discovering services. There is UDDI and WS-Discovery.

It seems those classes use WS-Discovery. For a better overview, I'd suggest a good book, this is way to broad for a single SO question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top