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.DoS omething( param1 );
}
catch ( Exception ex ) // This exception obj contains SOAP error details
{
MessageBox.Show (errorMessage + " " + ex.ToString());
return;
}
Web Service Code:
try
{
dataAdaptor1.Up date(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.Up dateCommand.Con nection.Close() ;
return errorMessage;
}
} 2 4405
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.DoS omething( param1 ); }
catch ( Exception ex ) // This exception obj contains SOAP error details { MessageBox.Show (errorMessage + " " + ex.ToString()); return; }
Web Service Code:
try { dataAdaptor1.Up date(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.Up dateCommand.Con nection.Close() ; return errorMessage; }
}
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.DoS omething( param1 ); }
catch ( Exception ex ) // This exception obj contains SOAP error details { MessageBox.Show (errorMessage + " " + ex.ToString()); return; }
Web Service Code:
try { dataAdaptor1.Up date(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.Up dateCommand.Con nection.Close() ; return errorMessage; }
} This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Reinhard Abel |
last post by:
I have an old C-Program written with Borland 2.0. Now I like to do some
changes, but I get lot of syntax Erros with my new computer. When I use the
old mashine ( 286 ) it works perfectly but I can not use the program on the
new computer. It will not run.( Runs under MS-DOS) Is there any one how can
help me?
I also used newer Compilers but with the same result. (Syntax Erros)
thanks
|
by: cmay |
last post by:
FxCop complains every time I catch System.Exception.
I don't see the value in trying to catch every possible exception type
(or even figuring out what exceptions can be caught) by a given block
of code, when System.Exception seems to get the job done for me.
My application is an ASP.Net intranet site. When I catch an exception,
I log the stack trace and deal with it, normally by displaying an error
|
by: Michiel |
last post by:
Hello,
I want to see if the driver of my capture card sends messages when it
recieves video input.
In order to do this, I built a Windows Service, which contains a message
loop.
How can I see if the message comes from the driver ?
|
by: Vasco Lohrenscheit |
last post by:
Hi,
I have a Problem with unmanaged exception. In the debug build it works
fine to catch unmanaged c++ exceptions from other dlls with
//managed code:
try
{
//the form loads unmanaged dlls out of which unmanaged exception //get
thrown
|
by: cesark |
last post by:
I have calling a stored procedure that returns two values, and I want
to catch these values and to store them into a variable.
Here is a piece of my SP inside SQL Server that shows the returned
values:
SELECT @Id = SCOPE_IDENTITY()
SELECT @Id AS user_id
SELECT 1 AS Value
| |
by: Geoff O |
last post by:
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...
|
by: phlakie |
last post by:
I made a call to a stored procedure in a web method. The stored procedure
either returns an error or an integer. How do I catch this error in the web
method? Thanks.
|
by: Derek Schuff |
last post by:
I'm sorry if this is a FAQ or on an easily-accesible "RTFM" style page, but
i couldnt find it.
I have some code like this:
for line in f:
toks = line.split()
try:
if int(toks,16) == qaddrs+0x1000 and toks == "200": #producer
write
prod = int(toks, 16)
|
by: Eric Lilja |
last post by:
Hello, consider this complete program:
#include <iostream>
#include <string>
using std::cout;
using std::endl;
using std::string;
class Hanna
{
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |