• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is it Synchronous or Asynchronous?

 
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..

i access WebService from JSE, like this :


is that code execute WebService Synchronously or Asynchronously?..
if it accessed Synchronously, and then how to configure JAX-WS asynchronouly?..

Thanks in advance..
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Synchronous.
If you want your web service client to allow for asynchronous calls, then you must supply a binding file when invoking wsimport. Such a binding file looks like this:


If you want an asynchronous web service, on the server side, then it is another story - you probably will want to use some kind of queue and place work to be processed in that queue etc. etc.
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
Thanks Ivan for your reply..


If you want your web service client to allow for asynchronous calls, then you must supply a binding file when invoking wsimport.



Could you explain this?..
I'm still don't understand about this..
How to supply a binding file when invoking wsimport?..
is it mean that i've to add some parameters while use wsimport and that binding generated automatically or we've to add that binding manually?..

Thanks in advance..

 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Check this webpage: http://java.sun.com/webservices/docs/2.0/jaxws/wsimport.html
By supplying the -b flag and a path to a binding file when you invoke wsimport, you can use separately defined binding files, as I gave an example of in the earlier post.
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
Thanks Ivan for your reply..

Is That binding file should be placed in a WAR or JAR file?..
Should its deployed or no?..
is that binding file only needed when we want to generate Service class of our WebService through wsimport?..
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi again! :-)

Leonardo Carreira wrote:
is that binding file only needed when we want to generate Service class of our WebService through wsimport?..


Right, it is only needed when you invoke wsimport to generate the artifacts. You do NOT need to include it when deploying.
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..

I've applied it and then i tried to execute WebService call asynchronously..
this is my code that i've applied :


i'm wondering about that..
i really doubt in this code :


is it true or no in asynchronous call implementation?..

Please correct me if i'm wrong..
Thanks in advance..
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Yes, indeed, it looks like you have succeeded in implementing an asynchronous web service client.
However, there is one thing that looks quite strange in your code:

In the code above, you iterate over all the objects of the type Major in the list data. For each iteration, one object from the list is placed in the variable major. You also have a variable i that always contain 1.
BUT when you print the id, code and name, it looks like you call static methods on the Major class. The object from the list, in major, is totally ignored.
What is the result when you run the program? Does it work like expected?
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..


In the code above, you iterate over all the objects of the type Major in the list data. For each iteration, one object from the list is placed in the variable major. You also have a variable i that always contain 1.
BUT when you print the id, code and name, it looks like you call static methods on the Major class. The object from the list, in major, is totally ignored.
What is the result when you run the program? Does it work like expected?



Yes, in that code i forgot to put the increment of variable i..
the result is the list of objects printed in the console, and it work like what i expected...
Next, perhaps i would try to integrate it with Swing..

is it good if we develop a Swing application where do data manipulation in database through WebService?.

please correct me if i'm wrong..

Thanks..
 
reply
    Bookmark Topic Watch Topic
  • New Topic