312.6.2. WebService 서버

다음 경로를 사용하면 jms 대기열 customerServiceQueue에서 수신 대기하는 웹 서비스 서버를 설정하고 CustomerServiceImpl 클래스를 사용하여 요청을 처리합니다. CustomerServiceImpl은 CustomerService 인터페이스를 구현해야 합니다. 서버 클래스를 직접 인스턴스화하는 대신 스프링 컨텍스트에서 일반 빈으로 정의할 수 있습니다.

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);