webdConfig.getTimeoutInMillis());
requestOperation.setTimeout(timeout);
// This is necessary in order for the request process to be
// able to pick up the headers, parameters, cookies etc.
WebDriverAccessor webdAccessor = createWebDriverAccessor(
createWebDriverRequest(httpRequest,
marinerRequestContext,
remoteProjectName,
urlRemapper),
new WebDriverResponseImpl());
pipelineContext.setProperty(WebDriverAccessor.class,
webdAccessor , false);
ProxySessionIdOperationProcess proxySessionOperationProcess =
new ProxySessionIdOperationProcess();
XMLProcess urlRewriterProcess =
createURLRewriterProcess(httpRequest.getContextPath(),
urlRemapper);
// Add them to the pipeline, which will start the processes.
if (transformURL != null) {
AttributesImpl atts = new AttributesImpl();
atts.addAttribute("", "href", "href", "string", transformURL);
pipeline.getPipelineProcess().startElement(Namespace.PIPELINE.getURI(),
"transform",
"transform",
atts);
}
pipeline.addHeadProcess(urlRewriterProcess);
pipeline.addHeadProcess(proxySessionOperationProcess);
pipeline.addHeadProcess(requestOperation);
// Removing them from the pipeline will stop the processes.
pipeline.removeHeadProcess();
pipeline.removeHeadProcess();
pipeline.removeHeadProcess();
if (transformURL != null) {
pipeline.getPipelineProcess().endElement(Namespace.PIPELINE.getURI(),
"transform",
"transform");
}
// FLush and close the stream.
outputStream.flush();
outputStream.close();
// Do this so that the pipeline is in a balanced state, despite
// the fact that AT THE MOMENT no one else using this pipeline.
pipelineContext.popBaseURI();
WebDriverResponse webdResponse =
webdAccessor.getResponse(pipelineContext, null );
if (! webdResponse.getContentType().equals("x-application/vnd.xdime+xml")) {
throw new RuntimeException(EXCEPTION_LOCALIZER.format(
"remote-resource-with-incorrect-contenttype", new Object[]{