• 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

one-way invocations

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know how a a client can do a one -way invocation to a service in JAXRPC. But, what about if I want the client to receive a message for other service which he has not invoked. Is it possible? How the client expects the answer? How the remote service sends the this answer?
Any help is grateful,
Guadalupe
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you want 2 one-way calls you're basically doing 'psudo-synchronous' request-reply invocations. All you have to do is let your server make on invocation on your client via a callback interface - your client effectively becomes a server also, and your server also becomes a client.

presumably you have many more servers than clients, and usually you don't want to have to configure each of your servers to know about your clients. So all you have to do is pass from your client to your server, the URL of the callback interface / web service where your server can send results back to your client once it has these results. Your client doesn't wait for results - it just processes them when it gets them.

And this approach works equally well whether your making invocations over SOAP/HTTP or SOAP/JMS.

cheers,

Dave.
 
Guadalupe Ortiz
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply, but how do you implement a callback interface? Is it possible to do it with JAXRPC?
Thanks again for your attention,
Gobellot
 
Dave Clark
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I should have said 'many more clients than servers' before :-)

If you're using web services / JAX-RPC between your client and server for the forward call, it makes sense to use it also for your callback interface. This is easy with something like CORBA or RMI, because the ORB/RMI infrastructure for a client includes the server infrastructure as well.

The catch with web services is that you basically need to run an HTTP server on your client. So you'll end up with a more heavyweight client, since you'll effectively be running a web container / (i.e. a servlet engine) on both your client and server.

The next version of JAX-RPC - v2.0 - will include asynchronous web services which will effectively let you call a service and either have the service call back the client, or allow the client to poll the server for the results. You'll have to wait for J2EE 5 for this though (ie not this year).

If running a web container (ie HTTP server) on your clients is out, then maybe you should look at either RMI or JMS as the transport rather than web services.

hope the above helps,

cheers,

Dave.
 
Guadalupe Ortiz
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a server engine in both sides, service and client, but I still have some doubts.
By now I am implementing a jsp client whihc uses JAXRPC to invoke a remte JAXRPC service. So my questions would be:
i) If I still have my jsp client how do I update the information in the page when "i receive" the invocation?
ii) I am sorry I am not familiarized with servlets as I was using JAXRPC clients and services from the begining. I think that I must build the SOAP message to send in the servlet, but I was trying it and I get an error about the opperation name, but anyway I do not kow if that is what i have to do. Please tell me if I am wrong in my steps.
Thank-you very much for your help,
Guadalupe
 
Ranch Hand
Posts: 1067
2
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To do async you need to be running web services on both the server and the client. You need two wsdl's, one for the intial request and another for the callback.
Google "WS-I Basic Callback", here is one hit: http://www-128.ibm.com/developerworks/webservices/library/ws-iuse/
 
William Barnes
Ranch Hand
Posts: 1067
2
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Couple of other thoughts.

Given a choice WebServices shouldn't be you first choice when trying to solve a problem which has async communications.

To get the response from an async request you need to 1] wait, or 2] check back later. Servlets are not the best choice when you want to wait or check back later.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic