aspose file tools*
The moose likes Web Services and the fly likes OneWay operation WebService (JAX-WS) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "OneWay operation WebService (JAX-WS)" Watch "OneWay operation WebService (JAX-WS)" New topic
Author

OneWay operation WebService (JAX-WS)

Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

Hi Friends..

How to implement OneWay operation WebService?..
just use @OneWay and use void method?.. //is it enough?
What case that forced us to develop OneWay operation WebService?..

Thanks in advance..


Sorry, perhaps my english language isn't too good.. Prepare for SCJP 6, Please God help me.. ☼
References : [Java.Boot] [JavaChamp] [JavaPrepare]
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Yes, annotating a method with the @OneWay annotation is enough if you do Java-first development.
If you are doing WSDL-first development, then (assuming WSDL 1.1) you must not have <output> element(s) or <fault> elements in the <operation> element in question in the <portType> element. The example below has two operations, only the second is a one-way operation.


Oneway operations are useful, for instance, if a client wants to send a message to a web service but is not interested in waiting for a response, for instance with asynchronous operations that may take a long time to finish. The response may later be delivered using callback or the client may poll for the result.
Best wishes!
Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

Hi Ivan, thanks for your reply..

Oh i see.. i guessed before that the OneWay operation in WebService doesn't need to have return value..

The response may later be delivered using callback or the client may poll for the result.


do we have to make callback handler (in the client side)?..
how about if we implement only use common asynchronous call (through Polling)?...
doesn't it matter?..

sorry Ivan, i'm still not understand about this mean : "the client may poll for the result"..

Thanks in advance..
C Shinde
Ranch Hand

Joined: Oct 22, 2009
Posts: 60
Read Dispatch API and Response API.
And also read the PDF created by Ivar, page number 163 for 'Asynchronous Request-Response'.

Regards,
Chetan


Regards,
Chetan Shinde
Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

Ok... Thanks C Shinde for your reply..
it helps me for get more clarification about OneWay operation..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OneWay operation WebService (JAX-WS)
 
Similar Threads
Oneway void
How to throw checked Exception From Oneway method
Exam annotation coverage
JAX-WS One way operation with return type not void
WA #1.....word association