Last post Dec 12, 2016 02:36 AM by Cathy Zou
Dec 09, 2016 08:34 PM|AleksNYC|LINK
I hoping someone can help me, i've tried to search for the solution and couldn't come up with an answer.
I tried the following and it gives me the IP address of the machine that hosts the web service.
OperationContext context = OperationContext.Current;
MessageProperties prop = context.IncomingMessageProperties;
RemoteEndpointMessageProperty endpoint =
prop[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;
string ip = endpoint.Address;
I have a webservice (WCF) inside of a sharepoint project. I would like to get IP address of the requestor. However, I used the following code and it gives me the IP address of the machine where service is running.
Dec 12, 2016 02:36 AM|Cathy Zou|LINK
From your description, as far as I know, HttpRequest.UserHostAddress Property help us get Gets the IP host address of the remote client.
So, I suggest you could try the code below:
For more information, you could refer to the following link: