Blog Archives

WCF Service Library in Windows Service

CodeProject (WCF Service in Windows Service),
MSDN (Debug Windows Service Applications),
MSDN (Host WCF Service in Managed Windows Service),

Get IP Address of Originating Website From a Webservice

The following code was used in a .Net 3.5 web service to retrieve the IP Address of the website consuming it.

This solution may initially escape you since it might seem like the web service should run within an HTTP Context and thus utilize this object to get information from websites calling particular methods.

See MSDN reference(s) for more information.


RemoteEndpointMessageProperty clientEndpoint = OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;