Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
|
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 14th, 2005, 02:34 AM
Registered User
 
Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default IP From WebService (.asmx) ?

Hi friends...
When i am geting IP address from my webservice (.asmx) file using...
-----------------
Dim ipNo As String
Dim ObjRequest as HttpRequest
ipNo = ObjRequest.ServerVariables("REMOTE_ADDR").ToString
----------------------------------
What is the value of variable ipNo is ...

I have doubt... because it call from webservice client(user) page .

So the ouput IP is User client computer or WEBSERVICE Client (actually web server) IP.



Thanks

 
Old March 14th, 2005, 03:21 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Why don't you try it out to find out? ;)

Anyway, when you say this:

because it call from webservice client(user) page .


does that mean the webservice is called from the client page in client side script, or server side with a server side technology?

In the first scenario, the client's IP will be passed; in the latter scenario it's the webserver that makes the call....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old March 14th, 2005, 03:53 AM
Registered User
 
Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar...
Thanks for prompt answer but clear me...
I want to know that ... I am fatching a Request.ServerVariables("REMOTE_ADDR") address
in My
webservice >> WEBMethod.

At that point This IP is client page ip or My webserver IP.

~Thanks
Tarang
www.digitalwhim.com

 
Old March 14th, 2005, 04:27 AM
Registered User
 
Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually why this questation in my mind coze...
When we use WEBSERVICE in our WEB Base application the flow
like that...

First Client Browser request .aspx page

In that .aspx page we use webservice so create a object for that webservice and call WEBMETHOD using that object.

so here i find a IP address using
ObjRequest.ServerVariables("REMOTE_ADDR").ToString

So where i doubt is ... this webservice request is from Our WebServer ( Not direct user browser)
so HttpRequest object ServerVariables("REMOTE_ADDR") return ip of ????? which IP ?

Regards.

www.digitalwhim.com



 
Old March 14th, 2005, 12:58 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

If I understand you correctly, that would return the IP address of your Web Server.

As far as the Web Service is concerned, your Web Server is the client. The Web Service doesn't really know there is also a browser client involved....

If you need the end-user's IP address, you'll need to pass it to one of your methods on the Web Service.

Cheers,

Imar
 
Old April 6th, 2005, 05:14 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You can use ObjRequest.ServerVariables("REMOTE_ADDR").ToString on the server that is executing the web application to get the client's address. This is what you'd pass to the web service.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
to know Webservice vingo_mail ASP.NET 2.0 Basics 1 March 3rd, 2008 01:16 PM
Chapter7_Onloading.asmx Winesoft BOOK: Beginning Ajax with ASP.NET 3 December 4th, 2007 06:01 PM
Can't execute .asmx files on IIS 5.0 wyury .NET Web Services 1 August 2nd, 2005 06:29 AM
webservice hanuyedluri .NET Web Services 1 March 21st, 2004 05:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.