Solved

Webservice Exception handling

Posted on 2009-07-08
1
727 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

To properly understand GitHub, let’s divide it into two words ‘Git’ and ‘Hub’. Git is basically a ‘Distribution Version Control’ (DVC) and ‘Source Code Management’ (SCM) system widely used by software programmers while Hub means the efficient centre…
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.
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…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

760 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now