473,385 Members | 1,409 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,385 software developers and data experts.

Client Information

Hello,
I have a webservice designed in VS 2005 using C#. I would like to know
the URL and the IP addresses of the people who are accessing my service. Is
this a possibility? if so how?

Thanks,
--
-Scott
Oct 29 '07 #1
8 1551
Scott,

Please try the following in your webservice class.

Context.Request.UserHostAddress

That should be available and what you need. Let me know... email me if
you'd like.

Robby Valles

On Oct 29, 1:16 pm, "Scott Elgram" <SElg...@verifpoint.comwrote:
Hello,
I have a webservice designed in VS 2005 using C#. I would like to know
the URL and the IP addresses of the people who are accessing my service. Is
this a possibility? if so how?

Thanks,
--
-Scott

Nov 2 '07 #2
"Scott Elgram" <SE*****@verifpoint.comwrote in message
news:%2***************@TK2MSFTNGP02.phx.gbl...
Hello,
I have a webservice designed in VS 2005 using C#. I would like to know
the URL and the IP addresses of the people who are accessing my service.
Is
this a possibility? if so how?
What do you mean, "URL"? What do you mean, "people"? People don't have URLs,
and URLs don't access web services. Please give us more detail.
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
Nov 3 '07 #3
Ok, in detail...
I have created a WebService in VS 2005 using C# that returns the results
of a database search in an XML dataset .
The purpose is to allow clients access to this webservice so that they
can utilize the search options I make public through the webservice. By
doing it this way clients who use this service should be able to incorporate
my data into their website as if it were their own.
What I am trying to record is the URL of the page that accessed the
webservice and the IP of the domain that page is under.
For example:
The company XYZ.com (IP: 111.111.111.111) would like to use my data
on their website. using the webservice I have created they access the
webservice through code on www.xyz.com/search.aspx which returns an XML
dataset which they can display on their page.
In this example what I would like to record is "www.xyz.com/search.aspx"
and "111.111.111.111".

Let me know if that still doesn't make sense.
Thanks,
-Scott
"John Saunders [MVP]" <john.saunders at trizetto.comwrote in message
news:uN**************@TK2MSFTNGP03.phx.gbl...
"Scott Elgram" <SE*****@verifpoint.comwrote in message
news:%2***************@TK2MSFTNGP02.phx.gbl...
Hello,
I have a webservice designed in VS 2005 using C#. I would like to
know
the URL and the IP addresses of the people who are accessing my service.
Is
this a possibility? if so how?

What do you mean, "URL"? What do you mean, "people"? People don't have
URLs,
and URLs don't access web services. Please give us more detail.
--
--------------------------------------------------------------------------
------
John Saunders | MVP - Windows Server System - Connected System Developer


Nov 8 '07 #4
Thanks for your reply and I'm sorry it took so long for me to get back to
this.
I tried what you suggested and I now get the IP address of the site that
is accessing the service. Thank you very much, however, I would also like
to get the name of the page that is calling the service. I tried using
"Context.Request.Url.AbsolutePath" but all I get is the address of the
services asmx file. i.e. /SiteFolder/Service.asmx

if you can offer any info to resolve this as well it would be much
appreciated.

-Scott

"Robby Valles" <ro**********@gmail.comwrote in message
news:11*********************@19g2000hsx.googlegrou ps.com...
Scott,

Please try the following in your webservice class.

Context.Request.UserHostAddress

That should be available and what you need. Let me know... email me if
you'd like.

Robby Valles

On Oct 29, 1:16 pm, "Scott Elgram" <SElg...@verifpoint.comwrote:
Hello,
I have a webservice designed in VS 2005 using C#. I would like to
know
the URL and the IP addresses of the people who are accessing my service.
Is
this a possibility? if so how?

Thanks,
--
-Scott


Nov 8 '07 #5
"Scott" <Sc***@verifpoint.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
You missed my purpose.
I am not trying to use this information to identify proper usage. Just
simply collecting data of who is using it and when. If the IP address is
that of a NAT box or some other piece of hardware that is fine. The
people
that have asked me to get this information realize everything that you
have
mentioned and they realize that this information may not always be
accurate
or available. That, however, doe snot stop them from wanting to log it.
For arguments sake, lets say the information I am trying to retrieve is
available due to however the client has set up their site. I have managed
to get the IP address but I am still stuck on how I can get the URL. So
far
I have only been able to retrieve the address of the ASMX file not
whatever
called it.
Scott, there _is_ no URL. What it the client that called your web service
was not a web page? In that case, there would be no URL to pass, so the web
services infrastructure _never_ passes any URL.

