Skip to Content
author's profile photo Former Member
Former Member

Exception Handling when using Webservice Model

Hello,

The Tutorial 7 shows how to use the QuickCarRental EJB-application with webdynpro. The webdynpro model is a webservice model.

The QuickCarRentalException - in case of an error thrown by a SessionBean - will be caught inside the WebDynpro-Controller the following way:

<i> //@@begin onActionRentCar(ServerEvent)

try {

wdContext.currentSaveBookingElement().modelObject().execute();

wdContext.nodeResponse().invalidate();

MessageManager msgMgr=

(MessageManager) wdThis.wdGetAPI().getComponent().getMessageManager();

msgMgr.reportSuccess("Success!");

}

catch(Exception ex) {

System.out.println(ex);

ex.printStackTrace();

MessageManager msgMgr =

(MessageManager) wdThis.wdGetAPI().getComponent().getMessageManager();

msgMgr.reportException(ex.getLocalizedMessage(), true);

}

//@@end</i>

<b>The Probelm is:</b>

The Exception has lost its state information (message, stacktrace, cause). The information shown in the statusbar is therefore a nullstring. Logging the exception using <i>toString</i> only shows the package+classname.

<b>Conclusion:</b> This Exception-Handling is not sufficient.

<b>Question:</b> How to handle Server Side Exceptions right? Is there a SAP defined way (SOAPFaultExceptions, ..) which can be used to transport the error information from server to client?

Greetings

Ulf Helmke

Message was edited by: Ulf Helmke

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 27, 2004 at 08:19 AM

    Hello Ulf,

    Seems to be a bug. I will open a message for this.

    Best regards,

    Karin

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.