Pessoal,
estou criando um servidor web onde todas as mensagens enviadas precisam ser assinadas. Pesquisem bastante na web e estou seguindo o tutorial da documentação oficial do JbossWS 4 (Estou suando JBOSS 7.1.1 com JBossWS 4 - JbossWS-CXF), mas mesmo assim continuo recebendo o erro abaixo:
Caused by: org.apache.ws.security.WSSecurityException: General security error (WSSecurityEngine: No crypto property file supplied to verify signature)
Alguem ja passou por um problema parecido?
No cliente, faco a chamada inserindo os valores do ws-security da seguinte forma:
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("br/com/projeto/service/client/dilma.properties"));
//workaround CXF requiring this even if no encryption is configured
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("br/com/projeto/service/client/dilma.properties"));
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_USERNAME, "teste");
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_USERNAME, "teste");
O arquivo de propriedades possui os seguintes valores:
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=1234
org.apache.ws.security.crypto.merlin.keystore.alias=teste
org.apache.ws.security.crypto.merlin.keystore.file=br/com/projeto/service/client/keystore.jks
No lado do servidor o webservice está da seguinte forma:
@WebService
(
portName = "SecurityServicePort",
serviceName = "SecurityService",
wsdlLocation = "WEB-INF/wsdl/contratoSecurity.wsdl",
targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity"
)
@EndpointProperties(value = {
@EndpointProperty(key = "ws-security.signature.properties", value = "br/com/projeto/service/client/dilma.properties"),
@EndpointProperty(key = "ws-security.encryption.properties", value = "br/com/projeto/service/client/dilma.properties"),
@EndpointProperty(key = "ws-security.signature.username", value = "teste"),
@EndpointProperty(key = "ws-security.encryption.username", value = "teste"),
@EndpointProperty(key = "ws-security.callback-handler", value = "br.com.projeto.service.KeystorePasswordCallback")
}
)
Valeu pessoal, se puderem ajudar com alguma dica!
abs!