File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Calling a web service operation from a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Calling a web service operation from a servlet" Watch "Calling a web service operation from a servlet" New topic
Author

Calling a web service operation from a servlet

Alex Parvan
Ranch Hand

Joined: Dec 10, 2009
Posts: 115
Hi, i wanted to ask this...

I have a servlet and web service on the same server, and i want to call a WS operation from the servlet.
How do i do this ?

Thanks,
Alex


"Quoting yourself is stupid" - Me
Chinna Eranna
Ranch Hand

Joined: Dec 08, 2009
Posts: 174

You have to write a Client depending on the type of webservice (Soap/REST).


- Chinna
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42061
    
  64
If you can guarantee that they will always be on the same server, then you can factor out the business logic from the WS into their own classes, and then use those classes directly from within the servlet.


Ping & DNS - my free Android networking tools app
 
GeeCON Prague 2014
 
subject: Calling a web service operation from a servlet