2017-05-24 35 views
0

Apache CXF를 사용하여 외부 웹 서비스를 사용하는 Mule Application이 있습니다.Apache CXF 오류 인터셉터가 호출되지 않았습니다.

다음과 같이 오류 인터셉터를 등록하려고합니다. faultOutInterceptor이

 <cxf:proxy-client payload="body" doc:name="SOAP">   
      <!-- outgoing interceptor chain for the client and an incoming chain for the cxf server --> 
      <cxf:outFaultInterceptors> 
       <spring:ref bean="faultOutInterceptor" /> 
      </cxf:outFaultInterceptors> 
     </cxf:proxy-client> 
     <spring:bean id="faultOutInterceptor" name="faultOutInterceptor" class="mypackage.soap.FaultOutInterceptor"/> 

... SOAP 오류이 인터셉터를 발생합니다

public class FaultOutInterceptor extends AbstractSoapInterceptor { 

    private static final Logger log = LoggerFactory.getLogger(FaultOutInterceptor.class); 

    public FaultOutInterceptor() { 
     super(Phase.USER_LOGICAL); 
    } 

    @Override 
    public void handleMessage(SoapMessage m) throws Fault { 
     log.info("Start in Fault Interceptor"); 
     log.info("SoapMessage Interceptor" + m); 
     Fault fault = (Fault) m.getContent(Exception.class); 
     log.info("Received fault response from error: " + fault); 
    } 
} 

가 호출되지 않습니다. 분명히 다른 인터셉터가 호출되지만 불행히도 내 것이 아닙니다. 아래 로그를 참조하십시오 ...

DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Chain [email protected] was modified. Current flow: 
     setup [PolicyOutInterceptor, CopyAttachmentOutInterceptor] 
     pre-logical [OutputPayloadInterceptor, SoapHeaderOutFilterInterceptor] 
     post-logical [SoapPreProtocolOutInterceptor] 
     prepare-send [MessageSenderInterceptor] 
     pre-stream [AttachmentOutInterceptor, MuleProtocolHeadersOutInterceptor, StaxOutInterceptor, org.mule.module.cxf.transport.MuleUniversalConduit$2] 
     pre-protocol [MuleHeadersOutInterceptor] 
     write [SoapOutInterceptor] 
     marshal [BareOutInterceptor] 
     write-ending [SoapOutEndingInterceptor] 
     pre-stream-ending [StaxOutEndingInterceptor] 
     prepare-send-ending [MessageSenderEndingInterceptor] 

DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor [email protected] 
DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.bindi[email protected]4a09a8da 
DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor [email protected] 
DEBUG org.apache.cxf.phase.PhaseInterceptorChain - Invoking handleMessage on interceptor org.apache.cxf.inte[email protected]18c65fc3 

내가 잘못했을 수있는 사람을 도와 줄 사람이 있습니까?

감사

답변

0

난 당신이 Intercepter에 대신 같은 Intercepter 뭔가를 벗어난를 등록 할 필요가 있다고 생각 아래

<cxf:jaxws-client serviceClass="com.mulesoft.example.HelloWorld" 
    operation="sayHello" port="HelloWorldPort"> 
    <cxf:inInterceptors> 
     <spring:bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/> 
    </cxf:inInterceptors> 
</cxf:jaxws-client>