PageRenderTime 25ms CodeModel.GetById 19ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/web/DRCP/src/com/bluesky/drcp/business/service/SoapAuthenticationService.java

http://drcp.googlecode.com/
Java | 69 lines | 49 code | 20 blank | 0 comment | 0 complexity | ac6d0395fda9e107eca20fe32481abb2 MD5 | raw file
 1package com.bluesky.drcp.business.service;
 2
 3import java.util.Map;
 4import java.util.Vector;
 5
 6import org.wix.wsCaller.DynamicInvoker;
 7
 8public class SoapAuthenticationService implements AuthenticationService {
 9	private String location;
10
11	private String serviceName;
12
13	private String portName;
14
15	private String operationName;
16
17	public String getOperationName() {
18		return operationName;
19	}
20
21	public void setOperationName(String operationName) {
22		this.operationName = operationName;
23	}
24
25	public boolean login(String userId, String password) {
26
27		try {
28			DynamicInvoker invoker = new DynamicInvoker(location);
29			Vector<Object> paramList = new Vector<Object>();
30			paramList.add(userId);
31			paramList.add(password);
32
33			Map returnList = invoker.invoke(serviceName, portName,
34					operationName, paramList);
35			Object value = returnList.get(">" + operationName + "Response>"
36					+ operationName + "Result");
37
38			return value.toString().equals("true");
39
40		} catch (Exception e) {
41		}
42
43		return false;
44	}
45
46	public String getLocation() {
47		return location;
48	}
49
50	public String getPortName() {
51		return portName;
52	}
53
54	public String getServiceName() {
55		return serviceName;
56	}
57
58	public void setLocation(String location) {
59		this.location = location;
60	}
61
62	public void setPortName(String portName) {
63		this.portName = portName;
64	}
65
66	public void setServiceName(String serviceName) {
67		this.serviceName = serviceName;
68	}
69}