I use Spring 3.1 SimpleJaxWsServiceExporter to publish a webservice like this:
<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 try go get client ip, but my request is null, please tell me is there anythings wrong? thanks very much!!
@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";
}