Solved

Webservice Exception handling

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

For some reason Google Apps has decided to reserve 'www' for your new domain which results in an error when trying to map the web address 'www' to a certain site in your Google Sites. The error is 'this address is already being used' and after some …
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 viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

821 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