use of javax.xml.ws.Service in project wildfly by wildfly.
the class BAParticipantCompletionClient method newInstance.
public static BAParticipantCompletion newInstance(String serviceUrl, String serviceNamespaceName) throws Exception {
URL wsdlLocation = new URL("http://" + NODE0_ADDR + ":" + NODE0_PORT + "/" + BAParticipantCompletionTestCase.ARCHIVE_NAME + "/" + serviceUrl + "?wsdl");
log.trace("wsdlLocation for service: " + wsdlLocation);
QName serviceName = new QName(TARGET_NAMESPACE, serviceNamespaceName);
QName portName = new QName(TARGET_NAMESPACE, DEFAULT_PORT_NAME);
Service service = Service.create(wsdlLocation, serviceName);
BAParticipantCompletion client = service.getPort(portName, BAParticipantCompletion.class);
return client;
}
use of javax.xml.ws.Service in project wildfly by wildfly.
the class Helpers method getExecutorService.
public static ExecutorService getExecutorService(URL url) throws MalformedURLException {
QName serviceName = new QName(ExecutorService.class.getPackage().getName(), ExecutorService.class.getSimpleName());
URL wsdlUrl = new URL(url, ExecutorService.class.getSimpleName() + "?wsdl");
Service service = Service.create(wsdlUrl, serviceName);
return service.getPort(ExecutorService.class);
}
use of javax.xml.ws.Service in project wildfly by wildfly.
the class Helpers method getRemoteService.
public static RemoteService getRemoteService(URL url) throws MalformedURLException {
QName serviceName = new QName(RemoteService.class.getPackage().getName(), RemoteService.class.getSimpleName());
URL wsdlUrl = new URL(url, RemoteService.class.getSimpleName() + "?wsdl");
Service service = Service.create(wsdlUrl, serviceName);
return service.getPort(RemoteService.class);
}
use of javax.xml.ws.Service in project wildfly by wildfly.
the class OnBehalfOfServiceImpl method sayHello.
public String sayHello(String host, String port) {
Bus bus = BusFactory.newInstance().createBus();
try {
BusFactory.setThreadDefaultBus(bus);
final String serviceURL = "http://" + host + ":" + port + "/jaxws-samples-wsse-policy-trust/SecurityService";
final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
final URL wsdlURL = new URL(serviceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
Map<String, Object> ctx = ((BindingProvider) proxy).getRequestContext();
ctx.put(SecurityConstants.CALLBACK_HANDLER, new OnBehalfOfCallbackHandler());
ctx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("actasKeystore.properties"));
ctx.put(SecurityConstants.SIGNATURE_USERNAME, "myactaskey");
ctx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("../../META-INF/clientKeystore.properties"));
ctx.put(SecurityConstants.ENCRYPT_USERNAME, "myservicekey");
STSClient stsClient = new STSClient(bus);
Map<String, Object> props = stsClient.getProperties();
//-rls test
props.put(SecurityConstants.USERNAME, "bob");
props.put(SecurityConstants.ENCRYPT_USERNAME, "mystskey");
props.put(SecurityConstants.STS_TOKEN_USERNAME, "myactaskey");
props.put(SecurityConstants.STS_TOKEN_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("actasKeystore.properties"));
props.put(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO, "true");
ctx.put(SecurityConstants.STS_CLIENT, stsClient);
return "OnBehalfOf " + proxy.sayHello();
} catch (MalformedURLException e) {
e.printStackTrace();
return null;
} finally {
bus.shutdown(true);
}
}
use of javax.xml.ws.Service in project wildfly by wildfly.
the class WSTrustTestCase method testHolderOfKey.
@Test
@RunAsClient
@OperateOnDeployment(HOLDER_OF_KEY_SERVER_DEP)
@WrapThreadContextClassLoader
public void testHolderOfKey() throws Exception {
Bus bus = BusFactory.newInstance().createBus();
try {
BusFactory.setThreadDefaultBus(bus);
final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/holderofkeywssecuritypolicy", "HolderOfKeyService");
final URL wsdlURL = new URL("https", serviceURL.getHost(), serviceURL.getPort() - 8080 + 8444, "/jaxws-samples-wsse-policy-trust-holderofkey/HolderOfKeyService?wsdl");
Service service = Service.create(wsdlURL, serviceName);
HolderOfKeyIface proxy = (HolderOfKeyIface) service.getPort(HolderOfKeyIface.class);
WSTrustTestUtils.setupWsseAndSTSClientHolderOfKey((BindingProvider) proxy, bus);
assertEquals("Holder-Of-Key WS-Trust Hello World!", proxy.sayHello());
} finally {
bus.shutdown(true);
}
}
Aggregations