THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
SoapJaxbDataFormat soapsoapDF = new SoapJaxbDataFormat("com.example.customerservice", new ServiceNameStrategy(CustomerService.class)); from("direct:customerServiceClient") .onException(Exception.class) .handled(true) .unmarshal(soapsoapDF) .end() .marshal(soapsoapDF) .to("http://myserver/customerservice") .unmarshal(soapDataFormatsoapDF); |
Webservice Server
Using the following route sets up a webservice server that listens on jms queue customerServiceQueue and processes requests using the class CustomerServiceImpl. The customerServiceImpl of course should implement the interface CustomerService. Instead of directly instantiating the server class it could be defined in a spring context as a regular bean.
Code Block |
---|
SoapJaxbDataFormat soapsoapDF = new SoapJaxbDataFormat("com.example.customerservice", new ServiceNameStrategy(CustomerService.class)); CustomerService serverBean = new CustomerServiceImpl(); from("jms://queue:customerServiceQueue") .onException(Exception.class) .handled(true) .marshal(soapsoapDF) .end() .unmarshal(soapsoapDF) .bean(serverBean) .marshal(soapDataFormatsoapDF); |
Dependencies
To use the SOAP dataformat in your camel routes you need to add the following dependency to your pom.
...