@param       $method
@param array $params

@return mixed
@throws \Exception
@throws \SoapFault
970151
public function call($method, Array $params = [])
    {
        $rawResult = parent::call($method, $params);

        switch ($method) {
            case 'GetCarBrandAndModel':
                $result = $rawResult->GetCarBrandAndModelReturn->MakeModelBean;
            break;

            case 'GetCarBrand':
                $result = $rawResult->GetCarBrandReturn->x_car_brand->string;
        }

        return $result;
    }
980673
public static function sendRequest($method = 'sendMessage', $params)
    {
        $curl = curl_init(self::$api_url . self::$api_token . '/'. $method);
        curl_setopt($curl, CURLOPT_HEADER, false);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_POST, 1);
        curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($params));
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

        if(self::$proxy) {
            curl_setopt_array($curl, self::setProxy());
        }

        $curl_result = curl_exec($curl);
        $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
        curl_close($curl);

        if ($http_code != 200) {
            if ($curl_result) {
                $curl_result = json_decode($curl_result, true);
                throw new \Exception($curl_result['description']);
            }
            throw new \Exception('an error was encountered');
        }

        return $curl_result;
    }
792742
public function api($method, $params = array())
    {
        if (!in_array($method, $this->supportedUnitpayMethods)) {
            throw new UnexpectedValueException('Method is not supported');
        }

        if (isset($this->requiredUnitpayMethodsParams[$method])) {
            foreach ($this->requiredUnitpayMethodsParams[$method] as $rParam) {
                if (!isset($params[$rParam])) {
                    throw new InvalidArgumentException('Param '.$rParam.' is null');
                }
            }
        }

        $params['secretKey'] = $this->secretKey;
        if (empty($params['secretKey'])) {
            throw new InvalidArgumentException('SecretKey is null');
        }

        $requestUrl = self::API_URL . '?' . http_build_query([
            'method' => $method,
            'params' => $params
        ], null, '&', PHP_QUERY_RFC3986);

        $response = json_decode(file_get_contents($requestUrl));
        if (!is_object($response)) {
            throw new InvalidArgumentException('Temporary server error. Please try again later.');
        }

        return $response;
    }
70552
final public static function execute(Parameters $params) {

        $asked_method = $params->get('method');

        $method = $params->methods()->get($asked_method);

        if ( is_null($method) ) throw new RpcException("Method not found", -32601);

        return $method->getDescription();

    }
1363640
private function send (string $method, array $params)
		{

			$request = xmlrpc_encode_request($method, $params);

			$context = stream_context_create([ 'http' => [
				'method'  => "GET",
				'header'  => "Content-Type: text/xml",
				'content' => $request
			] ]);

			$file = file_get_contents($this->_url, false, $context);

			return xmlrpc_decode($file);
		}
1244851
public function request($method, $params = [])
    {
        $response = $this->client->post($this->getUrl($method), ['query' => $params]);

        if ($response->getStatusCode() === 200) {
            return (string)$response->getBody();
        } else {
            throw new Exception(sprintf('Sms.ru problem. Status code is %s', $response->getStatusCode()), $response->getStatusCode());
        }
    }
234402
public function query($method, array $params = [])
    {
        $rpc = $this->get();
        if (null === $rpc) {
            throw new RPCException(
                "No JsonRPCInterface instances available in the pool."
            );
        }

        return $rpc->query($method, $params);
    }
882354
public function getStats($method, $params = [])
    {
        $resource = 'campaigns/' . $this->campaignId . '/stats/' . $method . '.json';
        $resource .= '?' . http_build_query($params);

        $response = $this->sendRequest('GET', $this->getServiceUrl($resource));

        $decodedResponseBody = $this->getDecodedBody($response->getBody());

        $getStatsResponse = new Models\GetStatsResponse($decodedResponseBody);
        return $getStatsResponse->getMainStats();
    }
844969
public function call($method, array $params = array(), $format = 'php')
    {
        $params['method']       = $method;
        $params['token_auth']   = $this->token;
        $params['format']       = $format;

        $data = $this->getConnection()->send($params);

        if ('php' === $format) {
            $object = unserialize($data);

            if (isset($object['result']) && 'error' === $object['result']) {
                throw new Exception($object['message']);
            }

            return $object;
        } else {
            return $data;
        }
    }
