2012-10-26 7 views
0

표준 eclipse java 프로젝트에서 cxf.xml 구성 파일의 올바른 위치는 어디입니까? 독립형 jar 형식의 클라이언트 ws 소비자에서 로깅 비누 메시지를 사용하려면 노력하고있어. wsdltojava 유틸리티를 사용하여 산출물을 생성하고 자동 생성 된 시작 지점 테스트 클라이언트를 사용하여 실제로 작동합니다. 설명서마다 설정 파일을 만들었지 만, 내 회의에서는 아무 일도 일어나지 않습니다.CXF : 비누 메시지를 로깅 할 수 없습니다

<beans xmlns="http://www.springframework.org/schema/beans" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:cxf="http://cxf.apache.org/core" 
     xsi:schemaLocation=" 
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> 

<bean id="abstractLoggingInterceptor" abstract="true"> 
    <property name="prettyLogging" value="true"/> 
</bean> 
<bean id="loggingInInterceptor" class="org.apache.cxf.interceptor.LoggingInInterceptor" parent="abstractLoggingInterceptor"/> 
<bean id="loggingOutInterceptor" class="org.apache.cxf.interceptor.LoggingOutInterceptor" parent="abstractLoggingInterceptor"/> 

<cxf:bus> 
    <cxf:inInterceptors> 
     <ref bean="loggingInInterceptor"/> 
    </cxf:inInterceptors> 
    <cxf:outInterceptors> 
     <ref bean="loggingOutInterceptor"/> 
    </cxf:outInterceptors> 
    <cxf:outFaultInterceptors> 
     <ref bean="loggingOutInterceptor"/> 
    </cxf:outFaultInterceptors> 
    <cxf:inFaultInterceptors> 
     <ref bean="loggingInInterceptor"/> 
    </cxf:inFaultInterceptors> 
</cxf:bus> 

</beans> 

내가 프로젝트 루트와 SRC 아무것도하지만, 아래에 넣어 시도 : 이 내 cxf.xml 파일 내용입니다. 내가 뭘 놓치고있어?

공공 최종 클래스 ClientMHttps {

private static final QName SERVICE_NAME = new  QName("http://thecompany/service-b", "myendpoint-v1"); 

private myendpointPortType port ; 

public ClientMHttps() throws java.lang.Exception { 
    URL wsdlURL = myendpointV1.WSDL_LOCATION; 

    myendpointV1 ss = new myendpointV1(wsdlURL, SERVICE_NAME); 
    port = ss.getmyendpointPortTypeEndpointHttpsM(); 




} 

    public DeleteMarkedStatusResponse do_DeleteMarkedStatus(DeleteMarkedStatusRequest _deleteMarkedStatus_body) throws java.lang.Exception 
    { 
    System.out.println("Invoking deleteMarkedStatus..."); 
    javax.xml.ws.Holder<HeaderType> _header = this.HeaderFarm(); 
    DeleteMarkedStatusResponse _deleteMarkedStatus__return = port.deleteMarkedStatus(_deleteMarkedStatus_body, _header); 
    System.out.println("deleteMarkedStatus.result=" + _deleteMarkedStatus__return); 
    return _deleteMarkedStatus__return; 


    } 

답변

0

난 그냥 빈 이름 고정 될 필요가있는 cxf.xml 위치입니다 믿습니다

내 클라이언트 코드는 같다.

<jaxws:client> 요소가 귀하의 봄 구성 파일에 추가해야
<beans xmlns="http://www.springframework.org/schema/beans" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:cxf="http://cxf.apache.org/core" 
     xsi:schemaLocation=" 
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> 

    <bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor"/> 
    <bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> 

    <cxf:bus> 
     <cxf:inInterceptors> 
      <ref bean="logInbound"/> 
     </cxf:inInterceptors> 
     <cxf:outInterceptors> 
      <ref bean="logOutbound"/> 
     </cxf:outInterceptors> 
     <cxf:outFaultInterceptors> 
      <ref bean="logOutbound"/> 
     </cxf:outFaultInterceptors> 
     <cxf:inFaultInterceptors> 
      <ref bean="logInbound"/> 
     </cxf:inFaultInterceptors> 
    </cxf:bus> 
</beans> 
+0

절대! 내가 cxf.xml everyware하지만 나던 작업을 이동하려! 서블릿이 아닌 독립 실행 형 클라이언트를 만들었 음을 명심하십시오. 따라서 src 아래에 앱 패키지 (it.bla.etc)가 있습니다. – Muflo

+0

또한 독립 실행 형 클라이언트가 있고 잘 기록됩니다. cxf.xml을 src/main/resources /로 이동하려고 했습니까? 폴더를 만들고 파일을 저장 한 다음 로그해야합니다. –

+0

나는 그것을했지만 아무것도하지 않았다. 비누 메시지 로깅은 기본 로그 수준과 관련이 있습니까? 로그 로깅 기능의 내 로깅 수준이 FINE으로 설정되었습니다. – Muflo

0

(CXF : 모든 CXF 메시지를 기록하기 위해이 같은 cxf.xml 파일을 사용할 수 있습니다 SRC/메인/자원/cxf.xml에서

CXF 웹 서비스 클라이언트를 생성합니다. 그런 다음 코드에서이 클라이언트 bean을 사용하여 웹 서비스를 호출해야합니다.

사용하려는 로깅 프레임 워크에 따라 META-INF/cxf/org.apache.cxf.Loggerhere과 같이 구성해야 할 수 있습니다.

좀 더 자세히 log4j, logback 또는 log4j2을 위해 CXF를 구성하는 방법을 설명하는 블로그 게시물을 만들었습니다.

덜 장황한 CXF 로깅 기능을 사용할 수도 있습니다.

0

'org.apache.cxf.services'에 대한 필터를 추가하십시오.

<logger level="INFO" name="org.apache.cxf.services"/> 

로깅은 구현 서비스 클래스의 패키지가 아니라 사용자 정의 위치에서 생성됩니다.

관련 문제