324.10. 사용자 정의 헤더 및 첨부 파일 필터링
헤더 또는 첨부 파일의 사용자 지정 처리를 제공해야 하는 경우 기존 BasicMessageFilter를 확장하고 적절한 메서드를 재정의하거나 MessageFilter 인터페이스의 새로운 구현을 작성합니다.
사용자 정의 필터를 사용하려면 Spring 컨텍스트에 추가합니다.
글로벌 a 또는 로컬 메시지 필터를 다음과 같이 지정할 수 있습니다. a) 모든 Spring-WS 끝점에 대한 글로벌 구성을 제공하는 글로벌 사용자 정의 필터
<bean id="messageFilter" class="your.domain.myMessageFiler" scope="singleton" />
또는 다음과 같이 끝점에서 직접 로컬 messageFilter를 사용합니다.
to("spring-ws:http://yourdomain.com?messageFilter=#myEndpointSpecificMessageFilter");
자세한 내용은 CAMEL-5724에서 참조하십시오.
자체 MessageFilter를 만들려면 기본 구현의 MessageFilter 클래스 BasicMessageFilter에서 다음 메서드를 재정의하는 것이 좋습니다.
protected void doProcessSoapHeader(Message inOrOut, SoapMessage soapMessage) {your code /*no need to call super*/ } protected void doProcessSoapAttachements(Message inOrOut, SoapMessage response) { your code /*no need to call super*/ }