boom123
boom123

Reputation: 91

Set timeout on JAX-WS (weblogic)

I have a JAX-WS that invokes another WS (the client has been build using JAX-WS). My goal is to set a timeout on the invocation. I know that I can use:

BindingProviderProperties.CONNECT_TIMEOUT
BindingProviderProperties.REQUEST_TIMEOUT

public static final java.lang.String CONNECT_TIMEOUT =  "com.sun.xml.internal.ws.connect.timeout";
public static final java.lang.String REQUEST_TIMEOUT = "com.sun.xml.internal.ws.request.timeout";

but these point to com.sun.xml.* classes, and according to Oracle this is considered a very bad practise because these classes are undocumented and might change or be removed. source: www.oracle.com/technetwork/java/faq-sun-packages-142232.html

Can somebody point me how I can set a timeout on my invocation without violating Oracles guidelines?

Upvotes: 1

Views: 7030

Answers (2)

Display Name is missing
Display Name is missing

Reputation: 6227

Instead you should use:

javax.xml.ws.client.connectionTimeout
javax.xml.ws.client.receiveTimeout

You can find some more info/examples here: https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6/html/Development_Guide/Develop_a_JAX-WS_Client_Application.html

Upvotes: 3

helios
helios

Reputation: 2821

You can try setting timeout properties in your WS client which are defined at the end of this page: http://docs.oracle.com/cd/E13222_01/wls/docs92/webserv/client.html

Upvotes: 0

Related Questions