PDA

View Full Version : Eurekalog cannot handle the errors that raise in the soap serverdata module unit


ltlmeng
28-Sep-2005, 10:11 AM
i builded a web service with a soap server data module, when raise a
exception in the soap data module unit, Eurekalog cannot handle this
error. but Eurekalog can get the exception that raise in the main form.

help me !

admin
28-Sep-2005, 05:24 PM
ltlmeng wrote:
> i builded a web service with a soap server data module, when raise a
> exception in the soap data module unit, Eurekalog cannot handle this
> error. but Eurekalog can get the exception that raise in the main form.
>
> help me !

From the Help manual ("Unsupported applications" topic):

EurekaLog support natively more applications types (see "features" topic
for further details), but not all exists applications types, so the
scope of this little tutorial is explain how to can use EurekaLog in
unsupported applications types.

Basically the steps to do are two:

กค create a OnException event for the application type (used to call
EurekaLog manually);

กค create a ExceptionNotify event for EurekaLog (used to customize the
EurekaLog behavior).


NOTE: handling Web application you must disable the "Show Exception
Dialog" option to inhibit the Exception Dialog showing.


So a little example (to manage unsupported Web modules) can become as
follow:

//--------------------------------------------------------------------

// Event uses to call manually EurekaLog...
procedure TWebModule1.WebModuleException(Sender: TObject; E: Exception;
var Handled: Boolean);
begin
Handled := True;
StandardEurekaNotify(E, ExceptAddr); // Call manually EurekaLog
end;

// Event used to send to Browser the EurekaLog error page...
procedure TWebModule1.EurekaLog1ExceptionNotify(EurekaExcept ionRecord:
TEurekaExceptionRecord; var Handled: Boolean);
begin
Response.Content := GenerateHTML(
EurekaExceptionRecord.LogText, // Exception Log plain text
True); // Add the JavaScript 'back' button
at the page bottom
end;

//--------------------------------------------------------------------

I hope that this can help you to solve your problem, otherwise don't
hesitate to recontact me, ok? :)

--
Best regards...

Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG showing line n.

ChrisMiller
21-Aug-2006, 01:51 PM
Hello,

I have a stand alone SOAP Service that uses Indy 9 in Delphi 7 (based on work described here: http://bdn.borland.com/article/29484). I tried adding the WebModuleException to call Eureka manually, but that didn't work. Delphi is trapping unhandled events elsewhere and is passing exception error message to the SOAP client.

Chris Miller
VersaTrans Solutions

admin
21-Aug-2006, 02:50 PM
Hi,

ChrisMiller wrote:
> Hello,
>
> I have a stand alone SOAP Service that uses Indy 9 in Delphi 7 (based
> on work described here: http://bdn.borland.com/article/29484). I tried
> adding the WebModuleException to call Eureka manually, but that didn't
> work. Delphi is trapping unhandled events elsewhere and is passing
> exception error message to the SOAP client.
>
> Chris Miller
> VersaTrans Solutions

Have you try to add a breakpoint into these events?

Can you send to me a little source demo able to reproduce this problem?

--
Best regards...

Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG, every time!

ChrisMiller
21-Aug-2006, 03:23 PM
HI,

I put a breakpoint in the WebModuleException event, but it's never reached.

I created a web service function that does a division by zero call, to always force an error. The event handler that does get called is OnExcept event of the THTTPSoapPascalInvoker object. That event does not pass in a Exception object, but it was easy to get access to the exception.


procedure TwmELink.HTTPSoapPascalInvokerExceptionEvent(
const MethodName: String; const Request, Response: TStream);
var
myError: TObject;
begin
myError := AcquireExceptionObject;
if Assigned(myError) then begin
StandardEurekaNotify((myError as Exception), ExceptAddr);
end;
end;

This event is called from the TSoapPascalInvoker.Invoke method in SOAPPasInv.pas (Delphi 7). With this code, I was able to get Eureka to process the exception.


thanks,
Chris Miller
VersaTrans Solutions

admin
23-Aug-2006, 08:22 AM
Hi,

ChrisMiller wrote:
> HI,
>
> I put a breakpoint in the WebModuleException event, but it's never
> reached.
>
> I created a web service function that does a division by zero call, to
> always force an error. The event handler that does get called is
> OnExcept event of the THTTPSoapPascalInvoker object. That event does
> not pass in a Exception object, but it was easy to get access to the
> exception.
>
>
> [...]
>
> thanks,
> Chris Miller
> VersaTrans Solutions

To definitely can help you I think the best solution is to have a sources demo
able to reproduce your problem.

However I suggest you to proceed step by step.

First try to create a SOAP OnException event called for any raised exception.

Second try to use this event to call EurekaLog.

I'm looking for your feedback ASAP, ok? :)

--
Best regards...

Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG, every time!

ChrisMiller
23-Aug-2006, 01:16 PM
Hi Fabio,

I had tried what you described and that event was never called. Please re-read my last message. It explained why you need to use the OnExcept event of the THTTPSoapPascalInvoker object.

When I used that event, I was able to use Eureka log to catch unhandled events before they were passed from the SOAP server to the client.

Delphi is catching unhandled exceptions in SOAP methods in TSoapPascalInvoker.Invoke, that's why you need THTTPSoapPascalInvoker's OnExcept event.

admin
24-Aug-2006, 07:36 AM
Hi,

ChrisMiller wrote:
> Hi Fabio,
>
> I had tried what you described and that event was never called. Please
> re-read my last message. It explained why you need to use the OnExcept
> event of the THTTPSoapPascalInvoker object.
>
> When I used that event, I was able to use Eureka log to catch unhandled
> events before they were passed from the SOAP server to the client.
>
> Delphi is catching unhandled exceptions in SOAP methods in
> TSoapPascalInvoker.Invoke, that's why you need THTTPSoapPascalInvoker's
> OnExcept event.

Using the "TwmELink.HTTPSoapPascalInvokerExceptionEvent" event solve your problem?

--
Best regards...

Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG, every time!

ChrisMiller
24-Aug-2006, 01:28 PM
Hi Fabio,

Yes, when I used the THTTPSoapPascalInvoker's OnExcept event, I was able receive notification of an unhandled exception and send it to the EurekaLog component.

thanks,

admin
25-Aug-2006, 10:25 AM
Hi,

ChrisMiller wrote:
> Hi Fabio,
>
> Yes, when I used the THTTPSoapPascalInvoker's OnExcept event, I was
> able receive notification of an unhandled exception and send it to the
> EurekaLog component.
>
> thanks,

So, If I understand, this solve your problem, it's so? :)

--
Best regards...

Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG, every time!