You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by at...@free.fr on 2011/09/08 10:39:09 UTC
XML to JAVADSL problem : The message between the enpoint and a consumer is empty
Hello,
I m beginning with camel development.
Im trying to create a Webservice proxy on tomcat.
Firstly I created the proxy with spring xml configuration
<cxf:cxfEndpoint id="proxy"
address="http://localhost:8080/ws-proxy/webservices/proxy"
endpointName="s:WSProxyEndpointPort"
serviceName="s:WSProxyEndpointService"
wsdlURL="/wsdl/ws-proxy.wsdl"
xmlns:s="http://wsproxy.domain"/>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="cxf:bean:proxy?dataFormat=MESSAGE" />
<!-- log input received -->
<to uri="log:input"/>
<to uri="http://myrealendpoint/TokenWS"/>
<to uri="log:output?showAll=true"/>
</route>
</camelContext>
It works fine.
However, when I want to translate this route on a java dsl, the message is not correctly transmitted between the proxy and the real webservice
public class ProxyRouteBuilder extends RouteBuilder {
/**
* Lets configure the Camel routing rules using Java code...
*/
public void configure() {
// getContext().addInterceptStrategy(new Tracer());
getContext().getProperties().put(Exchange.LOG_DEBUG_BODY_STREAMS, "true");
from("cxf:bean:proxy?dataFormat=MESSAGE").to("http://sr037272cti3700:8180/gawebrc/TokenWS?bridgeEndpoint=true&throwExceptionOnFailure=false");
}
}
<bean id="proxyroutebuilder" class="fr.sihm.commons.wsproxy.ProxyRouteBuilder" />
<camelContext xmlns="http://camel.apache.org/schema/spring">
<routeBuilder ref="proxyroutebuilder" />
</camelContext>
Unfortunately, this java code above fails. I have the following error
<faultstring>org.xml.sax.SAXParseException: Premature end of file.</faultstring>
What's wrong?
Thanks in advance for your help.
Regards
Alexandre Touret