verify(soapBody).addServerOrReceiverFault(eq("503 Service Unavailable"), any(Locale.class));
@Override public void addSoapFault(SoapBody soapBody) { soapBody.addServerOrReceiverFault(faultStringOrReason, locale); } };
@Override public void addSoapFault(SoapBody soapBody) { soapBody.addServerOrReceiverFault(faultStringOrReason, locale); } };
@Override public void addSoapFault(SoapBody soapBody) { soapBody.addServerOrReceiverFault(faultStringOrReason, locale); } };
@Override protected final boolean resolveExceptionInternal(MessageContext messageContext, Object endpoint, Exception ex) { Assert.isInstanceOf(SoapMessage.class, messageContext.getResponse(), "SimpleSoapExceptionResolver requires a SoapMessage"); SoapMessage response = (SoapMessage) messageContext.getResponse(); String faultString = StringUtils.hasLength(ex.getMessage()) ? ex.getMessage() : ex.toString(); SoapBody body = response.getSoapBody(); SoapFault fault = body.addServerOrReceiverFault(faultString, getLocale()); customizeFault(messageContext, endpoint, ex, fault); return true; }
@Override protected final boolean resolveExceptionInternal(MessageContext messageContext, Object endpoint, Exception ex) { Assert.isInstanceOf(SoapMessage.class, messageContext.getResponse(), "SimpleSoapExceptionResolver requires a SoapMessage"); SoapMessage response = (SoapMessage) messageContext.getResponse(); String faultString = StringUtils.hasLength(ex.getMessage()) ? ex.getMessage() : ex.toString(); SoapBody body = response.getSoapBody(); SoapFault fault = body.addServerOrReceiverFault(faultString, getLocale()); customizeFault(messageContext, endpoint, ex, fault); return true; }
@Override protected final boolean resolveExceptionInternal(MessageContext messageContext, Object endpoint, Exception ex) { Assert.isInstanceOf(SoapMessage.class, messageContext.getResponse(), "SimpleSoapExceptionResolver requires a SoapMessage"); SoapMessage response = (SoapMessage) messageContext.getResponse(); String faultString = StringUtils.hasLength(ex.getMessage()) ? ex.getMessage() : ex.toString(); SoapBody body = response.getSoapBody(); SoapFault fault = body.addServerOrReceiverFault(faultString, getLocale()); customizeFault(messageContext, endpoint, ex, fault); return true; }
@Override protected final boolean resolveExceptionInternal(MessageContext messageContext, Object endpoint, Exception ex) { Assert.isInstanceOf(SoapMessage.class, messageContext.getResponse(), "SimpleSoapExceptionResolver requires a SoapMessage"); SoapMessage response = (SoapMessage) messageContext.getResponse(); String faultString = StringUtils.hasLength(ex.getMessage()) ? ex.getMessage() : ex.toString(); SoapBody body = response.getSoapBody(); SoapFault fault = body.addServerOrReceiverFault(faultString, getLocale()); customizeFault(messageContext, endpoint, ex, fault); return true; }
@Override protected final boolean resolveExceptionInternal(MessageContext messageContext, Object endpoint, Exception ex) { MethodEndpoint methodEndpoint = (MethodEndpoint)endpoint; if(methodEndpoint != null && methodEndpoint.getBean().getClass().getSimpleName().equalsIgnoreCase(getEndpointClass().getSimpleName())) { Assert.isInstanceOf(SoapMessage.class, messageContext.getResponse(), "SimpleSoapExceptionResolver requires a SoapMessage"); SoapMessage response = (SoapMessage) messageContext.getResponse(); String faultString = StringUtils.hasLength(ex.getMessage()) ? ex.getMessage() : ex.toString(); SoapBody body = response.getSoapBody(); SoapFault fault = body.addServerOrReceiverFault(faultString, getLocale()); customizeFault(messageContext, endpoint, ex, fault); return true; } return false; }
@Override protected final boolean resolveExceptionInternal(MessageContext messageContext, Object endpoint, Exception ex) { Assert.isInstanceOf(SoapMessage.class, messageContext.getResponse(), "SimpleSoapExceptionResolver requires a SoapMessage"); if (throttlingAsServerError && ex instanceof ThrottlingExceededException) { // no SOAP fault => server error return false; } else { SoapMessage response = (SoapMessage) messageContext.getResponse(); String faultString = StringUtils.hasLength(ex.getMessage()) ? ex.getMessage() : ex.toString(); SoapBody body = response.getSoapBody(); SoapFault fault = body.addServerOrReceiverFault(faultString, getLocale()); customizeFault(messageContext, endpoint, ex, fault); return true; } }
fault = soapBody.addServerOrReceiverFault(faultStringOrReason, definition.getLocale());
fault = soapBody.addServerOrReceiverFault(faultStringOrReason, definition.getLocale());
fault = soapBody.addServerOrReceiverFault(faultStringOrReason, definition.getLocale());
fault = soapBody.addServerOrReceiverFault(faultStringOrReason, definition.getLocale());
soapFault = soapBody.addServerOrReceiverFault(replyMessage.getFaultString(), replyMessage.getLocale()); } else if (SoapFaultDefinition.CLIENT.equals(replyMessage.getFaultCodeQName()) ||
@Override protected void handleInvalidXmlException(HttpServletRequest req, HttpServletResponse res, Object handler, InvalidXmlException ex) throws Exception { WebServiceConnection connection = new MyHttpServletConnection(req, res); TransportContext previousTransportContext = TransportContextHolder.getTransportContext(); TransportContextHolder.setTransportContext(new DefaultTransportContext(connection)); try { MessageContext messageContext = new DefaultMessageContext(getMessageFactory().createWebServiceMessage(), getMessageFactory()); SoapBody soapBody = ((SoapMessage) messageContext.getResponse()).getSoapBody(); soapBody.addServerOrReceiverFault(getFaultString(ex), Locale.ENGLISH); connection.send(messageContext.getResponse()); } finally { TransportUtils.closeConnection(connection); TransportContextHolder.setTransportContext(previousTransportContext); } }