Banshee
Banshee

Reputation: 15837

Get current endpoint on WCF Services?

I have a WCF service communicating with client over TCP. Is there anyway to gather information about the current connect in a service method? For example the endpoint that the current user is using?

Upvotes: 7

Views: 9082

Answers (1)

Josh
Josh

Reputation: 44916

You can use the OperationContext.Current property to get all kinds of useful information about the method you are currently in.

For your specific example:

OperationContext.Current.EndpointDispatcher.EndpointAddress

Upvotes: 11

Related Questions