Solved

Webservice Exception handling

Posted on 2009-07-08
1
731 Views
Last Modified: 2013-11-24
Hi , I have a EJB web Service , in which i need to implement exception handling. can any one pls let me know how to do that .
here is the sample code for a method in Bean class
public class ExampleBean implements javax.ejb.SessionBean {
      public Info moveFile(String fileName, String sourcePath, String destinationPath ) throws Exception {
            Info info = new Info();
            String sourceFilePath = sourcePath + File.separatorChar + fileName;
            String retStr = FileUtils.moveFile(sourceFilePath, destinationPath);
            String retCode = "000";
            if (!retStr.equalsIgnoreCase("success"))
                  retCode = "100";
            info .setStatusCode(retCode);
            info .setStatusDescription(retStr);
            return info ;
      }
I have some more methods like above and i need a proper exception handling .. if some one can post some sample code it will be great.

thanks in adv


0
Comment
Question by:pkarka
1 Comment
 
LVL 4

Accepted Solution

by:
Ronb23 earned 500 total points
ID: 24816270
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sites similar to codingbat to improve coding hanson skills 3 56
mockito example issue 8 81
Spring Framework HTTPSession management 1 45
tomcat not starting 6 68
Online collaboration is quickly becoming embedded in the workplace, and its benefits are tangible. See what the current landscape looks like and what the future holds for collaboration tools and the future of work.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
The viewer will learn how to implement Singleton Design Pattern in Java.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question