public function send(RequestInterface $request)
    {
        // Checking the connection
        if (!$this->connection->isOpened()) {
            throw new LogicException('Cannot send request to the not open connection. Call connect() before send().');
        }

        // Preparing the request
        if (!$request->isBuilt()) {
            $request->build();
        }

        $requestXML = $request->saveXML();
        $this->logger->info('EPP request body.', ['body' => $requestXML]);

        // Sending a request
        $this->connection->write($requestXML);
        $responseXML = $this->connection->read();
        $this->logger->info('EPP response body.', ['body' => $responseXML]);

        // Creating a response
        $responseClass = $request->getResponseClass();
        $response = new $responseClass($responseXML);

        // Handle response in the extension
        foreach ($this->extensionStack as $extension) {
            $this->logger->debug(sprintf('Handle response in \'%s\' extension.', get_class($extension)));
            $extension->handleResponse($response);
        }

        return $response;
    }
public function send(RequestInterface $request)
    {
        // Checking the connection
        if (!$this->connection->isOpened()) {
            throw new LogicException('Cannot send request to the not open connection. Call connect() before send().');
        }

        // Preparing the request
        if (!$request->isBuilt()) {
            $request->build();
        }

        $requestXML = $request->saveXML();
        $this->logger->info('EPP request body.', ['body' => $requestXML]);

        // Sending a request
        $this->connection->write($requestXML);
        $responseXML = $this->connection->read();
        $this->logger->info('EPP response body.', ['body' => $responseXML]);

        // Creating a response
        $responseClass = $request->getResponseClass();
        $response = new $responseClass($responseXML);

        // Handle response in the extension
        foreach ($this->extensionStack as $extension) {
            $this->logger->debug(sprintf('Handle response in \'%s\' extension.', get_class($extension)));
            $extension->handleResponse($response);
        }

        return $response;
    }
public function send ( RequestInterface $ request ) { // Checking the connection if ( ! $ this -> connection -> isOpened ( ) ) { throw new LogicException ( 'Cannot send request to the not open connection. Call connect() before send().' ) ; } // Preparing the request if ( ! $ request -> isBuilt ( ) ) { $ request -> build ( ) ; } $ requestXML = $ request -> saveXML ( ) ; $ this -> logger -> info ( 'EPP request body.' , [ 'body' => $ requestXML ] ) ; // Sending a request $ this -> connection -> write ( $ requestXML ) ; $ responseXML = $ this -> connection -> read ( ) ; $ this -> logger -> info ( 'EPP response body.' , [ 'body' => $ responseXML ] ) ; // Creating a response $ responseClass = $ request -> getResponseClass ( ) ; $ response = new $ responseClass ( $ responseXML ) ; // Handle response in the extension foreach ( $ this -> extensionStack as $ extension ) { $ this -> logger -> debug ( sprintf ( 'Handle response in \'%s\' extension.' , get_class ( $ extension ) ) ) ; $ extension -> handleResponse ( $ response ) ; } return $ response ; }
Send EPP request.

@param RequestInterface $request EPP request

@return ResponseInterface

@throws LogicException
Send EPP request .