camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandros Karypidis <>
Subject Newbie: convert XML Source object to a String in an "as-is" manner
Date Thu, 17 Dec 2009 10:00:03 GMT

I use conversion from an XML "Source" object to a "String" at some point 
in my route. The default conversion seems adds a new-line character 
after each element. This breaks my integration because in my case, the 
message is a SOAP envelope with WS-Security headers regarding a signed 

Is there a way to get around this? All I need is for the XML to become a 
"String" in an "as-is" manner (with no formatting). My current (Spring) 
configuration is:

    <camel-cfg:camelContext id="camelContext" trace="true" >
            <camel-cfg:from uri="cxf:bean:myWebServiceProvider" />
            <camel-cfg:convertBodyTo type="java.lang.String" />
            <camel-cfg:to uri="jms:queue:weblogic/my-Queue-0" />
            <camel-cfg:to uri="file:///fileEavesdropMSG-IN/" />

If I don't convert to String, the message doesn't get into the JMS 
queue. If  I do, the message's signature breaks...

Thanks in advance,

P.S. If it matters, the provider class (which uses Provider<Source>) 
looks like this:

@WebServiceProvider(targetNamespace = "...", serviceName = "...", 
portName = "...", wsdlLocation = "...")
@BindingType(value = HTTPBinding.HTTP_BINDING)
public class MyMessagingServiceProvider implements Provider<Source> {

View raw message