Hi,
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"
Route:
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());
from("direct:someService")
.marshal(soap)
.setHeader(SOAP_ACTION, constant("baz"))
.setHeader(Exchange.CONTENT_TYPE,
constant(ContentType.create("text/xml", Consts.UTF_8).toString()))
.to(wsUrl)
.unmarshal(soap)
}
If using the SoapJaxbDataFormat, the resulting xml looks like:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:Envelope xmlns:ns2="http://www.w3.org/2003/05/soap-envelope"
xmlns:ns3="foo">
<ns2:Body>
<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">
Environment:
OS: Windows 7 / 64bit
Camel-Version: 2.12.1
JDK6
Any help is appreciated.
Regards,
Tom