473,320 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Client IP Address from Web Service Call

I have created a web service that does some logging to a web database and
would like to include the client's IP address in the log information. How
can I get this information when a web service is called?

Thanks,

-Johnnie
Nov 23 '05 #1
3 23005
Hi Johnnie,

Use Request.UserHostAddress to retrieve the IP of the calling client.

Regards,

--
Martin Kulov
http://www.codeattest.com

MCAD Charter Member
MCSD.NET Early Achiever
MCSD

"Johnnie Norsworthy" <jl****@verizon.net> wrote in message
news:#v*************@TK2MSFTNGP15.phx.gbl...
I have created a web service that does some logging to a web database and
would like to include the client's IP address in the log information. How
can I get this information when a web service is called?

Thanks,

-Johnnie


Nov 23 '05 #2
"Martin Kulov" <ku***@bezbokluk.abv.bg> wrote in message
news:ut**************@TK2MSFTNGP14.phx.gbl...
Hi Johnnie,

Use Request.UserHostAddress to retrieve the IP of the calling client.


Martin,

Thank you for responding. One more thing please...

How should I create the System.Web.HttpRequest for Request.UserHostAddress
to be valid when my web service is called? My partial code is below.

Thanks,

Johnnie

using System.Web;
HttpRequest request = new HttpRequest( ); // parameters for my web service
to use???

ipAddress = request.UserHostAddress;
Nov 23 '05 #3
I think i have it now; I just do this from within the web method.
ipAddress = this.Context.Request.UserHostAddress;

Testing it now.

-Johnnie
Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
by: hasho | last post by:
Why is "call by address" faster than "call by value"?
2
by: B Deepak | last post by:
Hi, I have a c# developed web service deployed on IIS. and I am accessing it thorogh java client. Now the problem is whenever we call a web method with a parameter list from java client, web...
1
by: JD | last post by:
We have two web service machines. Call one WS1 and the other WS2. They are seperated by a firewall. WS1 handles web service calls and also calls web services provided by WS2. Both machines do not...
5
by: Paul Hasell | last post by:
Hi, I'm trying to invoke a web method asynchronously but just can't seem to get it to tell me when it has finished! Below is the code I am (currently) using: private void...
0
by: Werner Willemsens | last post by:
Hi, I have the following situation. COM server exposed on Windows CE 5.0 through SOAP (SOAP toolkit) C# client on XP calls Web Service methods on CE (COM)SOAP server. The complete call takes...
2
by: Ottavio | last post by:
Hello, I'm having some problems with the authentication during a web service call I know I have to add the "Authorization: Basic xxxxxxxx" in the http header (not soap header) but I can't find a...
1
by: Jan Danielsson | last post by:
Hello all, I writing an application based on the SimpleXMLRPCServer class. I would like to know the IP address of the client performing the RPC. Is that possible, without having to abandon the...
1
by: Not Me | last post by:
Hi there, I'm using a hovermenuextender attached to a templatefield of a gridview, and everything seemed to work fine.. however I've moved on to add dynamic attributes to the hovermenu. Now I...
6
by: plork | last post by:
hi all i'm calling a web service method and can get it's results just fine however i want to grab the repsonse message from the call is anyone able to tell me how i do this? results =...
2
by: Steve | last post by:
Has anyone done something like this .... In google maps, mapquest or something similar, divide a metropolitan city and its suburbs into service areas. Then when a customer calls in to schedule a...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.