-
Bug
-
Resolution: Done
-
Major
-
6.0.1.Final
-
None
After sending a test SOAP request to (compiled) "Drools Camel server example" from "droolsjbpm-integration-master/drools-camel-server-example", running on JBoss7 application server, the following exception occurs:
...
java.lang.ClassCastException: org.apache.cxf.binding.soap.SoapMessage cannot be cast to java.lang.String
at org.kie.jax.soap.PreCxfTransportSoapProcessor.process(PreCxfTransportSoapProcessor.java:36) [kie-camel-6.0.1.Final.jar:6.0.1.Final]
...
I used the following patch (hack), to make the example work:
diff --git a/kie-camel/src/main/java/org/kie/jax/soap/PreCxfTransportSoapProcessor.java b/kie-camel/src/main/java/or
index c646f97..39e2afc 100644
— a/kie-camel/src/main/java/org/kie/jax/soap/PreCxfTransportSoapProcessor.java
+++ b/kie-camel/src/main/java/org/kie/jax/soap/PreCxfTransportSoapProcessor.java
@@ -33,8 +33,10 @@ public class PreCxfTransportSoapProcessor
Map<String, Object> headers = exchange.getIn().getHeaders();
MimeHeaders mimeHeaders = new MimeHeaders();
for ( String header : headers.keySet() ) {
- mimeHeaders.addHeader( header,
- (String) headers.get( header ) );
+ // hack for avoiding uncaught exceptions when SOAP message is typecast to string
+ try { mimeHeaders.addHeader( header, (String) headers.get( header ) );}
+ catch(ClassCastException e){}
+
}
SOAPMessage soapMessage = MessageFactory.newInstance().createMessage( mimeHeaders,
is );
It seems to me that the call to:
...
exchange.getIn().getHeaders()
...
apart from valid MIME headers, such as host, content-type etc also (wrongly?) returns the entire SOAP request object, which then cannot be typecast to string.