public function request($name, array $arguments, array $options = null, $inputHeaders = null)
    {
        $soapRequest = $this->interpreter->request($name, $arguments, $options, $inputHeaders);
        if ($soapRequest->getSoapVersion() == '1') {
            $this->builder->isSOAP11();
        } else {
            $this->builder->isSOAP12();
        }
        $this->builder->setEndpoint($soapRequest->getEndpoint());
        $this->builder->setSoapAction($soapRequest->getSoapAction());

        $stream = new Stream('php://temp', 'r+');
        $stream->write($soapRequest->getSoapMessage());
        $stream->rewind();
        $this->builder->setSoapMessage($stream);

        try {
            return $this->builder->getSoapHttpRequest();
        } catch (RequestException $exception) {
            $stream->close();
            throw $exception;
        }
    }