use of org.apache.cxf.transport.http.HTTPConduit in project cxf by apache.
the class AsyncHttpTransportFactory method getConduit.
@Override
public Conduit getConduit(EndpointInfo endpointInfo, EndpointReferenceType target, Bus bus) throws IOException {
// need to updated the endpointInfo
endpointInfo.setAddress(getAddress(endpointInfo));
AsyncHTTPConduitFactory fact = bus.getExtension(AsyncHTTPConduitFactory.class);
if (fact == null) {
fact = factory;
}
HTTPConduit conduit = fact.createConduit(bus, endpointInfo, target);
// Spring configure the conduit.
String address = conduit.getAddress();
if (address != null && address.indexOf('?') != -1) {
address = address.substring(0, address.indexOf('?'));
}
HTTPConduitConfigurer c1 = bus.getExtension(HTTPConduitConfigurer.class);
if (c1 != null) {
c1.configure(conduit.getBeanName(), address, conduit);
}
configure(bus, conduit, conduit.getBeanName(), address);
conduit.finalizeConfig();
return conduit;
}
use of org.apache.cxf.transport.http.HTTPConduit in project cxf by apache.
the class AsyncHTTPConduitTest method testResponseSameBufferSize.
@Test
public void testResponseSameBufferSize() throws Exception {
updateAddressPort(g, PORT);
HTTPConduit c = (HTTPConduit) ClientProxy.getClient(g).getConduit();
c.getClient().setReceiveTimeout(12000);
try {
g.greetMe(FILL_BUFFER);
g.greetMe("Hello");
} catch (Exception ex) {
fail();
}
}
use of org.apache.cxf.transport.http.HTTPConduit in project cxf by apache.
the class AsyncHTTPConduitTest method testTimeoutAsync.
@Test
public void testTimeoutAsync() throws Exception {
updateAddressPort(g, PORT);
HTTPConduit c = (HTTPConduit) ClientProxy.getClient(g).getConduit();
c.getClient().setReceiveTimeout(3000);
try {
Response<GreetMeLaterResponse> future = g.greetMeLaterAsync(-5000L);
future.get();
fail();
} catch (Exception ex) {
// expected!!!
}
}
use of org.apache.cxf.transport.http.HTTPConduit in project cxf by apache.
the class AsyncHTTPConduitTest method testTimeout.
@Test
public void testTimeout() throws Exception {
updateAddressPort(g, PORT);
HTTPConduit c = (HTTPConduit) ClientProxy.getClient(g).getConduit();
c.getClient().setReceiveTimeout(3000);
try {
assertEquals("Hello " + request, g.greetMeLater(-5000));
fail();
} catch (Exception ex) {
// expected!!!
}
}
use of org.apache.cxf.transport.http.HTTPConduit in project cxf by apache.
the class AsyncHTTPConduitTest method testTimeout.
@Test
public void testTimeout() throws Exception {
updateAddressPort(g, PORT);
HTTPConduit c = (HTTPConduit) ClientProxy.getClient(g).getConduit();
c.getClient().setReceiveTimeout(3000);
try {
assertEquals("Hello " + request, g.greetMeLater(-5000));
fail();
} catch (Exception ex) {
// expected!!!
}
}
Aggregations