title: How do I get the request URL for message headers
body: <p>I have an inbound gateway to process JSON payloads.  Since we utilize the same backend service as our SOAP endpoints, I need to have an inbound gateway that maps to all paths.  I can see the default HTTP headers come across the into the message, but I specifically need the request URL so I can parse it and route to the appropriate serve as needed.</p>
  
  <p>My inbound-gateway:</p>
  
  <pre><code>&lt;int-http:inbound-gateway id="JSONGateway"
          path="*" request-channel="JSONRequestChannel" supported-methods="POST"
          reply-timeout="5000" 
          header-mapper="headerMapper"
          request-payload-type="java.lang.String" &gt;
  &lt;/int-http:inbound-gateway&gt;
  </code></pre>
  
  <p>I tried adding a header-enricher like I do for SOAP, but the TransportContextListener is null.</p>
  
  <pre><code>&lt;int:header-enricher input-channelJSONequestChannel"
      output-channel="JSONRequestChannelWithHeaders"&gt;
  
      &lt;int:header name="service"
          expression="T(org.springframework.ws.transport.context.TransportContextHolder).transportContext.connection.uri.toString().substring(T(org.springframework.ws.transport.context.TransportContextHolder).transportContext.connection.uri.toString().lastIndexOf('/')+1)" /&gt;
  &lt;/int:header-enricher&gt;
  </code></pre>
  
  <p>I need a way to get the URL of the request so I can parse out the service into the message headers for my downstream router.</p>
  
  <pre><code>/json/ContactService = "ContactService"
  /json/ContactService/insert = "ContactService"
  /json/ContactService/get/234 = "ContactService"
  </code></pre>
  
  <p>I also tried adding a header-mapper class, but still run into the same problem.  How can I get a handle to the HTTPServletRequest in code?  Once I get that I can get all the headers I need.</p>