Exceptions and Web services

  • Thread starter Thread starter xxxxyz
  • Start date Start date
X

xxxxyz

I know that I can't throw exceptions in a Web Service and catch it in
the web application. What is the best way to cope with this situation
(for example if it cannot connect to a database or any exception
connected to classes for working with databases)?
 
Hi
will if you just throw an exception to your application whenever you get
an exception in the webservice , your application would always get a soup
exception no matter what the original exception of the webservice was.
you can however for example do as follows . whenver you catch an exception
in the web service , get it message property into a string and then send
that string to your application( ma be throw another webmethod, that your
application logic would call directly after it gets a soup exception). may
be you can prefix the string with the word exception . so your application
would recognize it as an exception string. so you would be getting
something like ( " Exception: object reference is not set to an object ").
hope that is clear.
Mohamed M .Mahfouz
Developer Support Engineer
ITWorx on behalf of Microsoft EMEA GTSC
 
Back
Top