Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Asynchronous access from Servlet to Webservice with Axis  RSS feed

 
Torsten Schindler
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi *,

My goal is to make an asynchronous access to a web service written in
Perl (with SOAP::Lite) from a servlet which communicates an applet
or is called from a JSP.
The web service has two access modes synchronous and asynchronous.
To access the web services I wrote an Java interface and created
a WSDL file with the Java2WSDL tool from Axis. Then I created my Java client
stubs with WSDL2Java and can now call my service within a servlet.
In synchronous mode, it works pretty good:
...(snip)...
ClustalWService service = new ClustalWServiceLocator();
ClustalW port = service.getClustalW();
String result = port.getAnalyzeSyncResult(query_sequence);
...(snip)...

To support asynchronouns mode the web service has three methods/functions:
...(snip)...
ClustalWService service = new ClustalWServiceLocator();
ClustalW port = service.getClustalW();
int requestId = port.startAnalyzeAsync(query_sequence); // 1.
int status = port.analyzeAsyncIsRunning(requestID); // 2.
String result = port.getAnalyzeAsyncResult(reqestID); // 3.
...(snip)...

Now my questions:
a)How can I call the web service in asynchronous mode from an (Action)Servlet?
I read an article about JMS/Axis, but I haven't used JMS, so far.

b) Is it possible with combination openJMS + tomcat5 + axis?
If yes, then please give me a small working example.

c) I'm also looking for some information about Applet & Struts
communication. So if anybody knows some useful sites, please send me
a mail.

Many thanks in advance,

Torsten

P.S.:
I'm a Java newbie, who started Java programming this year in march.
 
James Clinton
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a) you will need to build a SOAP message using DOM and make a manual call (lookup 'doucment style' web services).

b) you can combine tomcat + axis (not tried openJMS) Althrough this is not required to use asynchronous messaging (see callback pattern).

c) for struts info goto apache.org. for applet info see the sun site, they have many tutorials. If you talking about combining them I would suggest you dump the applet for a JSP....this will become clear.

HTH
 
Ales Justin
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any luck with this async call?

Is there some code example to see?

Thanx, Ales
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!