QName portQName = new QName(NAMESPACE, "DoubleItPortXPath");
pt = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(pt, PORT);
((BindingProvider)pt).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER,
new KeystorePasswordCallback());
((BindingProvider)pt).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES,
getClass().getResource("alice.properties"));
((BindingProvider)pt).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES,
getClass().getResource("bob.properties"));
assertEquals(10, pt.doubleIt(5));
((java.io.Closeable)pt).close();
portQName = new QName(NAMESPACE, "DoubleItPortEncryptThenSign");
pt = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(pt, PORT);
((BindingProvider)pt).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER,
new KeystorePasswordCallback());
((BindingProvider)pt).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES,
getClass().getResource("alice.properties"));
((BindingProvider)pt).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES,
getClass().getResource("bob.properties"));
// DOM
pt.doubleIt(5);
// TODO See WSS-464
// SecurityTestUtil.enableStreaming(pt);
// pt.doubleIt(5);
((java.io.Closeable)pt).close();
portQName = new QName(NAMESPACE, "DoubleItPortSign");
pt = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(pt, PORT);
((BindingProvider)pt).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER,
new KeystorePasswordCallback());
((BindingProvider)pt).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES,
getClass().getResource("alice.properties"));
((BindingProvider)pt).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES,
getClass().getResource("bob.properties"));
// DOM
pt.doubleIt(5);
// Streaming
SecurityTestUtil.enableStreaming(pt);
pt.doubleIt(5);
((java.io.Closeable)pt).close();
portQName = new QName(NAMESPACE, "DoubleItPortSignThenEncrypt");
pt = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(pt, PORT);
((BindingProvider)pt).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER,
new KeystorePasswordCallback());
((BindingProvider)pt).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES,
getClass().getResource("alice.properties"));
((BindingProvider)pt).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES,
getClass().getResource("bob.properties"));