Hi,
i'm doing some tesst with the asynchronous Invocation of methods.

My test is to send a message to an unknown hosts (15.21.23.36).

I have used the following test :

final JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
proxyFactory.setAddress("http://15.21.23.36:9999/test";);
proxyFactory.setServiceClass(MyPortType.class);
final MyPortType port = (MyPortType) proxyFactory.create();

final ... request = ...

try {
    final Response<Ack> response = port.myMethodAsync(request);
    System.out.println("Call sent");
    final GetInformationAck ack = response.get(10L, TimeUnit.SECONDS);
    System.out.println("Response received");
 } catch(Exception e) {
    System.out.println("Call failed " + e.getMessage());
}

I have the following trace :
---
Warning: Interceptor for ... has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
Caused by: java.net.ConnectException: ConnectException invoking
http://15.21.23.36:9999/test: Connection timed out: connect
Caused by: java.net.ConnectException: Connection timed out: connect

Call sent
Call failed org.apache.cxf.interceptor.Fault: Could not send Message.
---

I was expecting the same thing without the "Call sent" the connection
Exception sent by the method call.


Is there a way to have this behavior ?
I would only ensure that the message is sent (not yet processed by the
server) when calling my method, after i can wait the answer.

When is returned the Response<T> (after some checks ?) ?

Thanks for answers.
Regards
Hervé

Reply via email to