-
1. Re: asynchronous webservice posible with jboss ?
zauberlehrling Jun 13, 2007 7:31 AM (in response to jimmymani)I tried the following:
package ws import javax.jws.Oneway; import javax.jws.WebMethod; import javax.jws.WebService; import javax.ejb.Stateless; @WebService @Stateless public class Hotel { @Oneway @WebMethod public void reserve(String input) { System.out.println("input: "+input); for (int i =0; i < 60; i++) { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("i: "+i); } } }
According to the JAX-WS User Guide it should be an asynchronous webservice because of the annotation @Oneway. But it's not.
I've tested this JBoss-4.2.0.GA and jboss-5.0.0.Beta2. The call to
this webservice is blocking. Any help is appreciated!
Thanks in adavance for any help,
Frank
-
2. Re: asynchronous webservice posible with jboss ?
jyc5131 Aug 2, 2007 12:14 AM (in response to jimmymani)good question, i am finding it now too, any help is appreciated
-
3. Re: asynchronous webservice posible with jboss ?
heiko.braun Aug 2, 2007 12:49 PM (in response to jimmymani)Read about the JAX-WS client programming models. There is a difference between asynchronous and one-way invocations:
http://jbws.dyndns.org/mediawiki/index.php?title=JAX-WS_User_Guide#Web_Service_Clients -
4. Re: asynchronous webservice posible with jboss ?
kadlecp Nov 27, 2007 10:51 AM (in response to jimmymani)Hello,
according to my testing, oneway method does not return the thread of control to the calling application prior to executing the actual business method.
I have read the spec, but please can somebody know answer these questions?
1. Is it possible to call oneway method in asynchronous manner?
2. I know that I can add "Async" suffix to the method and jbossws will call method in asynchronous manner, but I think that it's only simulation of asynchronous behaviour. Connection between client and server is hold until webservice method exists. Or am I wrong? I would like that client calls the webservice method and all connections are immediately closed.
I use JBossWS-4.2.1.GA and JBossWS-2.0.0.GA
Thank for reply
Regards
Pavel -
5. Re: asynchronous webservice posible with jboss ?
ropalka Nov 27, 2007 11:53 AM (in response to jimmymani)Hi Pavel,
yes, you're right, oneway call is synchronous. (We're maintaining session HTTP headers when forced by user for example - one of reason). However you can always implement asynchronous oneway invocations. Just wrap you oneway calls to separate thread ;-)
Richard