I'm calling my Webservices sample from a servlet and put the settings in several
places:
jboss-wsse-client.xml goes on within the web-inf
<jboss-ws-security
xmlns="http://www.jboss.com/ws-security/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
<key-store-file>E:\wsse\wsse.jks</key-store-file>
<key-store-password>senha_client</key-store-password>
<trust-store-file>E:\wsse\wsse.csr</trust-store-file>
<trust-store-password>senha_client</trust-store-password>
</jboss-ws-security>
in code
protected void executa() {
System.setProperty("org.jboss.ws.wsse.keyStore", "E:/wsse/wsse.jks"
);
System.setProperty("org.jboss.ws.wsse.keyStorePassword",
"senha_client" );
System.setProperty("org.jboss.ws.wsse.keyStoreType", "jks" );
System.setProperty("org.jboss.ws.wsse.trustStore", "E:/wsse/wsse.csr"
);
System.setProperty("org.jboss.ws.wsse.trustStorePassword",
"senha_client" );
System.setProperty("org.jboss.ws.wsse.trustStoreType", "jks" );
QName qName = new QName("http://coreo.com.br/teste", "Teste");
String serviceURL =
"http://jon.ctbc.com.br:8080/jbossWebServiceSecurity-1.0.0/Teste?wsdl";
Service service = null;
URL url;
url = new URL(serviceURL);
service = Service.create(url,qName);
ITeste s = service.getPort(ITeste.class);
((StubExt) s).setConfigName("Standard WSSecurity Client");
((BindingProvider) s).getRequestContext().put("org.jboss.ws.wsse.keyStore",
"e:\\wsse\\wsse.jks");
((BindingProvider)
s).getRequestContext().put("org.jboss.ws.wsse.keyStorePassword",
"senha_client");
((BindingProvider) s).getRequestContext().put("org.jboss.ws.wsse.keyStoreType",
"jks");
((BindingProvider) s).getRequestContext().put("org.jboss.ws.wsse.trustStore",
"E:\\wsse\\wsse.csr");
((BindingProvider)
s).getRequestContext().put("org.jboss.ws.wsse.trustStorePassword",
"senha_client");
((BindingProvider)
s).getRequestContext().put("org.jboss.ws.wsse.trustStoreType",
"jks");
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4224662#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...