Sorry, but if you want to log the URL of the web page that called the web
service, then you'll have to make the web page pass the URL to the service.
This could be done as a parameter to every web service operation, or it
could be done through a custom SOAP Header.
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
Nov 12 '07 #6
If the client that called the service is not a page then the variable should
simply be null. But, the main purpose here is so that clients could access
specific functions with the info in our database from a webpage. So
assuming that it is indeed a webpage that calls the web service is there
still no way to get the URL of that page?

"John Saunders [MVP]" <john.saunders at trizetto.comwrote in message
news:uK**************@TK2MSFTNGP02.phx.gbl...
"Scott" <Sc***@verifpoint.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
You missed my purpose.
I am not trying to use this information to identify proper usage.
Just
simply collecting data of who is using it and when. If the IP address
is
that of a NAT box or some other piece of hardware that is fine. The
people
that have asked me to get this information realize everything that you
have
mentioned and they realize that this information may not always be
accurate
or available. That, however, doe snot stop them from wanting to log it.
For arguments sake, lets say the information I am trying to retrieve
is
available due to however the client has set up their site. I have
managed
to get the IP address but I am still stuck on how I can get the URL. So
far
I have only been able to retrieve the address of the ASMX file not
whatever
called it.

Scott, there _is_ no URL. What it the client that called your web service
was not a web page? In that case, there would be no URL to pass, so the
web
services infrastructure _never_ passes any URL.

Sorry, but if you want to log the URL of the web page that called the web
service, then you'll have to make the web page pass the URL to the
service.
This could be done as a parameter to every web service operation, or it
could be done through a custom SOAP Header.
--
--------------------------------------------------------------------------
------
John Saunders | MVP - Windows Server System - Connected System Developer


Nov 13 '07 #7
"Scott" <Sc***@verifpoint.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
If the client that called the service is not a page then the variable
should
simply be null. But, the main purpose here is so that clients could
access
specific functions with the info in our database from a webpage. So
assuming that it is indeed a webpage that calls the web service is there
still no way to get the URL of that page?
No. Not unless the page sends it to the service.

Remember that a web service simply receives some XML sent by some code.
There's nothing to indicate whether the code was a page, or which page it
was.
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
Nov 13 '07 #8
Thanks, I'll have to just be happy woth the IP address then

"John Saunders [MVP]" <john.saunders at trizetto.comwrote in message
news:uZ**************@TK2MSFTNGP05.phx.gbl...
"Scott" <Sc***@verifpoint.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
If the client that called the service is not a page then the variable
should
simply be null. But, the main purpose here is so that clients could
access
specific functions with the info in our database from a webpage. So
assuming that it is indeed a webpage that calls the web service is there
still no way to get the URL of that page?

No. Not unless the page sends it to the service.

Remember that a web service simply receives some XML sent by some code.
There's nothing to indicate whether the code was a page, or which page it
was.
--
--------------------------------------------------------------------------
------
John Saunders | MVP - Windows Server System - Connected System Developer


Nov 13 '07 #9

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

Similar topics

1
by: Rhett | last post by:
Hello,EveryBody! I'm troubled by a design problem, Hoping that you'll save me out! The Situation is: We have two project of code A and B.A is our reusable code base, B is for specified for...
4
by: Oliver Stratmann | last post by:
Hello All, does anyone know, where the configuration of a db2-client on a windows-machine is stored? I searched the registry and the filesystem on my machine and couldn't find anything. Is...
6
by: Ken Allen | last post by:
I am relatively new to .Net and C#, but I hav ebeen programing in other languages and done some COM work for a number of years. I am attempting to understand how to map an older program...
7
by: Ken Allen | last post by:
I have a .net client/server application using remoting, and I cannot get the custom exception class to pass from the server to the client. The custom exception is derived from ApplicationException...
2
by: R.A. | last post by:
Hi, I have a web service that process a client call. When a client makes a call to the web method the method needs to query some data from a client_A and return the data to the calling client_B....
1
by: Carl Jones via .NET 247 | last post by:
(Type your message here) I'm trying to run a client-side script from a web page. It's a VB script that gets information (computer name, software versions etc )about the computer and writes it to a...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
0
by: mateipuiu | last post by:
When a try to run a client build on 2005, which uses the Microsoft.ApplicationBlocks.Cache.dll reference, when using a Microsoft.ApplicationBlocks.Cache.dll created on Debug mode, the client works...
0
by: Maurizio | last post by:
I'd like to ask some suggestion regarding a software that I'm developping. For develop the project I've to use VB.NET and Framework 3.5 This is a Client Server application. I've some computer...
1
by: suzacaru7 | last post by:
HI, I am doing a database for my beutition shop. I created a table called slimming, which i store the clients info (including ID card number), the date of the appointment, the type of therapy...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.