INT-993 unwrapping Exceptions for inbound Web Service gateways

This commit is contained in:
Mark Fisher
2010-04-15 22:14:23 +00:00
parent c0b1cd6517
commit a2be1fccad
2 changed files with 24 additions and 2 deletions

View File

@@ -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;
}
}

View File

@@ -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.");