WebService中获取request对象一例
@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(); } }