Skip to Content
avatar image
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 comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded