Advertisement
Guest User

Untitled

a guest
May 26th, 2015
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. public void authroize(String name, String password){
  2. String path = "http://localhost:8080/lab_soa-web/test/authorize?login=" + name + "&password=" + password;
  3. WebTarget wt = wsClient.target(path);
  4. Invocation webServiceCall = wt.request()
  5. .accept("application/json")
  6. .build("GET");
  7. Response response = webServiceCall.invoke();
  8. if (response.getStatus() == Response.Status.FORBIDDEN.getStatusCode()) {
  9. System.out.println("Zle haslo lub login");
  10. } else {
  11. System.out.println("Urzytkownik poprawnie zalogowany");
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement