);
doubleIt(bearerPort, 25);
// Change the STSClient so that it can no longer find the STS
STSClient stsClient = new STSClient(bus);
stsClient.setOnBehalfOf(new WSSUsernameCallbackHandler());
BindingProvider p = (BindingProvider)bearerPort;
p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
// This invocation should be successful as the token is cached
doubleIt(bearerPort, 25);
//
// Proxy no. 2
//
DoubleItPortType bearerPort2 =
service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(bearerPort2, PORT);
if (standalone) {
TokenTestUtils.updateSTSPort((BindingProvider)bearerPort2, STSPORT2);
}
// Change the STSClient so that it can no longer find the STS
stsClient = new STSClient(bus);
stsClient.setOnBehalfOf(new WSSUsernameCallbackHandler());
p = (BindingProvider)bearerPort2;
p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
// This should fail as the cache is not being used
try {