/** * Tests that a SOAP fault without SOAP details is received correctly. * * @throws Exception */ public void testReceiveFaultMessageWithErrorDetailWithHandler() throws Exception { m_inCtx.addHandler(SoapPhase.BODY_FAULT, new UnmarshallingInHandler(ErrorMessage.class)); Processor processor = SoapProtocol.SOAP1_1.createProcessor(ExchangeContext.createInOnlyExchange(m_inCtx)); StubbedChannel.setInput(TestObjects.DETAILED_SOAP_FAULT); processor.receiveMessage(StubbedChannel.getInConnection()); SoapFault expected = new SoapFault( SoapFault.FAULT_CODE_CLIENT, "Invalid message format", "http://example.org/someactor"); expected.addDetail( new ErrorMessage("There were lots of elements in the message that I did not understand")); expected.addDetail(new ErrorType("Severe")); assertEquals(expected, m_inCtx.getBody()); }
@Override public void fault(SoapFault fault) throws Exception { onError(fault.toCodedException()); }