Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] JAX-WS and timeout with Jetty

Hi everyone,
I try to ask here but not sure it's 100% jetty related

I have a spring application running on jetty 9.2.14

The application calls an external SOAP webservice; the client is generated through JAX-WS RI 2.2.9-b130926.1035

I didn't found a way to setup a request timeout (a timeout which fires if the remote server didn't respond to my request within a certain amount of time)

I used this code

MyService_Service se = new MyService_Service(new URL(url));
MyService dt = se.getMyServicePort();
((BindingProvider)dt).getRequestContext().put("javax.xml.ws.client.connectionTimeout", 1000);
((BindingProvider)dt).getRequestContext().put("javax.xml.ws.client.receiveTimeout", 1000);

dt.remoteLongFunction()

inside a try catch

the remote function executes in about 10 seconds, but no exception is raised

I tried with 2 different jdk

Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

and

java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

I found many web pages reporting similar snippet of code, someone with different key to put (com.sun.xml.ws.request.timeout) but the result is the same

Anyone has done something similar in jetty and can give me some hints?

Thank you
--
Andrea Cappelli

Back to the top