-
Notifications
You must be signed in to change notification settings - Fork 0
/
WhatscoreWS.java
48 lines (38 loc) · 1.44 KB
/
WhatscoreWS.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* @Author: Ade Akingbade
* @Date: 1st April 2017
* @IDE: Eclipse Java EE IDE Neon.3
*
* This is only a demonstration and only serves another project of mine.
*
*/
// This is the main implementation of the web service. The service provides 3 endpoints that can be invoked by the client.
// Oracle GlassFish Server is used to run the web service.
package whatscoreWebService;
import java.util.List;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService(name="whatscoreCatalog", portName="whatscoreCatalogPort", serviceName="whatscoreCatalogService",
targetNamespace="http://www.whatscore.com")
public class WhatscoreWS {
WhatscoreWSImpl productService = new WhatscoreWSImpl();
//Endpoint that allows client to create a user
@WebMethod(action="register_user", operationName="registerUser")
public boolean insertUser(String un, String pw, String fn, String ln, String ft){
return productService.createUserDB(un, pw, fn, ln, ft);
}
//Endpoint that verfies user and returns user details
@WebMethod(action="login_user", operationName="loginUser")
public List<String> loginUser(String un, String pw){
if(productService.checkLoginDetails(un, pw) == true){
return productService.userDetails(un);
}else{
return null;
}
}
//Endpoint that updates the status of the user in the DB
@WebMethod(action="logout_user", operationName="logoutUser")
public boolean logoutUser(String un){
return productService.logoutUser(un);
}
}