我正在使用axis2和rampart1.6.2来创建webservice客户端。我需要设置rampart才能使用用户名令牌,只是为了对消息进行签名,而不是加密,但是wallart无需任何理由加密用户名令牌,我无法禁用此错误功能。
我使用的是ws-security1.0。
我的城墙政策文件:
<wsp:Policy wsu:Id="RampartPolicy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsp:ExactlyOne>
<wsp:All>
<ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
<ramp:user>User</ramp:user>
<ramp:userCertAlias>user</ramp:userCertAlias>
<ramp:encryptionUser>User</ramp:encryptionUser>
<ramp:passwordType>PasswordText</ramp:passwordType>
<ramp:passwordCallbackClass>main.PWCBHandler</ramp:passwordCallbackClass>
<ramp:signatureCrypto>
<ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin" enableCryptoCaching="false">
<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
<ramp:property name="org.apache.ws.security.crypto.merlin.file">cert.jks</ramp:property>
<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">*****</ramp:property>
</ramp:crypto>
</ramp:signatureCrypto>
</ramp:RampartConfig>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>