Re: How to avoid first time exceptions when calling a webmethod ?
- From: "John Saunders [MVP]" <john.saunders at trizetto.com>
- Date: Thu, 2 Aug 2007 10:59:19 -0400
"Olivier BESSON" <o.besson@xxxxxxxxxxxxxxxx> wrote in message news:ekUb5vP1HHA.4184@xxxxxxxxxxxxxxxxxxxxxxx
"John Saunders [MVP]" <john.saunders at trizetto.com> a écrit dans le message de news: u3BduZ50HHA.1336@xxxxxxxxxxxxxxxxxxxxxxxThese exceptions aren't being _hidden_ by the runtime. They are being thrown by, and _handled_ by the runtime. Ignore them.
--
John Saunders [MVP]
Ok, thanks for the response.
When i sayed "hidden" i wanted to say what you say.
I think i can best explain what i want to do (if possible ???) with an example :
I suppose that when you build a web service (client or server) there is a lot of inheritance and a lot of code that use reflexion to get information.
Why do you think there's a lot of reflection being used?
Maybe for example with the client :
Client opens a tcp connection with the server
Client use the tcp to do a post in anonymous mod
If there is an exception that say "authent = windows" Client catchs it
This is not an exception. It's part of the HTTP protocol and is part of normal processing.
Client use the tcp to do a post in with NTML auth
If ok Client return ok
Else Client return new exception(not authentified)
Else Client return ok
In this case i'll always have an exception if server is in "authent = windows".
No, you won't. Why do you think there would be an exception? Also, you would only see the exception if it was unhandled by the runtime. In that case, you should do what I suggested and get rid of the "stop when thrown" checkbox.
What i wanted was :
Is there a way to have access to all these code (auto generated base sources, delegates on certains objects, ohter ???) to tell it not to try anonymous because i know i must use NTLM ?
OrElse is there a documentation on how to "make from scratch" a web service client using the xsd generated code only for the soap serial/deserial.
If i insist so it's because i have one of my most important "best practices" from years that is :
In a normal conditions if your code is correct you must have NO exceptions and one of the first rules for me and my team is :
Do all your coding and tests in debug mode with halt on all exceptions (vb6 and vb.net) : you must never halt, only from real exceptions (network failure, no more space on hd, etc ...).
I'm sorry, but you've made a very serious mistake. You should NOT be concerned with how any other piece of code implements itself. This is the basic principal of encapsulation in OO. In particular, if some piece of code happens to implement its logic by throwing and catching exceptions, it's NOT YOUR CONCERN.
I have never heard of anybody using your methodology, and I think it's one of the worse techniques I've ever heard of. I have to assume that it's due to a fundamental misunderstanding of exception handling.
Frankly, I don't even see how it would be possible to solve this problem. How do you want to distinguish between the exceptions you want to stop at, and the exceptions you don't want to stop at?
--
John Saunders [MVP]
.
- Follow-Ups:
- Re: How to avoid first time exceptions when calling a webmethod ?
- From: Olivier BESSON
- Re: How to avoid first time exceptions when calling a webmethod ?
- References:
- Re: How to avoid first time exceptions when calling a webmethod ?
- From: Olivier BESSON
- Re: How to avoid first time exceptions when calling a webmethod ?
- Prev by Date: Re: .NET based SOAP client inter-op issue with Apache Axis based w
- Next by Date: Re: HttpWebRequest.Abort() does not stop network traffic
- Previous by thread: Re: How to avoid first time exceptions when calling a webmethod ?
- Next by thread: Re: How to avoid first time exceptions when calling a webmethod ?
- Index(es):
Relevant Pages
|
Loading