diff --git a/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java b/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java index d42bc73a1e..cd767157a0 100644 --- a/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java +++ b/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -109,7 +109,16 @@ public class MarshallingWebServiceInboundGateway extends AbstractMarshallingPayl @Override protected Object invokeInternal(Object requestObject) throws Exception { - return this.gatewayDelegate.sendAndReceive(requestObject); + try { + return this.gatewayDelegate.sendAndReceive(requestObject); + } + catch (Exception e) { + while (e.getClass().getName().startsWith("org.springframework") && + e.getCause() instanceof Exception) { + e = (Exception) e.getCause(); + } + throw e; + } } diff --git a/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceInboundGateway.java b/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceInboundGateway.java index 043729a930..362cbdcb3a 100644 --- a/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceInboundGateway.java +++ b/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceInboundGateway.java @@ -55,6 +55,19 @@ public class SimpleWebServiceInboundGateway extends SimpleMessagingGateway imple } public void invoke(MessageContext messageContext) throws Exception { + try { + this.doInvoke(messageContext); + } + catch (Exception e) { + while (e.getClass().getName().startsWith("org.springframework") && + e.getCause() instanceof Exception) { + e = (Exception) e.getCause(); + } + throw e; + } + } + + private void doInvoke(MessageContext messageContext) throws Exception { Assert.notNull(messageContext,"'messageContext' is required; it must not be null."); WebServiceMessage request = messageContext.getRequest(); Assert.notNull(request, "Invalid message context: request was null.");