强制使用https而不是http与spring-ws

时间:2014-09-18 17:19:20

标签: spring web-services spring-ws

当客户端尝试使用spring-ws连接到服务器时,如何强制http连接使用https?我已经看到一些使用WebSecurityConfigurerAdapter的示例,但是基于注释(没有XML配置文件存在)spring-ws的最佳方法是什么?

2 个答案:

答案 0 :(得分:1)

这实际上取决于您运行Spring-WS的容器。例如,在Tomcat中,您必须在web.xml中添加security constraint

答案 1 :(得分:0)

实际上我最终使用Spring EndpointInterceptors来实现这一目标。以下是我提到的一个例子:http://spring-webservice-2-step-by-step.blogspot.com/2011/12/spring-web-services-20-step-by-step.html