RE: Catching erros in web services - RETRACTION

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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;
> }
>
>
> }
>
.



Relevant Pages

  • Re: Implementing a common SOAP Header across multiple Web Service Pages
    ... to set a client up to reference multiple Web ... the Web Service site would ... Your point about leaving the ASMX page as lean as possible and acting just ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Implementing a common SOAP Header across multiple Web Service Pages
    ... between my Web Service application and the client. ... public string SID; ... Web Service page, rather than to a dozen or so separate Web Service pages ... You can easily create a .ASMX file ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Still Need desperate help to start with ASP NET - simplified problems - HELP!!
    ... You could do it as a web service. ... The handler can draw on the webservice for information and db lookup. ... IE posts data AJAX to handler on web server ... featured application (say thick client) which does a lot of complicate ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: WSE 3.0, SoapReceiver and Kerberos encryption
    ... I have a machine we'll call 'Service' which exposes a web service called ... I have defined a WSE 3.0 policy that sets up Kerberos Security. ... I have a machine we'll call 'Client'. ... format when the "target Web service is created using a SoapReceiver ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: UsernameOverTransportSecurity+SSL Confusion, please help
    ... But when I go to my web service: ... I have under IIS settings for my WebService? ... I will have a private key on the server, and I will give the private key to ... The client will automatically get the public key and negotiate a key to ...
    (microsoft.public.dotnet.framework.webservices.enhancements)