Hi

I'm using camel-jaxb to generate XML, and it works fine except that I get
this unwanted namespace prefix "ns2":

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:payments xmlns:ns2="http://www.xxx.com/payments/0.0.1";>
    <ns2:response>
        <ns2:merchantId>40000001</ns2:merchantId>
        <ns2:terminalId>12345</ns2:terminalId>
        <ns2:transactionTime>2012-03-20T15:00:05</ns2:transactionTime>
        <ns2:amount>291</ns2:amount>
        <ns2:currency>NOK</ns2:currency>

<ns2:terminalReferenceNumber>123456789012</ns2:terminalReferenceNumber>
        <ns2:stan>65432</ns2:stan>
        <ns2:batchId>123</ns2:batchId>
        <ns2:responseCode>91</ns2:responseCode>
    </ns2:response>
</ns2:payments>

Is there a way to avoid that?

My route essentially looks like this:

jaxb = new JaxbDataFormat();
jaxb.setContextPath("com.xxx.payment");
jaxb.setPrettyPrint(true);

from(source)
    .routeId(routeId)
    .routePolicy(routePolicy)
    .unmarshal(jaxb)
    .bean(converter, "createRequest")
    .inOut(processor)
    .bean(converter,"createPaymentXMLResponse")
    .marshal(jaxb).convertBodyTo(String.class, "UTF-8");

Thanks,
Thomas

Reply via email to