Why do you want to create a new exception type? Just do something like this:
throw new WebserviceException("your error message");
I hope you could guide me a bit here, I don't understand 100%.
First of all, I created the Java class as shown below :
import com.mendix.modules.webservices.WebserviceException;
public class MyProjectException extends WebserviceException {
public MyProjectException(String faultCode, String faultString) {
super(faultCode, faultString);
// TODO Auto-generated constructor stub
}
public MyProjectException(String faultCode, String faultString, Throwable cause) {
super(faultCode, faultString, cause);
// TODO Auto-generated constructor stub
}
}
Then in my java action I throw the MyProjectException, like so :
public Boolean executeAction() throws Exception
{
// BEGIN USER CODE
throw new MyProjectException("My Project Exception", error);
// END USER CODE
}
So I add the above mentioned Java action to a Microflow and expose it as a Webservice. When I execute the operation in my client, I still get a FaultException, not a MyProjectException.
Is this what you meant with "extend webserviceexception"?
Just extend your exception from WebserviceException