Commit 3a561a95 authored by Quxl's avatar Quxl

x

parent 5b906d14
Pipeline #142 failed with stages
package com.egolm.sso.service;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
@WebService(targetNamespace = "http://service.sso.egolm.com") // 服务接口全路径, 指定做SEI(Service EndPoint Interface)服务端点接口
public interface TestService {
@WebMethod // 标注该方法为webservice暴露的方法,用于向外公布,它修饰的方法是webservice方法,去掉也没影响的,类似一个注释信息。
public String getUser(@WebParam(name = "userId") String userId);
@WebMethod
public String getUserName(@WebParam(name = "userId") String userId);
}
package com.egolm.sso.service.impl;
import java.util.HashMap;
import java.util.Map;
import javax.jws.WebMethod;
import javax.jws.WebService;
import org.springframework.stereotype.Component;
import com.egolm.sso.service.TestService;
@Component
@WebService(serviceName = "TestService", // 对外发布的服务名
targetNamespace = "http://service.sso.egolm.com", // 指定你想要的名称空间,通常使用使用包名反转
endpointInterface = "com.egolm.sso.service.TestService") // 服务接口全路径, 指定做SEI(Service EndPoint Interface)服务端点接口
public class TestServiceImpl implements TestService {
private Map<String, Map<String, String>> userMap = new HashMap<String, Map<String, String>>();
public TestServiceImpl() {
Map<String, String> u1 = new HashMap<String, String>();
u1.put("userId", "111");
u1.put("userName", "Quxl");
userMap.put("111", u1);
Map<String, String> u2 = new HashMap<String, String>();
u1.put("userId", "222");
u1.put("userName", "Test");
userMap.put("222", u2);
}
@Override
@WebMethod
public String getUserName(String userId) {
return "userId为:" + userId;
}
@Override
@WebMethod
public String getUser(String userId) {
return null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment