-
1. Re: Cleaner way to compose web services than setHeader (operationName & operationNamepace)?
davsclaus Oct 28, 2013 5:13 AM (in response to roybrumby)1 of 1 people found this helpfulI think you can set these as options on the uri as well using the defaultOperationName and defaultOperationNamespace names.
Though mind that when you invoke the 2nd cxf bean in the same route, the previous operation names etc may take precedence over the default options (I cant remember), if so you may still have to use the <setHeader> or you can remove the headers instead
<removeHeaders pattern="operation*"/>
http://camel.apache.org/how-to-avoid-sending-some-or-all-message-headers.html
-
2. Re: Cleaner way to compose web services than setHeader (operationName & operationNamepace)?
lekkie Nov 3, 2013 4:35 PM (in response to roybrumby)You can just do all your manipulations in a java bean, that way you have a neater code.
public class SOAPProcessor implements Processor
{
public void process(Exchange exchange)
{
exchange.getIn().setHeader("operationName", "ws1Op");
exchange.getIn().setHeader("operationNamespace", "http://ws1OpNS");
}
}
then you can have:
...
<from uri="cxf:bean:..."/>
<to uri="xslt://..."/>
<bean ref="soapProcessorBean" method="process"/>
<to uri="cxf:bean:ws1Bean..."/>
......
That should look neater.