java - Call an external web service from a servlet -


I am developing a servlet that keeps a name for the web service and can forward the request to an external web service, For example: http: //www.webservice.com / ...

I have created a feedback wrapper that blocks the feedback but I have an external request Can not forward the web service, it only works when I request a servlet on the same server to repurchase Do Deshit.

Example:

  request.getRequestDispatcher ("Ameservelet"). Request, response) // WORKS request.getRequestDispatcher ("http: //www.webservice.com / ..."). Forward (request, response)  

search for http: //www.webservice.com / ... on the server as a local resource because of a tomak.

How can I make an external request?

Thank you

To make a request for an external service, you are clear Take a look at the class to handle a new HTTP request and handle its response.


Comments