1

I have a web-service which receives a POST request from the client (i.e. I receive a JSON on server). Then I perform the validation that if the user is authorized by performing the check in my database.

But if I don't find the user in my database , then I have to hit another web-service, at some other location(i.e a different URL), which has been exposed by some external third party, which will respond with a JSON containing details of authenticity of user(i.e. if user is authorized or not).

Where I am stuck is : how do I hit another web-service , send a JSON and then , also receive the JSON from third party web-service.

Please help me !!! thanks in advance.

  • 1
    Assuming ([from your previous question](http://stackoverflow.com/q/28942895/2587435)), you're using Jersey 1, you can just use the [Client API](https://jersey.java.net/documentation/1.18/user-guide.html#client-api). Just add the [Client dependency](https://jersey.java.net/documentation/1.18/user-guide.html#core_client) – Paul Samsotha Mar 12 '15 at 10:49
  • no sorry , I am using WAS (Websphere Application Server ) now !! – sensitive_piece_of_horseflesh Mar 12 '15 at 10:52
  • 1
    Any HTTP client will work. [Many options here](http://stackoverflow.com/q/221442/2587435)... Answer [with no extra dependencies](http://stackoverflow.com/a/3533714/2587435) – Paul Samsotha Mar 12 '15 at 10:55

0 Answers0