use of org.apache.cxf.hello_world_jms.HelloWorldPortType in project cxf by apache.
the class JMSWSSecurityTest method testUnsignedSAML2Token.
@Test
public void testUnsignedSAML2Token() throws Exception {
QName serviceName = new QName("http://cxf.apache.org/hello_world_jms", "HelloWorldService");
QName portName = new QName("http://cxf.apache.org/hello_world_jms", "HelloWorldPort");
URL wsdl = getWSDLURL("/wsdl/jms_test.wsdl");
HelloWorldService service = new HelloWorldService(wsdl, serviceName);
String response = new String("Bonjour");
HelloWorldPortType greeter = service.getPort(portName, HelloWorldPortType.class);
SamlCallbackHandler callbackHandler = new SamlCallbackHandler();
callbackHandler.setSignAssertion(true);
callbackHandler.setConfirmationMethod(SAML2Constants.CONF_BEARER);
Map<String, Object> outProperties = new HashMap<>();
outProperties.put(ConfigurationConstants.ACTION, ConfigurationConstants.SAML_TOKEN_UNSIGNED);
outProperties.put(ConfigurationConstants.SAML_CALLBACK_REF, callbackHandler);
WSS4JOutInterceptor outInterceptor = new WSS4JOutInterceptor(outProperties);
Client client = ClientProxy.getClient(greeter);
client.getOutInterceptors().add(outInterceptor);
String reply = greeter.sayHi();
assertNotNull("no response received from service", reply);
assertEquals(response, reply);
((java.io.Closeable) greeter).close();
}
use of org.apache.cxf.hello_world_jms.HelloWorldPortType in project cxf by apache.
the class JMSSharedQueueTest method testTwoWayQueueAppCorrelationID.
@Test
public void testTwoWayQueueAppCorrelationID() throws Throwable {
QName serviceName = new QName(SERVICE_NS, "HelloWorldServiceAppCorrelationID");
QName portNameEng = new QName(SERVICE_NS, "HelloWorldPortAppCorrelationIDEng");
QName portNameSales = new QName(SERVICE_NS, "HelloWorldPortAppCorrelationIDSales");
URL wsdl = getWSDLURL(WSDL);
HelloWorldServiceAppCorrelationID service = new HelloWorldServiceAppCorrelationID(wsdl, serviceName);
HelloWorldPortType portEng = markForClose(service.getPort(portNameEng, HelloWorldPortType.class, cff));
ClientRunnable engClient = new ClientRunnable(portEng, new CorrelationIDFactory() {
private int counter;
public String createCorrealtionID() {
return "com.mycompany.eng:" + counter++;
}
});
HelloWorldPortType portSales = markForClose(service.getPort(portNameSales, HelloWorldPortType.class, cff));
ClientRunnable salesClient = new ClientRunnable(portSales, new CorrelationIDFactory() {
private int counter;
public String createCorrealtionID() {
return "com.mycompany.sales:" + counter++;
}
});
executeAsync(new ClientRunnable[] { engClient, salesClient });
}
use of org.apache.cxf.hello_world_jms.HelloWorldPortType in project cxf by apache.
the class JMSSharedQueueTest method testTwoWayQueueAppCorrelationIDNoPrefix.
/* TO DO:
* This tests shows a missing QoS. When CXF clients share a named (persistent) reply queue
* with an application provided correlationID there will be a guaranteed response
* message loss.
*
* A large number of threads is used to ensure message loss and avoid a false
* positive assertion
*/
@Test
public void testTwoWayQueueAppCorrelationIDNoPrefix() throws Throwable {
QName serviceName = new QName(SERVICE_NS, "HelloWorldServiceAppCorrelationIDNoPrefix");
QName portName = new QName(SERVICE_NS, "HelloWorldPortAppCorrelationIDNoPrefix");
URL wsdl = getWSDLURL(WSDL);
HelloWorldServiceAppCorrelationIDNoPrefix service = new HelloWorldServiceAppCorrelationIDNoPrefix(wsdl, serviceName);
HelloWorldPortType port = markForClose(service.getPort(portName, HelloWorldPortType.class, cff));
Collection<ClientRunnable> clients = new ArrayList<>();
for (int i = 0; i < 1; ++i) {
clients.add(new ClientRunnable(port));
}
executeAsync(clients);
}
Aggregations