ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Apache Web Services Wiki] New: FrontPage/Axis/HttpRequest
Date Wed, 12 Jan 2005 02:19:01 GMT
   Date: 2005-01-11T18:19:01
   Editor: ToshiyukiKimura
   Wiki: Apache Web Services Wiki
   Page: FrontPage/Axis/HttpRequest

   Importing old wiki ...

New Page:

'''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. 

View raw message