use of javax.xml.ws.Service in project wildfly by wildfly.
the class PojoEndpointAuthenticationTestCase method accessHelloWithUnauthorizedUser.
@Test
public void accessHelloWithUnauthorizedUser() throws Exception {
URL wsdlURL = new URL(baseUrl, "/jaxws-authentication-pojo/POJOAuthService?wsdl");
Service service = Service.create(wsdlURL, serviceName);
PojoEndpointIface proxy = service.getPort(PojoEndpointIface.class);
Map<String, Object> reqContext = ((BindingProvider) proxy).getRequestContext();
reqContext.put(BindingProvider.USERNAME_PROPERTY, "user3");
reqContext.put(BindingProvider.PASSWORD_PROPERTY, "password3");
try {
proxy.hello("World");
Assert.fail("Test should fail, HTTP response '403: Forbidden' was expected");
} catch (WebServiceException e) {
// failure is expected
Assert.assertTrue("String '403: Forbidden' was expected in " + e.getCause().getMessage(), e.getCause().getMessage().contains("403: Forbidden"));
}
}
use of javax.xml.ws.Service in project wildfly by wildfly.
the class OnlyEjbInWarTestCase method testEJB3Endpoint.
@Test
public void testEJB3Endpoint() throws Exception {
final QName serviceName = new QName("org.jboss.as.test.integration.ws.context.as1605", "EJB3EndpointService");
final URL wsdlURL = new URL(baseUrl, "/as1605-customized/EJB3Endpoint?wsdl");
final Service service = Service.create(wsdlURL, serviceName);
final EndpointIface port = service.getPort(EndpointIface.class);
final String result = port.echo("hello");
Assert.assertEquals("EJB3 hello", result);
}
use of javax.xml.ws.Service in project wildfly by wildfly.
the class SimpleStatelessWebserviceEndpointTestCase method testSimpleStatelessWebserviceEndpoint.
@Test
public void testSimpleStatelessWebserviceEndpoint() throws Exception {
final QName serviceName = new QName("org.jboss.as.test.integration.ws.ejb", "SimpleService");
final URL wsdlURL = new URL(baseUrl, "/stateless-ws-endpoint-example/SimpleService/SimpleStatelessWebserviceEndpointImpl?wsdl");
final Service service = Service.create(wsdlURL, serviceName);
final SimpleStatelessWebserviceEndpointIface port = service.getPort(SimpleStatelessWebserviceEndpointIface.class);
final String result = port.echo("hello");
Assert.assertEquals("hello", result);
}
use of javax.xml.ws.Service in project wildfly by wildfly.
the class PojoEndpointTestCase method endpointLookup.
@Before
public void endpointLookup() throws Exception {
QName serviceName = new QName("http://jbossws.org/basic", "POJOService");
URL wsdlURL = new URL(baseUrl, "/jaxws-basic-pojo/POJOService?wsdl");
Service service = Service.create(wsdlURL, serviceName);
proxy = service.getPort(EndpointIface.class);
}
use of javax.xml.ws.Service in project wildfly by wildfly.
the class CdiInterceptorTestCase method getEjb3.
private EndpointIface getEjb3() throws Exception {
final URL wsdlURL = new URL(baseUrl + "EJB3EndpointService/EJB3Endpoint?wsdl");
final QName serviceName = new QName("http://org.jboss.test.ws/jbws3441", "EJB3EndpointService");
final Service service = Service.create(wsdlURL, serviceName);
return service.getPort(EndpointIface.class);
}
Aggregations