if (transportContext == null) {
log.warn("Unable to get complete set of http request headers - no transport context available");
return;
}
WebServiceConnection connection = transportContext.getConnection();
if (connection instanceof HttpServletConnection) {
UrlPathHelper pathHelper = new UrlPathHelper();
HttpServletConnection servletConnection = (HttpServletConnection) connection;
message.setHeader(SoapMessageHeaders.HTTP_REQUEST_URI, pathHelper.getRequestUri(servletConnection.getHttpServletRequest()));
message.setHeader(SoapMessageHeaders.HTTP_CONTEXT_PATH, pathHelper.getContextPath(servletConnection.getHttpServletRequest()));
String queryParams = pathHelper.getOriginatingQueryString(servletConnection.getHttpServletRequest());
message.setHeader(SoapMessageHeaders.HTTP_QUERY_PARAMS, queryParams != null ? queryParams : "");
message.setHeader(SoapMessageHeaders.HTTP_REQUEST_METHOD, servletConnection.getHttpServletRequest().getMethod().toString());
} else {
log.warn("Unable to get complete set of http request headers");
try {
message.setHeader(SoapMessageHeaders.HTTP_REQUEST_URI, connection.getUri());
} catch (URISyntaxException e) {
log.warn("Unable to get http request uri from http connection", e);
}
}
}