I'm having a problem set timeout to invoke a webservices from a EJB Client.
Using Weblogic as container.
[edit]
Web Services isn't in the same server, if I setup a JTA timeout its rolling back jta transaction without exception without cancel the previous call.
This process starts from a MDB, when JTA expires it consumes the JMS again and again and again and each web services invoking keep alive in WS Sever.
[/edit]
That was my steps:
- Created stubs with wsimport
- Created a proxy class to invoke webservice
- Called webservice from a EJB.
Timeout settings:
// Setting timeout
BindingProvider bindingProvider = (BindingProvider) getService();
Map<String, Object> context = bindingProvider.getRequestContext();
context.put(JAXWSProperties.CONNECT_TIMEOUT, 5000);
context.put(JAXWSProperties.REQUEST_TIMEOUT, 20000);
If I invoke method from a stand alone program (like Swing, o a simple main) it works and throws a SocketTimeoutException, but from EJB don't respect the timeout.
Also tried to set a annotation to EJB method, but not worked either.
@AccessTimeout(value=2000)
Any idea how to setup timeout calling from a Weblogic EJB?