Search in sources :

Example 1 with UserImpl

use of org.apache.cxf.systest.jaxrs.jaxws.UserImpl 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)

Aggregations

QName (javax.xml.namespace.QName)1 Service (javax.xml.ws.Service)1 Client (org.apache.cxf.endpoint.Client)1 WebClient (org.apache.cxf.jaxrs.client.WebClient)1 BookSoapService (org.apache.cxf.systest.jaxrs.jaxws.BookSoapService)1 HelloWorld (org.apache.cxf.systest.jaxrs.jaxws.HelloWorld)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