Search in sources :

Example 11 with Service

use of javax.xml.ws.Service in project wildfly by wildfly.

the class TestRequiredAddressingTestCase method usingWSDLFromDeployedEndpoint.

@Test
public void usingWSDLFromDeployedEndpoint() throws Exception {
    QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wsaddressing", "AddressingService");
    URL wsdlURL = new URL(baseUrl, "/jaxws-wsa/AddressingService?wsdl");
    File wsdlFile = new File(this.getClass().getSimpleName() + ".wsdl");
    TestNoAddressingTestCase.downloadWSDLToFile(wsdlURL, wsdlFile);
    Service service = Service.create(wsdlFile.toURI().toURL(), serviceName);
    ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
    Assert.assertEquals(expectedResponse, proxy.sayHello(message));
    wsdlFile.delete();
}
Also used : QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) File(java.io.File) URL(java.net.URL) Test(org.junit.Test)

Example 12 with Service

use of javax.xml.ws.Service in project wildfly by wildfly.

the class ReliableServiceTestCase method consumeOneWayService.

private void consumeOneWayService() throws Exception {
    QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wsrm", "ReliableService");
    URL wsdlURL = new URL(baseUrl, "ReliableService?wsdl");
    Service service = Service.create(wsdlURL, serviceName, new UseNewBusFeature());
    ReliableService proxy = (ReliableService) service.getPort(ReliableService.class);
    BindingProvider bp = (BindingProvider) proxy;
    bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, new URL(baseUrl, "ReliableService").toString());
    proxy.writeLogMessage();
}
Also used : QName(javax.xml.namespace.QName) UseNewBusFeature(org.jboss.wsf.stack.cxf.client.UseNewBusFeature) ReliableService(org.jboss.as.test.integration.ws.wsrm.generated.ReliableService) ReliableService(org.jboss.as.test.integration.ws.wsrm.generated.ReliableService) Service(javax.xml.ws.Service) BindingProvider(javax.xml.ws.BindingProvider) URL(java.net.URL)

Example 13 with Service

use of javax.xml.ws.Service in project wildfly by wildfly.

the class InjectionTestCase method testPojoEndpoint.

@Test
public void testPojoEndpoint() throws Exception {
    QName serviceName = new QName("http://jbossws.org/injection", "POJOService");
    URL wsdlURL = new URL(baseUrl, "/jaxws-injection-pojo/POJOService?wsdl");
    Service service = Service.create(wsdlURL, serviceName);
    EndpointIface proxy = service.getPort(EndpointIface.class);
    Assert.assertEquals("Hello World!:Inbound:TestHandler:POJOBean:Outbound:TestHandler", proxy.echo("Hello World!"));
}
Also used : QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) EndpointIface(org.jboss.as.test.integration.ws.injection.ejb.basic.webservice.EndpointIface) URL(java.net.URL) Test(org.junit.Test)

Example 14 with Service

use of javax.xml.ws.Service in project wildfly by wildfly.

the class SimpleWebserviceEndpointTestCase method testSimpleStatelessWebserviceEndpoint.

@Test
public void testSimpleStatelessWebserviceEndpoint() throws Exception {
    final QName serviceName = new QName("org.jboss.as.test.integration.ws", "SimpleService");
    final URL wsdlURL = new URL(baseUrl, "/ws-endpoint-example/SimpleService?wsdl");
    final Service service = Service.create(wsdlURL, serviceName);
    final SimpleWebserviceEndpointIface port = service.getPort(SimpleWebserviceEndpointIface.class);
    final String result = port.echo("hello");
    Assert.assertEquals("hello", result);
}
Also used : QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) URL(java.net.URL) Test(org.junit.Test)

Example 15 with Service

use of javax.xml.ws.Service in project wildfly by wildfly.

the class Usecase1TestCase method testDeclaredEndpoint.

@Test
public void testDeclaredEndpoint() throws Exception {
    final QName serviceName = new QName("org.jboss.as.test.integration.ws.anonymousPojos", "POJOImplService");
    final URL wsdlURL = new URL(baseUrl, "/anonymous-pojo-usecase1/POJOService?wsdl");
    final Service service = Service.create(wsdlURL, serviceName);
    final POJOIface port = service.getPort(POJOIface.class);
    final String result = port.echo("hello");
    Assert.assertEquals("hello from POJO", result);
}
Also used : QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) URL(java.net.URL) Test(org.junit.Test)

Aggregations

Service (javax.xml.ws.Service)138 URL (java.net.URL)125 QName (javax.xml.namespace.QName)91 Test (org.junit.Test)84 BindingProvider (javax.xml.ws.BindingProvider)39 WebServiceException (javax.xml.ws.WebServiceException)18 IOException (java.io.IOException)12 Bus (org.apache.cxf.Bus)12 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)11 InsuranceService (com.salaboy.jbpm5.dev.guide.webservice.InsuranceService)10 HashMap (java.util.HashMap)10 ServiceIface (org.jboss.as.test.integration.ws.wsse.ServiceIface)10 UseNewBusFeature (org.jboss.wsf.stack.cxf.client.UseNewBusFeature)10 MalformedURLException (java.net.MalformedURLException)9 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)9 WrapThreadContextClassLoader (org.jboss.as.test.integration.ws.WrapThreadContextClassLoader)9 File (java.io.File)8 WSS4JOutInterceptor (org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor)8 SAAJOutInterceptor (org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor)7 Client (org.apache.cxf.endpoint.Client)7