@WebService @Service public class WeiXinWebServiceImpl implements IWeiXinWebService { @Resource private WebServiceContext webServiceContext; public String getLoginUser() { HttpServletRequest request = (HttpServletRequest) webServiceContext.getMessageContext().get(MessageContext.SERVLET_REQUEST); HttpSession session = request.getSession(); return session.getAttribute("loginUser").toString(); } }