I am using Spring 3.1 SimpleJaxWsServiceExporter to publish a web service as follows:
<bean class="org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter" > <property name="baseAddress" value="http://192.168.1.8:8888/" /></bean> <bean id="webServiceEndpoint" class="com.test.remoting.jaxws.WebServiceEndpoint"> </bean>
then I will try to go get the client ip, but my request is zero, please tell me if there are any errors? Many thanks!
@Resource WebServiceContext wsContext; @WebMethod public String Test(){ MessageContext mc = wsContext.getMessageContext(); HttpServletRequest req = (HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST); //here is always null return "aa"; }
source share