541326
public function call($method, $params=[]) {
    $header = $this->generateWSSecurityHeader($this->user, $this->password);
    $response = $this->__soapCall($method, sizeof($params) > 0 ? [$params] : [], null, $header);
    // in document/literal style the "return" parameter holds the result
    return property_exists($response, 'return') ? $response->return : $response;
  }
451644
protected function request($api, array $params, $method = 'post')
    {
        $params = array_filter($params);
        $params['mch_id'] = $this->merchant->merchant_id;
        $params['nonce_str'] = uniqid();
        $params['sign'] = \EntWeChat\Payment\generate_sign($params, $this->merchant->key, 'md5');

        $options = [
            'body'    => XML::build($params),
            'cert'    => $this->merchant->get('cert_path'),
            'ssl_key' => $this->merchant->get('key_path'),
        ];

        return $this->parseResponse($this->getHttp()->request($api, $method, $options));
    }
401339
private function _request(string $method, array $params = [], array $optional = [])
    {
        $url = $this->_parseUrl($method, $params + $optional);
        if ($url === false) {
            throw new InvalidRequestException('Could not parse URL!');
        }

        $req = Request::get($url);
        $req->strict_ssl = $this->_verifySsl;
        $req->max_redirects = $this->_maxRedirects;
        $req->setConnectionTimeout(5);

        try {
            $buffer = $req->send();
        } catch (ConnectionErrorException $e) {
            throw new InvalidRequestException($e->getMessage(), $e->getCode(), $e);
        }

        if (!empty($buffer)) {
            try {
                return $this->_finishResponse($this->_parseResponse($buffer), $method, $params + $optional);
            } catch (InvalidResponseException $e) {
                throw new InvalidRequestException($e->getMessage(), $e->getCode(), $e);
            }
        }

        throw new InvalidRequestException('Empty response!');
    }
1268417
public function api($url, $method, array $params = [], array $headers = [])
    {
        try {
            return $this->sendRequest($method, $url, $params, $headers);
        } catch (\Exception $e) {
            sleep(2);
            return $this->sendRequest($method, $url, $params, $headers);
        }
    }
450658
public static function invokeSoap($wsdlURL, $method,
                                      array $params = array(),
                                      array $options = array())
    {
        try {
            $soapClient = new \SoapClient($wsdlURL, $options);
            $result     = $soapClient->$method($params);
        } catch (\SoapFault $ex) {
            $result = false;
        }
        return $result;
    }
211149
public function pay($method, array $params)
    {
        $method = get_class($this) . '\\' . Str::uFirst($method) . 'Gateway';
        if (!class_exists($method)) {
            throw new \Exception('支付方式类[' . $method . ']不存在');
        }
        $app = new $method($params);
        return $app->pay();
    }
629329
public function callAction($method, $parameters)
    {
        $response = $parentResponse = null;

        try {
            $response = $parentResponse = parent::callAction($method, $parameters);
        } catch (\Exception $e) {
            $notFoundExceptions = array(
                'Illuminate\\Database\\Eloquent\\ModelNotFoundException',
                'Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException',
            );
            $errorExceptions = array(
                'Subbly\\Api\\Service\\Exception',
            );

            if (in_array(get_class($e), $notFoundExceptions)) {
                return $this->jsonNotFoundResponse($e->getMessage());
            } elseif (in_array(get_class($e), $errorExceptions)) {
                return $this->jsonErrorResponse($e->getMessage());
            } elseif ($e instanceof \Subbly\Model\Exception\UnvalidModelException) {
                return $this->jsonErrorResponse($e->firstErrorMessage());
            }

            $response = $this->jsonErrorResponse('Fatal error!');
        }

        if (App::environment('local', 'testing')) {
            return $parentResponse ?: parent::callAction($method, $parameters);
        }

        return $response;
    }
122721
public function request($method, $url, $params = null, $headers = [])
    {
        $headers = array_merge(self::defaultHeaders(), $headers);
        $absUrl = $this->apiBase . $url;
        return $this->httpClient()->request($method, $absUrl, $params, $headers);
    }