복붙노트

[SPRING] Spring 3 (SWS2) : <context : component-scan>과 <sws : annotation-driven>의 차이점

SPRING

Spring 3 (SWS2) : 의 차이점

단 하나의 @Endpoint 주석이있는 클래스로 간단한 웹 서비스 Hello World 예제를 사용하려고하면 네임 스페이스를 사용할 때 끝점이 등록되지 않습니다.

그러나 일반적인 을 추가하면 모든 것이 잘 작동하고 엔드 포인트 클래스가 올바르게 등록됩니다. @Endpoint 주석에만 해당되며, 다른 모든 주석 (@RequestPayload, @ResponsePayload, @PayloadRoot)은 sws-namespace에 의해 예상대로 등록됩니다.

@Endpoint 어노테이션은이 네임 스페이스에서도 처리되지 않아야합니까?

<beans>
   <!-- works for all annotations except @Endpoint -->
    <sws:annotation-driven/>

    <!-- when activated, @Endpoint is registered correctly <context:component-scan/> -->
</beans>

해결법

  1. ==============================

    1.이것은 알려진 SWS 버그입니다 (https://jira.springsource.org/browse/SWS-702).

    이것은 알려진 SWS 버그입니다 (https://jira.springsource.org/browse/SWS-702).

  2. ==============================

    2.지금은 둘 다 같이 사용하십시오 :

    지금은 둘 다 같이 사용하십시오 :

    <context:component-scan base-package="com.coral.project.endpoints"/>
    
    <sws:annotation-driven marshaller="marshaller" unmarshaller="marshaller"/>
    

    @Endpoint와 @ PayloadRoot, @ ResponsePayload 주석을 모두 찾습니다. 이것은 그들이 Spring-WS 레퍼런스에서 당신이하도록 지시하는 방법이다 :

    http://static.springsource.org/spring-ws/sites/2.0/reference/html/tutorial.html#tutorial.implementing.endpoint

  3. from https://stackoverflow.com/questions/6198644/spring-3-sws2-difference-between-contextcomponent-scan-and-swsannotation by cc-by-sa and MIT license