How to determine what Endpoint of WCF service client is connected to
-
Hi I have a WCF service with multiple endpoints. The endpoints each uses its own binding configuration. One endpoint uses a TCP binding and the other a HTTP binding. My question is: In the service code, how do I determine on which of the bindings did the client connect? I know how to simply list all the service's endpoints
OperationContext.Current.Host.Description.Endpoints
and how to obtain an endpoint's binding:OperationContext.Current.Host.Description.Endpoints[0].Binding
But how do I determine which binding was used by the client, instead of just indexing the first Endpoint? Thanks -
Hi I have a WCF service with multiple endpoints. The endpoints each uses its own binding configuration. One endpoint uses a TCP binding and the other a HTTP binding. My question is: In the service code, how do I determine on which of the bindings did the client connect? I know how to simply list all the service's endpoints
OperationContext.Current.Host.Description.Endpoints
and how to obtain an endpoint's binding:OperationContext.Current.Host.Description.Endpoints[0].Binding
But how do I determine which binding was used by the client, instead of just indexing the first Endpoint? ThanksI found the answer to this question here: http://www.danrigsby.com/blog/index.php/2008/05/25/get-the-service-endpoint-address-a-client-is-accessing-in-wcf/