Я пытаюсь получить «HttpServletRequest» в методе AxisHandler «handleMessage».
Мой AxisHandler реализует «SOAPHandler», как показано ниже кода ..
Мне нужно получить «HttpServletRequest» в «InBoundDirection», но он возвращает «ноль».
Как я могу получить "HttpServletRequest" в "InBoundDirection" SOAPHandler?
Спасибо ..
@Override
public boolean handleMessage(SOAPMessageContext soapMessageContext) {
boolean direction = ((Boolean) soapMessageContext.get(SOAPMessageContext.MESSAGE_OUTBOUND_PROPERTY)).booleanValue();
if (direction) {
System.out.println("direction = outbound");
} else {
System.out.println("direction = inbound");
HttpServletRequest servletReq=(HttpServletRequest) soapMessageContext.get(MessageContext.SERVLET_REQUEST);
// BECAUSE servletReq is null the following line returns a "nullPointerException"
System.out.println(servletReq.getRemoteHost());
}
return true;
}