2017-01-30 4 views
0

를 I가 AbstractSoapInterceptor을 연장 CXF 인터셉터로부터 메시지를 기록하려고하고 AbstractSoapInterceptor는 CXF 작동하지된다 cxfEndpoint

`<cxf:cxfEndpoint id="reportEndpoint" address="/report/" 
     serviceClass="com.shajeer.integration.helloworld.incident.IncidentService"> 
     <cxf:inInterceptors> 
      <bean id="inInterceptor" 
      class="com.shajeer.integration.helloworld.logging.LoggingInSetupInterceptor" /> 
     </cxf:inInterceptors> 
    </cxf:cxfEndpoint>` 

Blueprint.xml

체인

에 인터셉터 그런 인터셉터 추가 한

`import org.apache.cxf.binding.soap.SoapMessage; 
    import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor; 
    import org.apache.cxf.interceptor.Fault; 
    import org.apache.cxf.phase.Phase; 
    import org.slf4j.Logger; 
    import org.slf4j.LoggerFactory; 
    public class LoggingInSetupInterceptor extends AbstractSoapInterceptor{ 
    private static final Logger LOGGER = LoggerFactory.getLogger(LoggingInSetupInterceptor.class); 
     public LoggingInSetupInterceptor() { 
      super(Phase.PRE_INVOKE); 
     } 
     @Override 
     public void handleMessage(SoapMessage soapMessage) throws Fault { 
      System.out.println("In LoggingInSetupInterceptor :: LoggingInSetupInterceptor"); 
      LOGGER.info("In LoggingInSetupInterceptor :: LoggingInSetupInterceptor");  
     } 
    }` 

그러나 제어 흐름은 하야 요격기에 도착하여 낙타 상황에 직접 빠져 든다. 그 이유는 무엇일까요?

`xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"` 

답변

0

그것이 SOAP11 또는 SOAP12 아래의 미리보기 및 디버그

public void handleMessage(SoapMessage message) throws Fault { 
     if (message.getVersion() instanceof Soap11) { 
      Map<String, List<String>> headers = CastUtils.cast((Map)message.get(Message.PROTOCOL_HEADERS)); 
      if (headers != null) { 
       List<String> sa = headers.get("SOAPAction"); 
       if (sa != null && sa.size() > 0) { 
        String action = sa.get(0); 
        if (action.startsWith("\"")) { 
         action = action.substring(1, action.length() - 1); 
        } 
        getAndSetOperation(message, action); 
       } 
      } 
     } else if (message.getVersion() instanceof Soap12) { 

     } 
추가입니다 wheteher 메시지 버전이 무엇인지 확인하시기 바랍니다 CXF 네임 스페이스 선언
관련 문제