@Test public void whenSoapFaultIsCausedByMalformedDocumentExceptionThenFaultStatusAndCodeAreChanged() { Fault fault = new Fault(new MalformedDocumentException()); doReturn(fault).when(message).getContent(any()); soapFaultResponseInterceptor.handleMessage(message); assertTrue(fault.getStatusCode() == 200); assertEquals("Client", fault.getFaultCode().toString()); }
@Override public void handleMessage(SoapMessage message) throws Fault { Fault f = (Fault) message.getContent(Exception.class); if (f == null) { return; } Throwable cause = f.getCause(); if (cause == null) { return; } f.setStatusCode(HTTP_OK_CODE); if (isClientException(cause)) { f.setFaultCode(new QName("Client")); } }
SoapFaultResponseInterceptor extends AbstractSoapInterceptor { @Override public void handleMessage(SoapMessage message) throws Fault { Fault f = (Fault) message.getContent(Exception.class); if (f == null) { return; } Throwable cause = f.getCause(); if (cause == null) { return; } f.setStatusCode(HTTP_OK_CODE); if (isClientException(cause)) { f.setFaultCode(new QName("Client")); } } }
SoapFaultResponseInterceptor extends AbstractSoapInterceptor { @Override public void handleMessage(SoapMessage message) throws Fault { Fault f = (Fault) message.getContent(Exception.class); if (f == null) { return; } Throwable cause = f.getCause(); if (cause == null) { return; } f.setStatusCode(HTTP_OK_CODE); if (isClientException(cause)) { f.setFaultCode(new QName("Client")); } } SoapFaultResponseInterceptor(); }
SoapFaultResponseInterceptor extends AbstractSoapInterceptor { @Override public void handleMessage(SoapMessage message) throws Fault { Fault f = (Fault) message.getContent(Exception.class); if (f == null) { return; } Throwable cause = f.getCause(); if (cause == null) { return; } f.setStatusCode(HTTP_OK_CODE); if (isClientException(cause)) { f.setFaultCode(new QName("Client")); } } SoapFaultResponseInterceptor(); @Override void handleMessage(SoapMessage message); }
SoapFaultResponseInterceptor extends AbstractSoapInterceptor { @Override public void handleMessage(SoapMessage message) throws Fault { Fault f = (Fault) message.getContent(Exception.class); if (f == null) { return; } Throwable cause = f.getCause(); if (cause == null) { return; } f.setStatusCode(HTTP_OK_CODE); if (isClientException(cause)) { f.setFaultCode(new QName("Client")); } } SoapFaultResponseInterceptor(); @Override void handleMessage(SoapMessage message);  }