Thank for the reply.
But i have read that in Message mode you cannot access the soap headers as
they are dropped after being processed. I need the soap header's to generate
another request by changing the body. I hope that makes sense. If there is a
way that i can achieve this with Message mode let me know.

I am using the pojo mode right now but unable to get any response throws a
java.lang.IllegalStateException: REDISPATCHED,resumed and 
org.apache.cxf.binding.soap.SoapFault: Error writing to XMLStreamWriter. 

Here is how i have defined my route

public void configure() throws Exception {


logger.debug("Adding routes found in " + this.getClass().getName());
getContext().setHandleFault(true);
from("cxf:bean:releasePOEndpoint").handleFault()

.to("log:incoming?showAll=true")
.process(new Processor() {

public void process(Exchange exchange) throws Exception {

logger.info("processing exchange in camel");
BindingOperationInfo boi = (BindingOperationInfo) 

exchange.getProperty(BindingOperationInfo.class.toString());

if (boi != null) {

logger.info("boi.isUnwrapped" + boi.isUnwrapped());

}

if (exchange != null){

Message in = exchange.getIn();

logger.info("#####Exchange body"+in.getBody().toString());

in.setBody(in.getBody(String.class));

}}})

.to("mock:end");

}}

and this is how i am trying to test it

eleasePurchaseOrderRequestType request = new
ReleasePurchaseOrderRequestType();

request.setPurchaseOrderId(602562);

request.setContactId(2970);



request.setLastKnownUpdateTimestamp(xmlGregorianCalendar);


MockEndpoint quote = getMockEndpoint("mock:end");

quote.expectedMessageCount(1);


Exchange senderExchange = new DefaultExchange(context,
ExchangePattern.InOut);


senderExchange.getIn().setBody(request);

senderExchange.getIn().setHeader(CxfConstants.OPERATION_NAME,
"releasePurchaseOrder");



Exchange exchange = template.send("cxf:bean:releasePOEndpoint",
senderExchange);



org.apache.camel.Message out = exchange.getOut();

if (out != null) {

logger.info("Received output text: " + out.getBody());

Map<String, Object> responseContext = CastUtils.cast((Map)
out.getHeader(Client.RESPONSE_CONTEXT));

logger.info("Map: " + responseContext);

assertNotNull(responseContext);

But I getting no result i.e no message to the mock:end. 
Can u tell me whats going wrong?


--
View this message in context: 
http://camel.465427.n5.nabble.com/Testing-a-camel-route-in-context-with-cxfendpoint-tp3546861p3555830.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to