67.5.2. Web サービスサーバー
次のルートを使用すると、jms キュー customerServiceQueue をリッスンし、クラス CustomerServiceImpl を使用してリクエストを処理する Web サービスサーバーが設定されます。当然、customerServiceImpl はインターフェイス CustomerService を実装する必要があります。サーバークラスを直接インスタンス化する代わりに、Spring コンテキストで通常の Bean として定義できます。
SoapJaxbDataFormat soapDF = new SoapJaxbDataFormat("com.example.customerservice", new ServiceInterfaceStrategy(CustomerService.class));
CustomerService serverBean = new CustomerServiceImpl();
from("jms://queue:customerServiceQueue")
.onException(Exception.class)
.handled(true)
.marshal(soapDF)
.end()
.unmarshal(soapDF)
.bean(serverBean)
.marshal(soapDF);