Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / January 2006

Tip: Looking for answers? Try searching our database.

Is a module in a web service or not???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Hyde - 17 Jan 2006 11:41 GMT
Hi,

I am writing a module that I want to be able to be called either by client
code or by a webservice method, and I want the module's function to be able
to detect whether it is being called directly from the client, or from the
web service.  The idea is that if it is running in the client space then it
will contact the web service itself and forward the call.

Is there any way that the module can detect where it is being hosted?

Thanks (hopefully) in advance,

David
NuTcAsE - 18 Jan 2006 16:44 GMT
One way (not ideal but a kinda cheap way) is to check if the
System.Web.HttpContext.Current is null. If it is null it is being
invoked outside the ASP.Net pipeline and most likely though a win app.
If it is not null then its being invoked from within the ASP.Net
pipeline.

Hope this helps..

- NuTcAsE
David Hyde - 19 Jan 2006 16:25 GMT
Yup, that works.  Thanks...

> One way (not ideal but a kinda cheap way) is to check if the
> System.Web.HttpContext.Current is null. If it is null it is being
[quoted text clipped - 5 lines]
>
> - NuTcAsE

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.