Client client = ClientProxy.getClient(svc);
client.getEndpoint().getEndpointInfo().setAddress(
"https://localhost:" + PORT2 + "/SslUsernamePasswordAttachmentService");
WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor();
client.getEndpoint().getOutInterceptors().add(wssOut);
// just some basic sanity tests first to make sure that auth is working where password is provided.
wssOut.setProperties(getPasswordProperties("alice", "password"));
svc.doSslAndUsernamePasswordPolicy();
wssOut.setProperties(getPasswordProperties("alice", "passwordX"));
try {
svc.doSslAndUsernamePasswordPolicy();
fail("Expected authentication failure");
} catch (Exception e) {
assertTrue(true);
}
wssOut.setProperties(getNoPasswordProperties("alice"));
try {
svc.doSslAndUsernamePasswordPolicy();
fail("Expected authentication failure");
} catch (Exception e) {