throw ex.fillInStackTrace();
}
}
if (getBinding() instanceof HTTPBinding) {
HTTPException exception = new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR);
exception.initCause(ex);
throw exception;
} else if (getBinding() instanceof SOAPBinding) {
SOAPFault soapFault = ((SOAPBinding)getBinding()).getSOAPFactory().createFault();
if (ex instanceof SoapFault) {
soapFault.setFaultString(((SoapFault)ex).getReason());
soapFault.setFaultCode(((SoapFault)ex).getFaultCode());
soapFault.setFaultActor(((SoapFault)ex).getRole());
Node nd = soapFault.getOwnerDocument().importNode(((SoapFault)ex).getOrCreateDetail(),
true);
nd = nd.getFirstChild();
soapFault.addDetail();
while (nd != null) {
Node next = nd.getNextSibling();
soapFault.getDetail().appendChild(nd);
nd = next;
}
} else {
soapFault.setFaultCode(new QName("http://cxf.apache.org/faultcode", "HandlerFault"));
String msg = ex.getMessage();
if (msg != null) {
soapFault.setFaultString(msg);
}
}
SOAPFaultException exception = new SOAPFaultException(soapFault);
exception.initCause(ex);
throw exception;
} else {
throw new WebServiceException(ex);
}
} finally {