Solved

500pts: Using Request.ServerVariables in Web service?

Posted on 2006-11-08
3
231 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
  • 2
3 Comments
 
LVL 15

Expert Comment

by:ozymandias
Comment Utility
[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
Comment Utility
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
Comment Utility
Cool thanks..!!

Ian
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now