Java soapweb服务与Spring安全

Java soapweb服务与Spring安全,java,spring-security,soapui,Java,Spring Security,Soapui,我正在尝试使用SpringSecurity3保护SOAP web服务 这是我的配置: <jee:jndi-lookup id="dataSource" jndi-name="jdbc/myDB" expected-type="javax.sql.DataSource" /> <http authentication-manager-ref="authenticationManager"> <intercept-url pattern="

我正在尝试使用SpringSecurity3保护SOAP web服务

这是我的配置:

<jee:jndi-lookup id="dataSource" jndi-name="jdbc/myDB"
         expected-type="javax.sql.DataSource" />

<http authentication-manager-ref="authenticationManager">
     <intercept-url pattern="/**" access="ROLE_USER" requires-channel="https" />
     <http-basic />
     <logout logout-url="/logout" delete-cookies="JSESSIONID" />
</http>

<authentication-manager id="authenticationManager">
   <authentication-provider>
      <jdbc-user-service data-source-ref="dataSource" />
   </authentication-provider>
</authentication-manager>

Tomcat配置为SSL,使用包含服务器私钥的密钥库。我正在用SOAPUI测试web服务。我已经创建了一个执行服务提供的操作之一的请求。在Auth部分,我根据数据库中的值添加了测试用户的用户名和密码。发送请求后,我希望创建一个会话,并且不需要再次验证。在HTTP响应中,存在JSESSIONID cookie。当一个网站受到相同机制的保护时,用户只需输入一次其凭据,直到其会话到期时才需要重新验证

我的配置有什么问题



编辑:我忘了补充一点,当我多次重新发送同一请求时,收到的JSESSIONID cookie总是有一个不同的值。我是否应该期望给定会话的情况相同?

在TestCase选项下,您需要打开“维护HTTP会话”选项。不幸的是,您必须对每个测试用例分别执行此操作,没有全局选项。

SoapUI是否正确地发送回cookie?@artbristol似乎为SoapUI发送的每个消息生成了一个新的JSESSIONID cookie。我不知道为什么。那是因为SoapUI没有在每个新请求中返回原始cookie。