camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ziemer, Tom" <>
Subject CAMEL-SOAP uses wrong namespace
Date Thu, 26 Sep 2013 06:45:43 GMT

I have an existing web-service-client (spring-ws+JAXB) that I want to replace with camel.
The XSD needed for this WS uses different namespaces for request/response and fault. While
trying to migrate to camel/camel-soap, I encountered the following problem:

Request/Response NS: "foo"
Fault NS: "bar"

public void configure() throws Exception {
        SoapJaxbDataFormat soap = new SoapJaxbDataFormat(Request.class.getPackage().getName());
//        soap.setVersion("1.2");
//        JaxbDataFormat soap = new JaxbDataFormat(Request.class.getPackage().getName());
            .setHeader(SOAP_ACTION, constant("baz"))
            .setHeader(Exchange.CONTENT_TYPE, constant(ContentType.create("text/xml", Consts.UTF_8).toString()))

If using the SoapJaxbDataFormat, the resulting xml looks like:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:Envelope xmlns:ns2="" xmlns:ns3="foo">
	<ns4:request xmlns:ns4="bar">
Which is incorrect, since the NS for request must be "foo". The XJC-generated request-class
I am using contains an @XmlRootElement annotation with the correct NS.

Out of curiosity, I tried JaxbDataFormat for marshalling, the result is correct and I receive:
<ns2:request xmlns:ns2="foo">

OS: Windows 7 / 64bit
Camel-Version: 2.12.1

Any help is appreciated.


View raw message