當前位置: 首頁>>代碼示例>>PHP>>正文


PHP nusoap_client::setCurlOption方法代碼示例

本文整理匯總了PHP中nusoap_client::setCurlOption方法的典型用法代碼示例。如果您正苦於以下問題:PHP nusoap_client::setCurlOption方法的具體用法?PHP nusoap_client::setCurlOption怎麽用?PHP nusoap_client::setCurlOption使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在nusoap_client的用法示例。


在下文中一共展示了nusoap_client::setCurlOption方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setClientSoap

 /**
  * Permet de mettre en place le client de la requête en fonction du WSDL.
  *
  * @param $urlWsdl
  * @return \nusoap_client
  */
 private function setClientSoap($urlWsdl)
 {
     // Instanciation du client SOAP
     $this->client = new \nusoap_client($urlWsdl, false, false, false, false, false, 0, 1000);
     $this->client->soap_defencoding = 'UTF-8';
     $this->client->decode_utf8 = false;
     // Mise en place des options CURL
     // Option curl
     $this->client->setUseCurl(true);
     // Mise en place du SSl si on l'active
     if ($this->enabledSSL) {
         // Mise en place des données d'authentification SSL
         $certRequest = array('cainfofile' => $this->caChainClientLocation, 'sslcertfile' => $this->certClientLocation, 'sslkeyfile' => $this->privateKeyClientLocation, 'passphrase' => $this->privateKeyClientPassword);
         $this->client->setCredentials('', '', 'certificate', $certRequest);
         $this->client->setCurlOption(CURLOPT_SSLVERSION, 3);
         // @TODO : cette option sera à mettre à true. On utilisera un fichier contenant l'AC Yousign en tant que trustore
         $this->client->setCurlOption(CURLOPT_SSL_VERIFYPEER, false);
     }
     // @TODO : voir comment on lève une exception
     $err = $this->client->getError();
     if ($err) {
         echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
         echo '<h2>Debug</h2><pre>' . htmlspecialchars($this->client->getDebug(), ENT_QUOTES) . '</pre>';
         exit;
     }
     return $this->client;
 }
開發者ID:ConstantSIDJUI,項目名稱:yousign-api-client-php,代碼行數:33,代碼來源:YsApi.php

示例2: inicializarWebService

 function inicializarWebService()
 {
     $proxy = array();
     $proxy['server'] = !is_null($this->proxy) ? $this->proxy->server : false;
     $proxy['port'] = !is_null($this->proxy) ? $this->proxy->port : false;
     $proxy['username'] = !is_null($this->proxy) ? $this->proxy->username : false;
     $proxy['password'] = !is_null($this->proxy) ? $this->proxy->password : false;
     $client = new nusoap_client($this->configuracao->wsdl, false, $proxy['server'], $proxy['port'], $proxy['username'], $proxy['password'], 0, 3000);
     $client->setDebugLevel(9);
     $client->setUseCURL(true);
     if (!is_null($this->certificado)) {
         if (strlen($this->certificado->crt . $this->certificado->key . $this->certificado->pem) > 0) {
             $client->setCurlOption(CURLOPT_SSL_VERIFYPEER, false);
             $client->setCurlOption(CURLOPT_SSL_VERIFYHOST, 2);
             $client->authtype = 'certificate';
             if (strlen($this->certificado->crt) > 0) {
                 $client->certRequest['sslcertfile'] = $this->certificado->crt;
                 # file containing the user's certificate
             }
             if (strlen($this->certificado->key) > 0) {
                 $client->certRequest['sslkeyfile'] = $this->certificado->key;
                 # file containing the private key
             }
             if (strlen($this->certificado->pem) > 0) {
                 $client->certRequest['cainfofile'] = $this->certificado->pem;
                 # file containing the root certificate
             }
         }
     }
     $this->client = $client;
 }
開發者ID:roquebrasilia,項目名稱:sgdoc-codigo,代碼行數:31,代碼來源:include.soap.php

示例3: inicializarWebServiceSOF

function inicializarWebServiceSOF($configuracao)
{
    $proxy = ConfigWs::factory()->getSiopProxyConfig();
    $client = new nusoap_client($configuracao['wsdl_url'], false, $proxy['server'], $proxy['port'], $proxy['username'], $proxy['password'], 0, 3000);
    $client->setDebugLevel(9);
    $client->setUseCURL(true);
    // Verifica se há algum dado de configuração para certificado.
    // Caso houver define o tipo de autenticação para certificate.
    $certificado = ConfigWs::factory()->getSiopCertificateConfig();
    if (strlen($certificado['crt'] . $certificado['key'] . $certificado['pem']) > 0) {
        $client->setCurlOption(CURLOPT_SSL_VERIFYPEER, false);
        $client->setCurlOption(CURLOPT_SSL_VERIFYHOST, 2);
        $client->authtype = 'certificate';
        if (strlen($certificado['crt']) > 0) {
            $client->certRequest['sslcertfile'] = $certificado['crt'];
            # file containing the user's certificate
        }
        if (strlen($certificado['key']) > 0) {
            $client->certRequest['sslkeyfile'] = $certificado['key'];
            # file containing the private key
        }
        if (strlen($certificado['pem']) > 0) {
            $client->certRequest['cainfofile'] = $certificado['pem'];
            # file containing the root certificate
        }
    }
    return $client;
}
開發者ID:roquebrasilia,項目名稱:sgdoc-codigo,代碼行數:28,代碼來源:include.soap.php


注:本文中的nusoap_client::setCurlOption方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。