311.5. 다중 파트 메시지
Camel 2.8.1에서 사용 가능
다중 파트 SOAP 메시지는 ServiceInterfaceStrategy에서 지원됩니다. JAX-WS 2.2에 따라 주석이 추가되고 문서 베어 스타일의 요구 사항을 충족하는 서비스 인터페이스 정의를 사용하여 ServiceInterfaceStrategy를 초기화해야 합니다. target 메서드는 JAX-WS 사양에 따라 다음 기준을 충족해야 합니다. 1) 대부분의 in 또는 in/out non-header 매개 변수가 없는 경우 2) void 이외의 반환 유형이 있고 비 헤더 매개 변수가 없는 경우 3) 반환 유형이 하나 in/ 또는 out-header 매개 변수가 out 없는 경우 3) 반환 유형이 in/out 또는 out -header 매개 변수를 가지고 있어야 합니다.
매핑 전략이 요청 매개변수 또는 응답 매개변수에 적용되는지 여부를 나타내는 부울 매개 변수를 사용하여 ServiceInterfaceStrategy를 초기화해야 합니다.
ServiceInterfaceStrategy strat = new ServiceInterfaceStrategy(com.example.customerservice.multipart.MultiPartCustomerService.class, true);
SoapJaxbDataFormat soapDataFormat = new SoapJaxbDataFormat("com.example.customerservice.multipart", strat);311.5.1. 다중 파트 요청
다중 파트 요청에 대한 페이로드 매개변수는 대상 작업의 서명을 반영하는 BeanInvocation 오브젝트를 사용하여 initiazlied합니다. camel-soap DataFormat은 marshal() 프로세서가 호출될 때 JAX-WS 매핑에 따라 BeanInvocation 의 콘텐츠를 SOAP 헤더 및 본문의 필드에 매핑합니다.
BeanInvocation beanInvocation = new BeanInvocation();
// Identify the target method
beanInvocation.setMethod(MultiPartCustomerService.class.getMethod("getCustomersByName",
GetCustomersByName.class, com.example.customerservice.multipart.Product.class));
// Populate the method arguments
GetCustomersByName getCustomersByName = new GetCustomersByName();
getCustomersByName.setName("Dr. Multipart");
Product product = new Product();
product.setName("Multiuse Product");
product.setDescription("Useful for lots of things.");
Object[] args = new Object[] {getCustomersByName, product};
// Add the arguments to the bean invocation
beanInvocation.setArgs(args);
// Set the bean invocation object as the message body
exchange.getIn().setBody(beanInvocation);