try {
faultBean = loadClass(faultBeanClassName, getContextClassLoader());
} catch (ClassNotFoundException e){
faultBean = loadClass(faultBeanClassName, ed.getAxisService().getClassLoader());
}
AnnotationDesc aDesc = AnnotationDescImpl.create(faultBean);
if (aDesc.hasXmlRootElement()) {
faultBeanLocalName = aDesc.getXmlRootElementName();
}
} catch (Throwable t) {
throw ExceptionFactory.makeWebServiceException(t);
}
}
}
if (faultBeanLocalName == null || faultBeanLocalName.length() == 0) {
faultBeanLocalName = getSimpleClassName(faultDesc.getExceptionClassName()) + "Bean";
}
/* Algorithm for fault bean namespace
* 1) The namespace defined on the @WebFault of the exception.
* 2) If not present, the namespace defined via the @XmlRootElement of the class name.
* 3) If not present, the namespace of the method's declared class + "/jaxws"
*/
String faultBeanNamespace = faultDesc.getTargetNamespace();
if (faultBeanNamespace == null || faultBeanNamespace.length() == 0) {
if (faultBeanClassName != null && faultBeanClassName.length() > 0) {
try {
Class faultBean;
try {
faultBean = loadClass(faultBeanClassName, getContextClassLoader());
} catch (ClassNotFoundException e){
faultBean = loadClass(faultBeanClassName, ed.getAxisService().getClassLoader());
}
AnnotationDesc aDesc = AnnotationDescImpl.create(faultBean);
if (aDesc.hasXmlRootElement()) {
faultBeanNamespace = aDesc.getXmlRootElementNamespace();
}
} catch (Throwable t) {
throw ExceptionFactory.makeWebServiceException(t);
}
}