I have developed a webservice using Apache CXF ,which will be in production
very soon . I am concerned about the exception handling in this , i am not
sure whether what i followed is correct or not .

I have a method shown below which i exposed i as a webservice

import javax.jws.WebService;

@WebService
public interface TataWebService {
    public String distragery()throws Exception;

}
public String distrager throws Exception {

    int a  = 30;
     strategyData = "currentlyhadcoced" ;

    if(a==30)
    {
throw new IncorrectProjectIdsException("The Value of a is 30");
    }

    return strategyData;
And the way i defined User defined exception is this way

@WebFault(name = "IncorrectProjectIdsDetails")

public class IncorrectProjectIdsException extends Exception {

    private java.lang.String incorrectProjectIdsDetails;

    public IncorrectProjectIdsException (String message) {
        super(message);
    }

    public java.lang.String getFaultInfo() {
        return this.incorrectProjectIdsDetails;
    }
}
Please tell me if this is correct , regarding the throws declaration inside
the method signature or shuld we handle in any other manner ??

Thank you very much

--
View this message in context: 
http://cxf.547215.n5.nabble.com/Exception-handling-inside-Apache-CXF-Webservices-tp4960248p4960248.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to