Criar um projeto:
Fuse Integration Project > webservices > Runtime Fuse > Start with an empty project > Spring DSL
Copia o xml com os cabecalhos do CXF:
cp /home/rramalho/workspace/vale/resources/camel-cxf.xml
Criar a interface do webservice com.redhat.fuse.Hello :
@WebService
public interface Hello {
String hello(@WebParam(name="name") String name, @WebParam(name="surname") String surname);
}
Declarar o cxfEndpoint no camel-cxf.xml:
<cxf:cxfEndpoint id="hello" address="http://localhost:8000/hello" serviceClass="com.redhat.fuse.Hello" />
Construcão da rota:
<route id="_webservice">
<from id="_from1" uri="cxf:bean:hello"/>
<log id="_log1" message="ola ${body[0]} ${body[1]}"/>
<transform id="_return-message">
<simple>${body[0]} and ${body[1]} </simple>
</transform>
</route>
-
Deploy no Fuse
-
Criacao do projeto no SoapUI: http://localhost:8000/hello?wsdl
Route
<route id="_webservice">
<from id="_from1" uri="cxf:bean:hello"/>
<log id="_log1" message="ola ${body[0]} ${body[1]}"/>
<transform id="_return-message">
<simple>${body[0]} and ${body[1]} </simple>
</transform>
</route>
<route id="_from-wsdl">
<from id="_from2" uri="cxf://ContractFirst?dataFormat=PAYLOAD&wsdlURL=classpath:exemplo.wsdl"/>
<log id="_log2" message="consumindo ${body[0]} !"/>
<to id="_to1" uri="jms:queue:example?connectionFactory=pepe&username=admin&password=admin&disableReplyTo=true&jmsMessageType=Text"/>
</route>
Referências:
Camel in Action: https://github.com/camelinaction/camelinaction