如何解决Spring 3SWS2:<context:component-scan>和<sws:annotation-driven>之间的区别
| 当尝试一个仅带有一个带注释的“ 0”类的简单Web Service Hello World示例时,使用“ 1”命名空间时不会注册端点。 但是,通过添加通常的“ 2”,一切正常,可以正确注册Endpoint类。 这仅对于@Endpoint
注释正确,所有其他注释(@RequestPayload
,@ResponsePayload
,@PayloadRoot
)将按预期由sws-namespace注册。
namespace0ѭ注释是否也不能由该命名空间处理?
<beans>
<!-- works for all annotations except @Endpoint -->
<sws:annotation-driven/>
<!-- when activated,@Endpoint is registered correctly <context:component-scan/> -->
</beans>
解决方法
这是一个已知的SWS错误:https://jira.springsource.org/browse/SWS-702。
, 现在,两者都用于:
<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
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。