You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by ge...@ws.apache.org on 2005/01/12 03:19:01 UTC

[Apache Web Services Wiki] New: FrontPage/Axis/HttpRequest

   Date: 2005-01-11T18:19:01
   Editor: ToshiyukiKimura
   Wiki: Apache Web Services Wiki
   Page: FrontPage/Axis/HttpRequest
   URL: http://wiki.apache.org/ws/FrontPage/Axis/HttpRequest

   Importing old wiki ...

New Page:

##language:en
'''Q: How do I get access to the {{{ HttpServletRequest }}} that called my service?'''

A: Get this from the message context, as shown in {{{ EchoHeaders.jws }}}: 

{{{ 
    private HttpServletRequest getRequest() { 
        MessageContext context = MessageContext.getCurrentContext(); 
        HttpServletRequest req = (HttpServletRequest) context.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST); 
        return req; 
    } 
}}}

Note that the request will be null if the message came in over a different transport. 

Hard coding your entire webapp to only support SOAP over HTTP may be very short-sighted.