Re: How to avoid first time exceptions when calling a webmethod ?



"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@xxxxxxxxxxxxxxxxxxxxxxx
These 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]

.



Relevant Pages

  • Re: Client Firewall and Outlook
    ... Additionally there are times when a user is on the phone to a client, ... I am trying to add Outlook ... as an exception to the firewall list. ... on windows firewall in control panel. ...
    (microsoft.public.windows.server.sbs)
  • Re: Code design ideas?
    ... app and the webservice, etc. ... Errors of type 1 should be handled by the client side. ... Usually it is the Message of the Exception. ... severity levels: warning and error. ...
    (microsoft.public.dotnet.languages.csharp)
  • Assmebly.Load error using Byte()
    ... I have 2 WebApplication project (dummy and dummy2). ... The first is trying to load a UserControl compiled in the second. ... The web sites are formed of a client part and an administration part. ... An unhandled exception occurred during compilation using ...
    (microsoft.public.dotnet.framework.aspnet)
  • friendly error messages for usernameForCertificateSecurity
    ... returned to the client in a simple way. ... In the code above if I comment out the throwing of the soap exception on the ... "Security requirements are not satisfied because the security header is not ... true error message is a less then desireable solution. ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: friendly error messages for usernameForCertificateSecurity
    ... You are receiving that security error because WSE could not validate the ... The WSE core is who creates that exception, and it does not provide a way ... a.You can maybe use a WSE router between the client and the service, ...
    (microsoft.public.dotnet.framework.webservices.enhancements)

Loading