【发布时间】:2012-10-31 20:56:05
【问题描述】:
我正在尝试在服务器端和客户端使用签名来实现 Spring WS 安全性。
我在客户端和服务器配置中都添加了 WSS4J 拦截器。
但是,我收到一个异常,指出:未找到 WS-Security 标头。
我认为我需要在客户端的 SOAP 请求标头中添加一些安全信息。但是由于我的 wsdls 没有任何安全信息,所以 wsdlimport 工具不会生成任何特定于 header 的方法。
我查看了此链接:http://forum.springsource.org/archive/index.php/t-52204.html,但它无助于解决问题。
你能帮忙吗?
谢谢。
【问题讨论】:
-
您好,我的服务器配置是:
<bean id="wsDigCerSecurityInterceptor" class="org.springframework.ws.soap.security.wss4j.Wss4jSe curityInterceptor"> <property name="validationActions" value="Signature"/> <property name="validationSignatureCrypto"> <bean class="org.springframework.ws.soap.security.wss4j.support .CryptoFactoryBean"> <property name="keyStorePassword" value="123456"/> <property name="keyStoreLocation" value="classpath:/keystore.jks"/> </bean> </property> </bean> -
我的客户端配置是:
<bean id="wsDigCerSecurityInterceptor" class="org.springframework.ws.soap.security.wss4j.Wss4jSe curityInterceptor"> <property name="securementActions" value="Signature"/> <property name="securementUsername" value="MyCert"/> <property name="securementPassword" value="123456"/> <property name="securementSignatureCrypto"> <bean class="org.springframework.ws.soap.security.wss4j.support .CryptoFactoryBean"> <property name="keyStorePassword" value="123456"/> <property name="keyStoreLocation" value="classpath:/keystore.jks"/> </bean> </property> </bean> -
在此之后,我得到 No WS-Security header found 错误。我想我需要将安全信息添加到 SOAP 标头,但我不确定要添加什么以及如何添加?非常感谢您的帮助
-
keystore 是否既有私钥入口又有公钥证书?
-
已使用 keytool 生成密钥库。我不确定,但我认为它应该有私钥条目和公共证书密钥。
标签: java soap spring-security spring-ws