Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2911

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.9
    • 2.3
    • WS-* Components
    • None

    Description

      When this SEI is deployed in tomcat , the httpServletRequest.getScheme() returns null value:

      @Addressing(required=true)
      @WebService(serviceName = "SOAPService", endpointInterface = "org.apache.hello_world.Greeter", targetNamespace = "http://apache.org/hello_world")
      public class GreeterImpl implements Greeter {

      @Resource
      WebServiceContext wscontext;
      private String myName;

      public GreeterImpl()

      { this("defaultGreeter"); }

      public GreeterImpl(String name)

      { myName = name; }

      public String greetMe(String me)

      { return "Hello " + me; }

      public String sayHi()

      { return "Bonjour from " + myName; }

      public void pingMe()

      { MessageContext msgContext = wscontext.getMessageContext(); HttpServletRequest httpServletRequest = (HttpServletRequest)msgContext.get(MessageContext.SERVLET_REQUEST); System.out.println(httpServletRequest.getScheme()); }

      }

      From the code , the WSA interceptor will create another thread to run the serviceInvoker interceptor and servlet thread (receives the http request) will cleanup the request information.
      The serviceInvoker in the new created thread always get null value from schemeMB.

      package org.apache.coyote;
      public final class Request{
      public void recycle()

      { bytesRead=0; contentLength = -1; contentTypeMB = null; charEncoding = null; headers.recycle(); serverNameMB.recycle(); serverPort=-1; localPort = -1; remotePort = -1; available = 0; cookies.recycle(); parameters.recycle(); unparsedURIMB.recycle(); uriMB.recycle(); decodedUriMB.recycle(); queryMB.recycle(); methodMB.recycle(); protoMB.recycle(); schemeMB.recycle(); instanceId.recycle(); remoteUser.recycle(); authType.recycle(); attributes.clear(); }

      }

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: