473,480 Members | 4,852 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

code called from web page or webservice

Hi,

I have a small piece of code that is used by both a web page and by a
web service. I'd like some different behaviour depending on whether it
is called by the page or by the service.

In the piece of code, I can determine the calling source (page/service)
by checking to see if System.Web.HttpContext.Current.Session is null
(which it will be for service and won't be for page).

The thing is--I would like for the piece of code to be able to look up a
bit of information at this point. For the page, that bit of information
is stored in the HttpSessionState. How can I store this information so
that when the code is called from the web service it can be looked up?

In this case, unfortunately, passing parameters directly isn't a good
option for me.

Thanks for any help you can give.

-Casey
Nov 23 '05 #1
1 1097
Casey,

If you can't pass it to the page then I think storing it in a database
before calling the code and then having the code retrieve it from the
database would be your best option.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"C Williams" <no****@thank.you> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi,

I have a small piece of code that is used by both a web page and by a web
service. I'd like some different behaviour depending on whether it is
called by the page or by the service.

In the piece of code, I can determine the calling source (page/service) by
checking to see if System.Web.HttpContext.Current.Session is null (which
it will be for service and won't be for page).

The thing is--I would like for the piece of code to be able to look up a
bit of information at this point. For the page, that bit of information
is stored in the HttpSessionState. How can I store this information so
that when the code is called from the web service it can be looked up?

In this case, unfortunately, passing parameters directly isn't a good
option for me.

Thanks for any help you can give.

-Casey

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3425
by: Bruce W.1 | last post by:
The intent of my web service is an RSS feed from a blog. Originally I used a StringBuilder to make the XML and returned a string from the webmethod. But this doesn't display properly in IE. So...
12
4097
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport)...
1
1997
by: Fred W | last post by:
I have 2 dependent dropdowns and would like to populate the contents of the child dropdown dynamically based on the selected item of the parent. Pretty standard requirement. However, can this...
1
1002
by: C Williams | last post by:
Hi, I have a small piece of code that is used by both a web page and by a web service. I'd like some different behaviour depending on whether it is called by the page or by the service. In...
4
1512
by: Stan | last post by:
When a webservice is called through BeginInvoke asynchrously and an exception is thrown, this exception is not propagated to the client (obviously). Asynch client simply does not care about it. ...
1
1896
by: A.M-SG | last post by:
Hi, I have a web service with two soap extensions enabled on it. When I run the default IIS method invoke page, the invoke button bypasses all my soap extensions. But when I call the...
1
2002
by: Felix | last post by:
Hi Fellows, following problem: I have written a class library in vb.net an enabled it for com interop. A class within the library calls the FileNet Content Engine Webservice. That is a...
0
1382
by: Nogusta123 | last post by:
My web service has a single method called "CheckEligibility". This method can be used to check a person's eligibility for multiple products. Each product has different data requiements so each...
0
1733
by: =?Utf-8?B?QWRhbUM=?= | last post by:
Hi, I'm wondering if you can help. We have a classic asp application that creates and posts some XML using the SOAP format to a .NET WebService. The WebService and the asp are on the same IIS...
2
2198
by: Peter | last post by:
I have a Web page which calls a WebService, this web service call might take few seconds to up 30 min I was thinking of having a webpage query the webservice every minute to keep it form timing...
0
7040
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6905
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7041
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4478
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
561
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.