This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

OneWay operation WebService (JAX-WS)

 
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok... Thanks C Shinde for your reply..
it helps me for get more clarification about OneWay operation..
 
She still doesn't approve of my superhero lifestyle. Or this shameless plug:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic