< prev index next >
src/java.xml.ws/share/classes/com/sun/xml/internal/ws/fault/SOAPFaultBuilder.java
Print this page
*** 35,44 ****
--- 35,45 ----
import com.sun.xml.internal.ws.encoding.soap.SerializationException;
import com.sun.xml.internal.ws.message.jaxb.JAXBMessage;
import com.sun.xml.internal.ws.message.FaultMessage;
import com.sun.xml.internal.ws.model.CheckedExceptionImpl;
import com.sun.xml.internal.ws.model.JavaMethodImpl;
+ import com.sun.xml.internal.ws.spi.db.WrapperComposite;
import com.sun.xml.internal.ws.spi.db.XMLBridge;
import com.sun.xml.internal.ws.util.DOMUtil;
import com.sun.xml.internal.ws.util.StringUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
*** 304,313 ****
--- 305,315 ----
Class exceptionClass = ce.getExceptionClass();
Class detailBean = ce.getDetailBean();
try{
Node detailNode = getDetail().getDetails().get(0);
Object jaxbDetail = getJAXBObject(detailNode, ce);
+ if (jaxbDetail instanceof Exception) return (Exception)jaxbDetail;
Constructor exConstructor;
try{
exConstructor = exceptionClass.getConstructor(String.class, detailBean);
return (Exception) exConstructor.newInstance(getFaultString(), jaxbDetail);
}catch(NoSuchMethodException e){
*** 328,346 ****
return null;
if (ce.getExceptionType().equals(ExceptionType.UserDefined)) {
return createDetailFromUserDefinedException(ce, exception);
}
try {
! Method m = exception.getClass().getMethod("getFaultInfo");
! return m.invoke(exception);
} catch (Exception e) {
throw new SerializationException(e);
}
}
private static Object createDetailFromUserDefinedException(CheckedExceptionImpl ce, Object exception) {
Class detailBean = ce.getDetailBean();
Field[] fields = detailBean.getDeclaredFields();
try {
Object detail = detailBean.newInstance();
for (Field f : fields) {
Method em = exception.getClass().getMethod(getReadMethod(f));
--- 330,348 ----
return null;
if (ce.getExceptionType().equals(ExceptionType.UserDefined)) {
return createDetailFromUserDefinedException(ce, exception);
}
try {
! return ce.getFaultInfoGetter().invoke(exception);
} catch (Exception e) {
throw new SerializationException(e);
}
}
private static Object createDetailFromUserDefinedException(CheckedExceptionImpl ce, Object exception) {
Class detailBean = ce.getDetailBean();
+ if (ce.getExceptionClass().equals(detailBean)) return exception;
Field[] fields = detailBean.getDeclaredFields();
try {
Object detail = detailBean.newInstance();
for (Field f : fields) {
Method em = exception.getClass().getMethod(getReadMethod(f));
< prev index next >