I found you can do it with the following code:
var props = OperationContext.Current.IncomingMessageProperties;
var endpointProperty = props[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;
if (endpointProperty != null)
{
var ip = endpointProperty.Address;
}This seems overly verbose so you may want to consider putting this code into helper methods or a base class for re-use.



0 comments:
Post a Comment