Why we are getting extra characters "n | " in request body XML?

Solution Verified - Updated -

Issue

We are migrating from JBoss Fuse 6.1 to 6.3 and we use camel-cxf rsServer endpoint to expose restful service. For instance:

<camelcxf:rsServer id="restService" address="/api" loggingFeatureEnabled="true"
           serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService" >
        <camelcxf:providers>
            <ref component-id="jsonProvider"/>
        </camelcxf:providers>
    </camelcxf:rsServer>

    <bean id="jsonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>

    <camelContext id="Customer.Rest.test" xmlns="http://camel.apache.org/schema/blueprint">
        <route>
            <from uri="cxfrs:bean:restService?bindingStyle=SimpleConsumer&amp;performInvocation=true" />
            <log message="Received: ${body}"/>
        </route>
    </camelContext>

Here is snippet of our service class:

...
@Path("/")
public class CustomerService {
...
    @POST
    @Path("/customer")
    @Consumes("application/xml")
    @Produces("application/xml")
    public Response addCustomer(String customer) {
        LOG.info("received a POST request on /customer with customer info: " + customer);
        // ... demo only, not doing any actual work here, just return the same request XML back ...
        return Response.ok(customer).build();
    }
...

And we use SoapUI client to send in following XML:

<Customer>
    <id>125</id>
    <name>Joe</name>
</Customer>

However, we are getting extra characters "n | " in request body XML:

<Customer>n  |     <id>125</id>n  |     <name>Joe</name>n  | </Customer>

It is causing problem to our message flow further down the camel route.

Here are our questions:
1. Why are we getting these extra characters "n | "?
2. Is it possible to get rid of them?

Environment

  • JBoss Fuse
    • 6.3

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.