Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

500pts: Using Request.ServerVariables in Web service?

Posted on 2006-11-08
3
Medium Priority
?
245 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

618 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