ip address - retrieve client IpAddress in WCF service -


i trying utilise wcf service built in .net 4.0 custom business functionality in html page (using jquery) , want retrieve client ipaddress in wcf service whoever trying access service through defined html page. wcf service , html page (utilising wcf service) setup/ hosted on same windows server machine(s) virtuals in iis.

in process using below code in wcf service retrieve ipadress information of client.

code:

operationcontext context = operationcontext.current; messageproperties properties = context.incomingmessageproperties; remoteendpointmessageproperty endpoint = properties[remoteendpointmessageproperty.name] remoteendpointmessageproperty; string address = endpoint.address; 

there load balancer configured (where service deployed on 2 server machines) , utilising virtual url access wcf service.

when trying access wcf service through machine name, service able retrieve client ipaddress correctly, when use virtual url (where requests can processed load balancer on of configured machines), service retrieving server ipaddress instead of client ipadrress detail.

i stuck issue, , didn't find property in operationconetext helpful in retrieving client ipaddress. can please me in resolving problem.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -