Normally with HTTP, you have to grab the HTTPConduit from the Client:
HTTPConduit conduit = (HTTPConduit)((ClientImpl)client).getConduit();
and set the timeouts on the client properties in there. The setting on
the client itself is really just for protocols that are purely async and the
client has to mimic the synchronous behavior.
Dan
On Wednesday, March 28, 2012 04:28:02 PM Warren, Jared S wrote:
> I have a CXF client. I have a handle on the Service object, from which
> I get a Port (by calling get<Type>Port() on the service).
>
>
>
> I thought I could look up the ClientImpl via ClientProxy and then call
> setSynchronousTimeout(int t) to set the invocation timeout ( the time it
> takes for the service to execute). But, this doesn't work...
>
>
>
> So, my code looks like this:
>
>
>
> public void callSomething(<Type>Service svc) {
>
> <Type>Port port = svc.get<Type>Port();
>
> Client client = ClientProxy.getClient(port);
>
> ((ClientImpl)client).setSynchronousTimeout(1 * 1000);
>
>
>
> port.doMethod();
>
> }
>
>
>
> Even with this code (which seems to set the timeout to 1s), the
> doMethod() call is allowed to block indefinitely.
>
>
>
> Anyone have a solution?
>
>
>
> Thanks,
>
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com