use of jakarta.xml.ws.Service in project core by weld.
the class WebServiceInterceptorTest method getEjb3.
private EndpointIface getEjb3() throws Exception {
final URL wsdlURL = new URL(baseUrl + "EJB3EndpointService/EJB3Endpoint?wsdl");
final QName serviceName = new QName(TARGET_NAMESPACE, "EJB3EndpointService");
final Service service = Service.create(wsdlURL, serviceName);
return service.getPort(EndpointIface.class);
}
use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.
the class ClientFeatureTest method testSameServiceDifferentDispatch.
public void testSameServiceDifferentDispatch() throws Exception {
Service service = Service.create(SERVICE_NAME);
service.addPort(PORT_NAME, HTTPBinding.HTTP_BINDING, ENDPOINT);
String encoding = "UTF-16";
Dispatch<DataSource> dispatch1 = createDispatch(service, encoding);
validateFeatureList(dispatch1, encoding);
encoding = null;
Dispatch<DataSource> dispatch2 = createDispatch(service, encoding);
validateFeatureList(dispatch2, encoding);
}
use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.
the class ThrowableInPacketCompletionTest method testThrowableAsync.
public void testThrowableAsync() {
Service service = Service.create(SERVICE_NAME, serviceFeatures());
service.addPort(PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING, "http://localhost:7001/TestService/TestPort");
Dispatch<Packet> dispatch = service.createDispatch(PORT_NAME, Packet.class, Mode.MESSAGE, portFeatures(false));
Packet request = new Packet();
try {
Response<Packet> response = dispatch.invokeAsync(request);
assertNotNull(response);
Packet responsePacket = response.get();
assertNotNull(responsePacket);
ThrowableContainerPropertySet ps = responsePacket.getSatellite(ThrowableContainerPropertySet.class);
fail("Exception expected, but got none");
} catch (Throwable t) {
assertTrue(t instanceof ExecutionException);
assertTrue(t.getCause() instanceof WebServiceException);
assertTrue(t.getCause().getCause() instanceof TestException);
}
}
use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.
the class ThrowableInPacketCompletionTest method testThrowableInPacketAsync.
public void testThrowableInPacketAsync() {
Service service = Service.create(SERVICE_NAME, serviceFeatures());
service.addPort(PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING, "http://localhost:7001/TestService/TestPort");
Dispatch<Packet> dispatch = service.createDispatch(PORT_NAME, Packet.class, Mode.MESSAGE, portFeatures(true));
Packet request = new Packet();
try {
Response<Packet> response = dispatch.invokeAsync(request);
assertNotNull(response);
Packet responsePacket = response.get();
assertNotNull(responsePacket);
ThrowableContainerPropertySet ps = responsePacket.getSatellite(ThrowableContainerPropertySet.class);
assertNotNull(ps);
assertTrue(ps.getThrowable() instanceof TestException);
} catch (Throwable t) {
fail("Exception not expected, but got: " + t.getMessage());
}
}
use of jakarta.xml.ws.Service in project metro-jax-ws by eclipse-ee4j.
the class ThrowableInPacketCompletionTest method testThrowableInPacket.
public void testThrowableInPacket() {
Service service = Service.create(SERVICE_NAME, serviceFeatures());
service.addPort(PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING, "http://localhost:7001/TestService/TestPort");
Dispatch<Packet> dispatch = service.createDispatch(PORT_NAME, Packet.class, Mode.MESSAGE, portFeatures(true));
Packet request = new Packet();
try {
Packet response = dispatch.invoke(request);
assertNotNull(response);
ThrowableContainerPropertySet ps = response.getSatellite(ThrowableContainerPropertySet.class);
assertNotNull(ps);
assertTrue(ps.getThrowable() instanceof TestException);
} catch (Throwable t) {
fail("Exception not expected, but got: " + t.getMessage());
}
}
Aggregations