Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

OneWay operation WebService (JAX-WS)  RSS feed

 
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Ranch Hand
Posts: 2198
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read Dispatch API and Response API.
And also read the PDF created by Ivar, page number 163 for 'Asynchronous Request-Response'.

Regards,
Chetan
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok... Thanks C Shinde for your reply..
it helps me for get more clarification about OneWay operation..
 
It will give me the powers of the gods. Not bad for a tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!