RE: Catching erros in web services - RETRACTION
- From: "Geoff O" <GeoffO@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 5 Jul 2005 10:54:08 -0700
Please disregard this question.
I had a syntactical issue with a string.Format() statement that was the
first statement in the web service catch block. This made it appear to me
that the .net framework was automatically jumping to the client catch block
when in fact it was a second exception within the web service catch block
that was being thrown.
Problem solved!
"Geoff O" wrote:
> I have a try catch block in a web service that executes ADO.NET code that
> interfaces with an Oracle database. In addition, I have a try catch block in
> the client around the call to the web service. I am having an issue catching
> the Oracle error and passing the error info to the client. When stepping
> through the debugger, I have noticed that as soon as I step into the catch
> block on the web service, the debugger jumps to the catch block on the client
> and the client catch block is what is run. The issue is that code in the
> catch block in the webservice does not execute. This causes the records
> involved with the transacation to remain locked. Also, the Exception object
> on the client contains SOAP error details, where as the Exception object on
> the web service contains the Oracle error. I would like to access the
> Exception object on the web service to be able to report the Oracle error
> which is much more beneficial in reporting what the problem is. Does anyone
> know what I need to do to access the Exception object info on the web
> service?
>
> I am using a C# Windows application as the test client. The web service was
> written in C#. I am developing the web service on my localhost.
>
> Below is sample code related to what I am currently doing:
>
> Client Code:
>
> try
> {
> errorMessage = webService1.DoSomething( param1 );
> }
>
> catch ( Exception ex ) // This exception obj contains SOAP error details
> {
> MessageBox.Show(errorMessage + " " + ex.ToString());
> return;
> }
>
> Web Service Code:
>
> try
> {
> dataAdaptor1.Update(ds);
> }
>
> catch (Exception ex ) // This exception object contains the ADO/Oracle
> error details
> {
> errorMessage = ex.ToString()); // As soon as I step here, the
> debugger
> // jumps to the
> catch block in the client and
> // none of this code
> is executed causing the
> // record in the
> database to remain locked.
> trans.Rollback();
> dataAdaptor1.UpdateCommand.Connection.Close();
> return errorMessage;
> }
>
>
> }
>
.
- References:
- Catching erros in web services
- From: Geoff O
- Catching erros in web services
- Prev by Date: Re: Change character encoding in the Request
- Next by Date: Two WS clients, one fast one slow!!!!
- Previous by thread: Catching erros in web services
- Next by thread: Two WS clients, one fast one slow!!!!
- Index(es):
Relevant Pages
|