You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2017/04/04 13:31:50 UTC
camel git commit: CAMEL-11099: Resolve issue caused by unresolve
elements hanging off the faul detail
Repository: camel
Updated Branches:
refs/heads/master 8cace478c -> d82e585d9
CAMEL-11099: Resolve issue caused by unresolve elements hanging off the faul detail
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d82e585d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d82e585d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d82e585d
Branch: refs/heads/master
Commit: d82e585d932b8454ba0ff03f80ba97cc7a7e2736
Parents: 8cace47
Author: Daniel Fullarton <da...@nab.com.au>
Authored: Mon Apr 3 09:32:13 2017 +1000
Committer: Zoran Regvart <zr...@apache.org>
Committed: Tue Apr 4 15:30:11 2017 +0200
----------------------------------------------------------------------
.../dataformat/soap/Soap11DataFormatAdapter.java | 14 ++++++++++++--
.../dataformat/soap/Soap12DataFormatAdapter.java | 14 ++++++++++++--
2 files changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/d82e585d/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/Soap11DataFormatAdapter.java
----------------------------------------------------------------------
diff --git a/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/Soap11DataFormatAdapter.java b/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/Soap11DataFormatAdapter.java
index d9866ad..40befc9 100644
--- a/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/Soap11DataFormatAdapter.java
+++ b/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/Soap11DataFormatAdapter.java
@@ -199,8 +199,18 @@ public class Soap11DataFormatAdapter implements SoapDataFormatAdapter {
throw new RuntimeCamelException(e);
}
}
-
- JAXBElement<?> detailEl = (JAXBElement<?>) faultDetail.getAny().get(0);
+
+ Object detailObj = faultDetail.getAny().get(0);
+
+ if (!(detailObj instanceof JAXBElement)) {
+ try {
+ return new SOAPFaultException(SOAPFactory.newInstance().createFault(message, fault.getFaultcode()));
+ } catch (SOAPException e) {
+ throw new RuntimeCamelException(e);
+ }
+ }
+
+ JAXBElement<?> detailEl = (JAXBElement<?>) detailObj;
Class<? extends Exception> exceptionClass = getDataFormat().getElementNameStrategy().findExceptionForFaultName(detailEl.getName());
Constructor<? extends Exception> messageConstructor;
Constructor<? extends Exception> constructor;
http://git-wip-us.apache.org/repos/asf/camel/blob/d82e585d/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/Soap12DataFormatAdapter.java
----------------------------------------------------------------------
diff --git a/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/Soap12DataFormatAdapter.java b/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/Soap12DataFormatAdapter.java
index c16642e..2397935 100644
--- a/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/Soap12DataFormatAdapter.java
+++ b/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/Soap12DataFormatAdapter.java
@@ -215,8 +215,18 @@ public class Soap12DataFormatAdapter implements SoapDataFormatAdapter {
throw new RuntimeCamelException(e);
}
}
-
- JAXBElement<?> detailEl = (JAXBElement<?>) faultDetail.getAny().get(0);
+
+ Object detailObj = faultDetail.getAny().get(0);
+
+ if (!(detailObj instanceof JAXBElement)) {
+ try {
+ return new SOAPFaultException(SOAPFactory.newInstance().createFault(message, fault.getCode().getValue()));
+ } catch (SOAPException e) {
+ throw new RuntimeCamelException(e);
+ }
+ }
+
+ JAXBElement<?> detailEl = (JAXBElement<?>) detailObj;
Class<? extends Exception> exceptionClass = getDataFormat().getElementNameStrategy().findExceptionForFaultName(detailEl.getName());
Constructor<? extends Exception> messageConstructor;
Constructor<? extends Exception> constructor;