if (ex instanceof Fault && ex.getCause() instanceof IOException) {
throw new WebServiceException(ex.getMessage(), ex.getCause());
}
if (getBinding() instanceof HTTPBinding) {
HTTPException exception = new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR);
exception.initCause(ex);
throw exception;
} else if (getBinding() instanceof SOAPBinding) {
SOAPFault soapFault = createSoapFault((SOAPBinding)getBinding(), ex);
if (soapFault == null) {
throw new WebServiceException(ex);