Solved

500pts: Using Request.ServerVariables in Web service?

Posted on 2006-11-08
3
243 Views
Last Modified: 2012-05-05
Hi there,

Can anyone help, i can't seem to be able to use Request.ServerVariables in a webservice app i have written, i know its not exactly an asp.net app but it runs in a similar app..

Am i missing something?

Thanks in advance

Ian
0
Comment
Question by:ianinspain
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Expert Comment

by:ozymandias
ID: 17897212
[WebMethod]
public string HelloWorld()
{
      return "Hello World from " + HttpContext.Current.Request.ServerVariables["SERVER_NAME"];
}
0
 
LVL 15

Accepted Solution

by:
ozymandias earned 500 total points
ID: 17897215
WebServices don't automatically have an HttpContext like and asp.net page does so you have to get one manually.
0
 

Author Comment

by:ianinspain
ID: 17899092
Cool thanks..!!

Ian
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question