use of org.apache.camel.converter.jaxb.JaxbDataFormat in project camel by apache.
the class JaxbDataFormatIssueTest method createRouteBuilder.
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
JaxbDataFormat jaxb = new JaxbDataFormat(JAXBContext.newInstance(Foo.class));
jaxb.setPrettyPrint(false);
from("direct:start").marshal(jaxb).to("log:xml", "mock:result");
}
};
}
use of org.apache.camel.converter.jaxb.JaxbDataFormat in project camel by apache.
the class CamelJaxbNoNamespaceSchemaTest method createRouteBuilder.
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
JaxbDataFormat dataFormat = new JaxbDataFormat("org.apache.camel.foo.bar");
dataFormat.setNoNamespaceSchemaLocation("person-no-namespace.xsd");
dataFormat.setIgnoreJAXBElement(false);
from("direct:marshal").marshal(dataFormat).to("mock:result");
}
};
}
use of org.apache.camel.converter.jaxb.JaxbDataFormat in project camel by apache.
the class UnmarshalTest method createRouteBuilder.
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
DataFormat jaxb = new JaxbDataFormat("org.apache.camel.example");
from("direct:start").unmarshal(jaxb).to("mock:result");
}
};
}
use of org.apache.camel.converter.jaxb.JaxbDataFormat in project quickstarts by jboss-switchyard.
the class GreetingServiceRoute method configure.
@Override
public void configure() throws Exception {
JaxbDataFormat jxb = new JaxbDataFormat(JAXBContext.newInstance("org.switchyard.quickstarts.camel.jaxb"));
from("switchyard://GreetingService").convertBodyTo(String.class).unmarshal(jxb).process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
GreetingRequest rq = exchange.getIn().getBody(GreetingRequest.class);
GreetingResponse rp = new GreetingResponse("Ola " + rq.getName() + "!");
SwitchYardMessage out = new SwitchYardMessage();
out.setBody(rp);
exchange.setOut(out);
}
}).marshal(jxb).convertBodyTo(String.class);
}
use of org.apache.camel.converter.jaxb.JaxbDataFormat in project camel by apache.
the class IncrementRoute method configure.
@Override
public void configure() throws Exception {
JaxbDataFormat jaxb = new JaxbDataFormat(IncrementRequest.class.getPackage().getName());
from("spring-ws:rootqname:{http://camel.apache.org/example/increment}incrementRequest?endpointMapping=#endpointMapping").unmarshal(jaxb).process(new IncrementProcessor()).marshal(jaxb);
}
Aggregations