Search in sources :

Example 1 with HelloWorld

use of org.apache.cxf.systest.jaxrs.jaxws.HelloWorld in project cxf by apache.

the class JAXRSSoapBookTest method testHelloRest.

@Test
public void testHelloRest() throws Exception {
    String address = "http://localhost:" + PORT + "/test/services/hello-rest";
    HelloWorld service = JAXRSClientFactory.create(address, HelloWorld.class);
    useHelloService(service);
}
Also used : HelloWorld(org.apache.cxf.systest.jaxrs.jaxws.HelloWorld) Test(org.junit.Test)

Example 2 with HelloWorld

use of org.apache.cxf.systest.jaxrs.jaxws.HelloWorld in project cxf by apache.

the class JAXRSSoapRestBlueprintTest method testHelloSoap.

@Test
public void testHelloSoap() throws Exception {
    final QName serviceName = new QName("http://hello.com", "HelloWorld");
    final QName portName = new QName("http://hello.com", "HelloWorldPort");
    final String address = "http://localhost:" + PORT + "/bp/services/hello-soap";
    Service service = Service.create(serviceName);
    service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, address);
    HelloWorld hw = service.getPort(HelloWorld.class);
    useHelloService(hw);
}
Also used : QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) HelloWorld(org.apache.cxf.systest.jaxrs.jaxws.HelloWorld) Test(org.junit.Test)

Example 3 with HelloWorld

use of org.apache.cxf.systest.jaxrs.jaxws.HelloWorld in project cxf by apache.

the class JAXRSSoapBookTest method doTestHelloSoapCustomDataBinding.

private void doTestHelloSoapCustomDataBinding(String address) throws Exception {
    final QName serviceName = new QName("http://hello.com", "HelloWorld");
    final QName portName = new QName("http://hello.com", "HelloWorldPort");
    Service service = Service.create(serviceName);
    service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, address);
    HelloWorld hw = service.getPort(HelloWorld.class);
    Client cl = ClientProxy.getClient(hw);
    HTTPConduit http = (HTTPConduit) cl.getConduit();
    HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
    httpClientPolicy.setConnectionTimeout(0);
    httpClientPolicy.setReceiveTimeout(0);
    http.setClient(httpClientPolicy);
    User user = new UserImpl("Barry");
    User user2 = hw.echoUser(user);
    assertNotSame(user, user2);
    assertEquals("Barry", user2.getName());
}
Also used : HTTPConduit(org.apache.cxf.transport.http.HTTPConduit) User(org.apache.cxf.systest.jaxrs.jaxws.User) QName(javax.xml.namespace.QName) HTTPClientPolicy(org.apache.cxf.transports.http.configuration.HTTPClientPolicy) UserImpl(org.apache.cxf.systest.jaxrs.jaxws.UserImpl) Service(javax.xml.ws.Service) BookSoapService(org.apache.cxf.systest.jaxrs.jaxws.BookSoapService) Client(org.apache.cxf.endpoint.Client) CloseableHttpClient(org.apache.http.impl.client.CloseableHttpClient) WebClient(org.apache.cxf.jaxrs.client.WebClient) HelloWorld(org.apache.cxf.systest.jaxrs.jaxws.HelloWorld)

Example 4 with HelloWorld

use of org.apache.cxf.systest.jaxrs.jaxws.HelloWorld in project cxf by apache.

the class JAXRSSoapBookTest method testHelloSoap.

@Test
public void testHelloSoap() throws Exception {
    final QName serviceName = new QName("http://hello.com", "HelloWorld");
    final QName portName = new QName("http://hello.com", "HelloWorldPort");
    final String address = "http://localhost:" + PORT + "/test/services/hello-soap";
    Service service = Service.create(serviceName);
    service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, address);
    HelloWorld hw = service.getPort(HelloWorld.class);
    useHelloService(hw);
}
Also used : QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) BookSoapService(org.apache.cxf.systest.jaxrs.jaxws.BookSoapService) HelloWorld(org.apache.cxf.systest.jaxrs.jaxws.HelloWorld) Test(org.junit.Test)

Example 5 with HelloWorld

use of org.apache.cxf.systest.jaxrs.jaxws.HelloWorld in project cxf by apache.

the class JAXRSSoapRestBlueprintTest method testHelloRest.

@Test
public void testHelloRest() throws Exception {
    String address = "http://localhost:" + PORT + "/bp/services/hello-rest";
    HelloWorld service = JAXRSClientFactory.create(address, HelloWorld.class);
    useHelloService(service);
}
Also used : HelloWorld(org.apache.cxf.systest.jaxrs.jaxws.HelloWorld) Test(org.junit.Test)

Aggregations

HelloWorld (org.apache.cxf.systest.jaxrs.jaxws.HelloWorld)5 Test (org.junit.Test)4 QName (javax.xml.namespace.QName)3 Service (javax.xml.ws.Service)3 BookSoapService (org.apache.cxf.systest.jaxrs.jaxws.BookSoapService)2 Client (org.apache.cxf.endpoint.Client)1 WebClient (org.apache.cxf.jaxrs.client.WebClient)1 User (org.apache.cxf.systest.jaxrs.jaxws.User)1 UserImpl (org.apache.cxf.systest.jaxrs.jaxws.UserImpl)1 HTTPConduit (org.apache.cxf.transport.http.HTTPConduit)1 HTTPClientPolicy (org.apache.cxf.transports.http.configuration.HTTPClientPolicy)1 CloseableHttpClient (org.apache.http.impl.client.CloseableHttpClient)1