473,387 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Can a webservice determine that it is called asynchronously?

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.

However, there are cases when the client would like to call the same
webservice synchronously. In such a case the client will be interested in
receiving the exception and displaying it to the user, or do whatever he
needs to do with it.

Adding throwException parameter would be no-brainer, but I thought wouldn't
be nice if a web service could determine how it is being called. If asynch -
catch and log exception.

Is it possible?

Thanks,

-Stan
Nov 21 '05 #1
4 1507
your idea doesn't seem right to me.

one way or the other , the semantics of the service should remain
consistent.
If an exception fires, log it.

then either re-throw it or not.

How do you know if you are async or not?
you don't, usually. but if you follow this article
http://msdn.microsoft.com/library/en...ce10012002.asp

you can make your service async, always. You can throw in the EndXxx call
if desired.

"Stan" <no****@yahoo.com> wrote in message
news:Oq**************@TK2MSFTNGP14.phx.gbl...
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.

However, there are cases when the client would like to call the same
webservice synchronously. In such a case the client will be interested in
receiving the exception and displaying it to the user, or do whatever he
needs to do with it.

Adding throwException parameter would be no-brainer, but I thought
wouldn't
be nice if a web service could determine how it is being called. If
asynch -
catch and log exception.

Is it possible?

Thanks,

-Stan

Nov 21 '05 #2
> How do you know if you are async or not?
you don't, usually. but if you follow this article


That is what I am asking.. You say 'usually'. Does it mean that there is
still a way to know?

Nov 21 '05 #3

"Stan" <no****@yahoo.com> wrote in message
news:Oq**************@TK2MSFTNGP14.phx.gbl...
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.
Are you calling the web method asynchronously using the BeginXXX/EndXXX
proxy method pair? If so, the exception is thrown when the client calls
EndXXX, and you can handle the exception with the normal try/catch
construct.

However, there are cases when the client would like to call the same
webservice synchronously. In such a case the client will be interested in
receiving the exception and displaying it to the user, or do whatever he
needs to do with it.

Adding throwException parameter would be no-brainer, but I thought wouldn't be nice if a web service could determine how it is being called. If asynch - catch and log exception.

Is it possible?


If the call is made asynchronously from the client side with the Begin/End
proxy method pair, then the web service call is made from a background
thread in the client. From the web service's point of view it appears as a
normal synchronous call and there is no way for the service to find out how
it is being called. But I really see no need for this either.

Regards,
Sami
Nov 21 '05 #4
i don't know, but that does not mean there is no way to know.

"Stan" <no****@yahoo.com> wrote in message
news:en**************@TK2MSFTNGP09.phx.gbl...
How do you know if you are async or not?
you don't, usually. but if you follow this article


That is what I am asking.. You say 'usually'. Does it mean that there is
still a way to know?

Nov 21 '05 #5

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

Similar topics

0
by: Suvojit | last post by:
We have an ASP that contains some data along with three IFrames in it. The 'sources' for each of these IFrames are set after the ASP page is loaded in the browser using a Javascript function....
2
by: Sergi Adamchuk | last post by:
I need determine which web service (class WebService or its inheritors) serveces current request (I need Type instance of class that serves request). For example you wrote your own WebService: ...
4
by: Tim Gallivan | last post by:
Hello group, I'm trying to develop a proof of concept webservice which asynchronously calls a function in a DLL. The function raises an event when it is finished, and works when used as part of...
4
by: Bamse | last post by:
Hi all, The problem is as follows: I need to authorize a user: through a WS; if a setting is on, the webservice will look in the local "database", if the setting is off it will connect to the...
1
by: gillcleeren | last post by:
I have made an desktop application which connects to a webservice running on a remote webserver. When my exe-file connects to the webservice, the firewall (my Norton Internet Security firewall, as...
0
by: anders.henriksen | last post by:
Hi I'm trying to communicate between a tird party system to my webservice and I get the following error message. The third party system (called envox) and my webservice are on the same server...
0
by: Chad | last post by:
Hi In vb6 I downloaded multiple pages from a website asynchronously by instantiating a dll 3 times that used an inet control with a doevents on the getchunk method when finished I simply raised...
1
by: Gary Howlett | last post by:
Hi Im using VS 2005 C#; Is there any issues I should be aware of if I add my webservice as a static variable to my main class? The reason im asking is should I create an object of my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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,...

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.