getting IP address of the client using the webservice?


    I want to get the IP address of the client system whoever accessing my webservice? how can i do that using my webservice?

Thanks in Advance,


1/5/2009 9:55:12 AM 7071 articles. 0 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 48

 Try this :


 string IP=  HttpContext.Current.Request.UserHostAddress;

Anas Ghanem.

Note:Please Don't hesitate to click "Report Abuse" link if you noticed something wrong on the forums (like duplicate ,Off-topic,offensive,or any post that violates the website "TERMS OF USE"). -- Thanks!

1/5/2009 10:17:06 AM

Hi Anas,

   Thanks for your reply. It works. I want to know one more thing that 'How can i get the client userid, who is connected to the network of the same organisation?'. This also using webservices only. how can i do this?

Thanks In Advance,


1/5/2009 10:27:18 AM
Not sure if this works over webservices (i would think it does) 


This gets you the username, if you want the ID (as in the GUID used by the active directory) you'd have to use LDAP to query the active directory, afaik there isn't any way to get that from a webrequest.


F.B. ten Kate


F.B. ten Kate

ps. Don't forget to mark helpfull replies as answer
1/5/2009 10:37:34 AM

You will only be able to get the IP address that appears to be using the service. If the client is behind a proxy server or a Network Address Translationj device, then you will not be able to get the true IP address. For instance, if I were accessing your service, you would never see my IP address (which is, and you wouldn't be able to use it for anything if you did get it.

John Saunders | MVP – Connected System Developer
1/6/2009 4:40:02 PM

Similar Artilces:

Get client IP address [Not Host] in C# .NET web services
I create one web service using c# .net and in this web service I want to get an IP address for client. I check thousend of article but that is not working, let me give you one example System.Web.HttpContext.Current.Request.UserHostAddress; System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; This is gives me IP but that my server ip where I put my web service but I want to get my client IP address. Can someone help me with this. You can try: string ip; ip=Request.ServerVariables("HTTP_X_FORWARDED_FOR"); i...

How to get client IP in web service
Hi, all! How I can get client IP in stored proc (web)? CONNECTION_PROPERTY ( 'NodeAddress' ) works from inside a procedure called from a CREATE SERVICE. Breck On 12 Jan 2007 22:51:25 -0700, "Stark" <> wrote: >Hi, all! > >How I can get client IP in stored proc (web)? > -- Breck Carter [Team iAnywhere] RisingRoad SQL Anywhere and MobiLink Professional Services The book: select connection_property('...

Getting user IP address in Web Service
I'm able to get the user's IP address with the following code in a Web form (aspx): Label1.Text = Request.UserHostAddress.ToString() I want to use this in a Web Service (asmx) to accept or deny a request of the service based on IP address. In other words, I want only my main Web server, which is on a computer with a static IP, to be able to access the Web service running on a separate computer. My problem is that when I try to assign Request.UserHostAddress.ToString() to the return value of a Web method or even to a string variable, the Web service won't compile. The error I get is ...

web service: requesting client ip address
I need to log every call to my web service.  Im trying to request client ip from my web method.For this purpose i use: String ip = Context.Request.UserHostAddress.ToString();This works fine when for request that comes from my local network, but this line of code throw exception when i try to access web service from out network (internet)When I remove this line of code web service works fine even from out network.Anybody knows what is a problem !?   Try Context.Request.ServerVariables["REMOTE_ADDR"]Community Coder When we are logging the website we also want...

How to use a PHP client to a WSE .NET web service?
I'm using username token without encryption WSE 3 features on my web service.  How can a PHP client consume my web service?  Is this a totally unheard of use case?  I can't find anything on it.Andrew L ArnottVisual Studio Platform & Ecosystem Did you ever get an answer to this and if so could you share? Having the same issue I'm afraid I didn't.  I got as far as an unencrypted, username token authentication WSE web service, but I still haven't gotten a PHP client to be able to pass the credentials in as required.You'd think this would be a more popular issue.Andre...

How to get a .net web service to return JSON not XML
I have a web service written in .net 1.1 using that I need to return JSON. How to I get it to return only the values contained in the xml below - without the XML?  Thanks in advance. <?xml version="1.0" encoding="utf-8" ?> <string xmlns="">{"result":[{"track":{"vid":"6303","kid":"30","dt":"2/13/2006 6:32:46 AM"}}]}</string>     check this page and you must be very happy! Let me ask you a question: how to append/combine two JSON objects (assuming their str...

problem in using java web services from .net client
I am trying to make a .net client for a java web service made using JAX-WS 2.0 . Actually the web service maintains session of the client. Well i did create a client from java and it worked. But i am having problem in consuming the web service from .net client. According to the specification of that web service i have to set the SESSION_MAINTAIN_PROPERTY of the BindingProvider true to indicate whether or not the client wants to participate in session with service endpoint. It is done in java client in following way:Hello proxy = new HelloService()...

Re: Using XML Web Service in VS.NET
Dear all, I added a "test.asmx" file in my current project and I coded all Web Method in the test.asmx.cs in VS.NET. Now I want to ask how can I call the web methods in other C# Class? Suppose the class name of the asmx is "test". How can I instantiate the object of that class? Regards, Joe someone can correct me on this.... i hav done a walkthrough using XML webservice. I have created a windows application that can call methods from the webservice, with the use of a dataset in the webservice. after "adding a web reference" to my windows appli...

How to use a ColdFusion client to a WSE .NET web service?
How to use a ColdFusion client to a WSE .NET web service? thanks...

Has anyone successfully used a Delphi web service client against an ENCRYPTED WCF web service server?
Has anyone successfully used a Delphi web service client against an ENCRYPTED WCF web service server? Which is to say, of course, that the URL would be starting with https. Anyone? ...

How to get Client IP address in Web.PB based app
This is a multi-part message in MIME format. --------------637792A32DFBE3E521B7939F Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit How to get Client IP address in Web.PB based application. i am not clear at what point/points of execution we can capture IP of Client machine, when and how it will be stored in the session database. I went through online books example in webPB tutorial.There was one form with two INPUTs for text and passing this to a function of three arguments. the third argument in the function is client address. i were unable to trace it....

xml web service --uploading the file to the xml web service
how can we upload the file in the xml web service 1.i mean what will be the return value in the proxy class 2.and how am i going to send the file to the xml web service----regards Bipul Kumar Here are some links to articles that helped us get this done: Hope this helps....

Exposing xml file to client using a web service method
I need to write a web service which will have a method to authenticate user,if user is authenticated then i will pull data from my database server using dataset.Now the task is to make the data into an xml file and if the user is authenticated i need to show the file to client.So that,the client will parse the file without saving that. i can create an xml file using daset.writexml(>>>>) But i am facing problem how can i return the file to client. <webmethod _> public function xxx() as ????????   dataset.writexml("123.xml") return ??????? end funct...

Can Non-.NET Web Service Clients Use Datasets?
If a .NET-written web serice returns a dataset, can a web service not written in .NET use that dataset? If not, what should be returned? thanks in advance, Geoff I would return a string (in xml format possibly) - you could probably just return DataSet.ToXML() as the return value How about creating an object to represent each row in the dataset and then putting it into an array?...

Web resources about - getting IP address of the client using the webservice? -

webservices Articles, Posts, Blogs, Videos - Technorati
— Authority: The job consist in a PHP program that read a file, compose a message (email or sms) and call an API of email provider (Amazon SES) ...

Section: software:webservices © 2012 Condé Nast. All rights reserved. Use of this Site constitutes acceptance of our User Agreement (effective 3/21/12) and Privacy ...

Products - CrunchBase
Product profiles

App Search on Flickr - Application Sharing!
Flickr is almost certainly the best online photo management and sharing application in the world. Show off your favorite photos and videos to ...

Wikipedia:Press coverage 2005 - Wikipedia, the free encyclopedia
If you add an article, please cite both the title and the source. Note that if you're listing an article from a traditional press wire service ...

Entity–relationship model - Wikipedia, the free encyclopedia
In software engineering , an entity-relationship model ( ER model for short) is an abstract and conceptual representation of data . Entity-relationship ...

Entity-relationship model - Wikipedia, the free encyclopedia
In software engineering , an entity-relationship model ( ER model for short) is an abstract and conceptual representation of data . Entity-relationship ...

IT and Telecommunications Jobs in Melbourne Metro - MyCareer
Find IT and Telecommunications Jobs in Melbourne Metro on MyCareer. Fresh IT and Telecommunications Jobs posted daily. Free email alerts and ...

AWS Elastic Beanstalk: A Quick and Simple Way into the Cloud
Flexibility is one of the key principles of Amazon WebServices - developers can select any programming language and software package,any operating ...

How To Use the Amazon SDK for Android to Upload Photos to Amazon S3
This article demonstrates how to use the AWS SDK for Android to upload an image to Amazon Simple Storage Service (S3) from your mobile device ...

Resources last updated: 11/24/2015 4:34:22 PM