Reputation: 601
What is the best way to get the IP Address of Request in Wcf Data Service?
I am using .Net 4
Upvotes: 0
Views: 513
Reputation: 637
Have you tried this?
OperationContext context = OperationContext.Current;
MessageProperties prop = context.IncomingMessageProperties;
RemoteEndpointMessageProperty endpoint = prop[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;
string ip = endpoint.Address;
Upvotes: 1