none
Is there a way to find out which endpoint is being used by the client? RRS feed

  • Question

  • I have two endpoints pointing to the same service, one configured through webHttpBinding and the other through basicHttpBinding. I would like to know if there is a programmatic way to find out which endpoint a client is using to access the service during execution. For example, a client calls service method A via the endpoint using webHttpBinding. Method A detects this and will send back a proper http status code along with the result. This should not happen with the other endpoint however. Is this possible?

    Thanks in advance.
    Friday, August 7, 2009 8:05 PM

Answers

  • Hi,

    The following will return the service endpoint address for the current operation:

    EndpointAddress endpoint = OperationContext.Current.Channel.LocalAddress;


    Regards,
    Rodrigo.
    Friday, August 7, 2009 8:19 PM