1 Reply Latest reply on Jun 28, 2004 8:07 PM by Lance Nehring

    User Agent

    diegomemo Newbie

      Hi,
      Can I extract the User-Agent of the Client without using a Servlet?

      thanks.
      Please excuse me for my English.

        • 1. Re: User Agent
          Lance Nehring Newbie

          Axis is basically a servlet, so you can get to the HTTP header information. From inside your Axis SOAP service, you can get the MessageContext from Axis and then get the HttpServletRequest from that context. From the HttpServletRequest you can ask for the User-Agent.

          MessageContext msgctx = AxisEngine.getCurrentMessageContext();
          
          HttpServletRequest req = (HttpServletRequest) msgctx.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
          
          String userAgent = req.getHeader("User-Agent");
          


          Best regards,
          Lance Nehring
          www.newparticles.com