[jboss-user] [JBossWS] - Re: WS-Security client?

kadlecp do-not-reply at jboss.com
Thu Jul 19 03:40:37 EDT 2007


Hello, my WS-Security client looks like this. It works.

public class TestClient {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {
		
		BasicConfigurator.configure();

		System.setProperty("org.jboss.ws.wsse.keyStore", "resources/wsse.keystore");
		System.setProperty("org.jboss.ws.wsse.trustStore", "resources/wsse.keystore");
		System.setProperty("org.jboss.ws.wsse.keyStorePassword", "jbossws");
		System.setProperty("org.jboss.ws.wsse.trustStorePassword", "jbossws");
		System.setProperty("org.jboss.ws.wsse.keyStoreType", "jks");
		System.setProperty("org.jboss.ws.wsse.keyStoreType", "jks");


		URL wsdlFileURL = new URL("http://localhost:8080/simpleencrypt?wsdl");
		QName qname = new QName("http://org.jboss.ws/samples/wssecurity", "HelloService");
		
	    URL securityURL = new File("resources/jboss-wsse-client.xml").toURI().toURL();
		
		Service service = Service.create(wsdlFileURL, qname);
		((ServiceExt)service).setSecurityConfig(securityURL.toExternalForm());
        
        Hello port = service.getPort(Hello.class);
        ((StubExt)port).setConfigName("Standard WSSecurity Client");

		String ret = port.echoUserType("hello world!");
		System.out.println(ret);
	}
}


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065656#4065656

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065656



More information about the jboss-user mailing list