I have two route
in camel configuration
route1
<route>
<from uri="cxf:bean:soapProxy1?dataFormat=PAYLOAD" />
<setHeader headerName="CamelHttpMethod">
<constant>POST</constant>
</setHeader>
<setHeader headerName="Contents-type">
<constant>application/octet-stream</constant>
</setHeader>
<setHeader headerName="SOAPAction">
<constant>vc</constant>
</setHeader>
<setHeader headerName="Accept">
<constant>application/xml</constant>
</setHeader>
<to uri="bean:samlWsBean" />
<choice>
<when>
<simple>${in.header.isvalid} contains "true"</simple>
<to uri="cxf:bean:backendService?dataFormat=PAYLOAD"/>
</when>
<otherwise>
<to uri="velocity:file:///path/samlerrorresponse.vm"/>
</otherwise>
</choice>
</route>
route2
<route>
<from uri="cxf:bean:soapProxy2?dataFormat=PAYLOAD" />
<setHeader headerName="CamelHttpMethod">
<constant>POST</constant>
</setHeader>
<setHeader headerName="Contents-type">
<constant>application/octet-stream</constant>
</setHeader>
<setHeader headerName="SOAPAction">
<constant>vc</constant>
</setHeader>
<setHeader headerName="Accept">
<constant>application/xml</constant>
</setHeader>
<to uri="bean:samlWsBean" />
<choice>
<when>
<simple>${in.header.isvalid} contains "true"</simple>
<to uri="cxf:bean:backendService?dataFormat=PAYLOAD"/>
</when>
<otherwise>
<to uri="velocity:file:///path/samlerrorresponse.vm"/>
</otherwise>
</choice>
</route>
there is only one line difference in both two routes.
one have this
<from uri="cxf:bean:soapProxy1?dataFormat=PAYLOAD" />
another have this
<from uri="cxf:bean:soapProxy2?dataFormat=PAYLOAD" />
so can i put common body in some where else in configuration and refer in both routes?
When no one respond on my question i was start searching again online and I have found solution like this
and then you can invoke like this
for more help see this and this, hope this will may help someone else.