Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-3081

HttpServletRequest.getScheme() returns null in one way webservice method

    XMLWordPrintable

Details

    Description

      Look at if this is an issue in the cxf integration code.

      From Andrew's post on forum:

      I ran into one other problem which does not break anything immediately but will be an issue for interoperability, specifically with Microsoft. When my services get an incoming request they normally need to hand back an endpoint for a continuation message. If the incoming request arrives via an https scheme URL then the endpoint for the the continuation should be created using an https scheme. So, in the WebMethod implementation I use code as follows to identify the request scheme

      @WebMethod(...)

      public void foo()

      {

      MessageContext ctx = webServiceCtx.getMessageContext();
      HttpServletRequest request = (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST);
      boolean isSecure = "https".equals(request.getScheme());

      . . .

      The problem is that when foo is a OneWay method request.getScheme always returns null. Now this does not break anything (it did when I did the equals test the other way round which is why I spotted it but it does mean that I always think the client is contacting the services via a non-secure URL. Now, Microsoft's WSTX always uses https and it will throw up if handed an http endpont for the continuation message. So, I need a reliable way to obtain the request scheme when the message is OneWay. Any ideas? Or do I have to raise a JIRA feature request for this?

      Attachments

        Activity

          People

            rhn-engineering-ema Jim Ma
            rhn-engineering-ema Jim Ma
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: