Soap 无效属性';securementCallbackHandlers';在春季,ws 2.2.1
我使用SpringWS(Soap)创建Web服务 现在,我想创建加密web服务。 我的applicationContext.xml是:Soap 无效属性';securementCallbackHandlers';在春季,ws 2.2.1,soap,spring-ws,encryption-symmetric,wss4j,Soap,Spring Ws,Encryption Symmetric,Wss4j,我使用SpringWS(Soap)创建Web服务 现在,我想创建加密web服务。 我的applicationContext.xml是: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:web-services="h
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:web-services="http://www.springframework.org/schema/web-services"
xsi:schemaLocation="http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="webserviceTemplate"
class="org.springframework.ws.client.core.WebServiceTemplate">
<constructor-arg ref="messageFactory" />
<property name="defaultUri" value="http://localhost:8081/surena/signauthenticateservice/"/>
<property name="interceptors">
<bean class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
<property name="securementActions" value="Encrypt"/>
<property name="securementEncryptionKeyIdentifier" value="EmbeddedKeyName"/>
<property name="securementEncryptionUser" value="symmetric"/>
<property name="securementEncryptionEmbeddedKeyName" value="symmetric"/>
<property name="SecurementEncryptionSymAlgorithm" value="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
<property name="securementCallbackHandlers">
<bean class="org.springframework.ws.soap.security.wss4j.callback.KeyStoreCallbackHandler">
<property name="symmetricKeyPassword" value="keyPassword"/>
<property name="keyStore">
<bean class="org.springframework.ws.soap.security.support.KeyStoreFactoryBean">
<property name="location" value="/symmetricStore.jks"/>
<property name="type" value="JCEKS"/>
<property name="password" value="symmetricPassword"/>
</bean>
</property>
</bean>
</property>
</bean>
</property>
</bean>
<bean id="log4jInitialization" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetClass" value="org.springframework.util.Log4jConfigurer" />
<property name="targetMethod" value="initLogging" />
<property name="arguments">
<list>
<value>src/test/resources/log4j.properties</value>
</list>
</property>
</bean>
<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"/>
我得到了SpringWebServices2Cookbook的帮助。
但本书使用SpringWebService1.5,但我使用SpringWebService2.2.1,(我在服务器端的SpringBootWebService1.2.5中创建web服务)
能帮我吗?我遇到了同样的错误。本质上,这个属性是在SpringWS的2.0.3之后的某个时候被删除的,当时他们决定升级到ApacheWSS4J 1.6,并且他们不知道如何在安全操作上创建回调处理程序。所以他们基本上只是删除了它,没有任何警告或解释,也没有更新他们的文档 典型的春季运动。他们将其标记为2.3版的“功能改进” 幸运的是,在这之前,那里有人发布了一个潜在的解决方案。他正在创建自己的安全回调处理程序类和添加此属性的自定义Wss4JSecurityInterceptor类。这是值得研究的
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'securementCallbackHandlers' of bean class [org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor]: Bean property 'securementCallbackHandlers' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1076)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:927)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:95)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1510)
... 50 more