Solved

Webservice Exception handling

Posted on 2009-07-08
1
734 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
Ronb23 earned 500 total points
ID: 24816270
0

Featured Post

Threat Trends for MSPs to Watch

See the findings.
Despite its humble beginnings, phishing has come a long way since those first crudely constructed emails. Today, phishing sites can appear and disappear in the length of a coffee break, and it takes more than a little know-how to keep your clients secure.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Free runner service software 2 127
allswap challenge 6 151
Spring Framework HTTPSession management 1 69
java imports not found 4 71
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
New Relic recently released its Synthetics product that allows for the creation of performance monitors that periodically test a site's performance. If you wish to test an interactive workflow New Relic employs Selenium WebDriverJS to run those test…
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.

732 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