当前位置: 首页>>代码示例>>PHP>>正文


PHP nusoap_client::setUseCurl方法代码示例

本文整理汇总了PHP中nusoap_client::setUseCurl方法的典型用法代码示例。如果您正苦于以下问题:PHP nusoap_client::setUseCurl方法的具体用法?PHP nusoap_client::setUseCurl怎么用?PHP nusoap_client::setUseCurl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nusoap_client的用法示例。


在下文中一共展示了nusoap_client::setUseCurl方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: ubio_namebank_search

/**
 * @brief Call uBio's SOAP service to find all names that match query.
 *
 * @param Text The name to search for.
 * @param has_authority
 */
function ubio_namebank_search($text, $has_authority = false)
{
    global $config;
    global $db;
    // Maybe we have this already?
    $namebankID = find_ubio_name_in_cache($text, $has_authority);
    if (count($namebankID) > 0) {
        return $namebankID;
    }
    // Not found, so make SOAP call
    $client = new nusoap_client('http://names.ubio.org/soap/', 'wsdl', $config['proxy_name'], $config['proxy_port'], '', '');
    $err = $client->getError();
    if ($err) {
        return $names;
    }
    // This is vital to get through Glasgow's proxy server
    $client->setUseCurl(true);
    $param = array('searchName' => base64_encode($text), 'searchAuth' => '', 'searchYear' => '', 'order' => 'name', 'rank' => '', 'sci' => 1, 'linkedVern' => 1, 'vern' => 1, 'keyCode' => $config['uBio_key']);
    $proxy = $client->getProxy();
    $result = $proxy->namebank_search($param['searchName'], $param['searchAuth'], $param['searchYear'], $param['order'], $param['rank'], $param['sci'], $param['linkedVern'], $param['vern'], $param['keyCode']);
    // Check for a fault
    if ($proxy->fault) {
        //		print_r($result);
    } else {
        // Check for errors
        $err = $proxy->getError();
        if ($err) {
        } else {
            // Display the result
            print_r($result);
            if (isset($result['scientificNames'])) {
                // get the relevant matches
                foreach ($result['scientificNames'] as $r) {
                    if ($has_authority) {
                        $n = strtolower(base64_decode($r['fullNameString']));
                        // Strip punctuation
                        $n = str_replace(",", "", $n);
                        $n = str_replace("(", "", $n);
                        $n = str_replace(")", "", $n);
                        $text = str_replace(",", "", $text);
                        $text = str_replace("(", "", $text);
                        $text = str_replace(")", "", $text);
                    } else {
                        $n = strtolower(base64_decode($r['nameString']));
                    }
                    //echo $n;
                    if ($n == strtolower($text)) {
                        // Store this name
                        array_push($namebankID, $r['namebankID']);
                    }
                    // Store name in cache
                    store_ubio_name($r);
                }
            }
        }
    }
    return $namebankID;
}
开发者ID:rdmpage,项目名称:bioguid,代码行数:64,代码来源:ubio_search.php

示例3: htmlspecialchars

 /**
  * TODO: Get Error Service and show detailed Error Message
  */
 function openmeetings_loginuser()
 {
     global $USER, $CFG;
     //		echo $CFG->openmeetings_red5host."<br/>";
     //		echo $CFG->openmeetings_red5port."<br/>";
     //
     //		echo "USER: ".$CFG->openmeetings_openmeetingsAdminUser."<br/>";
     //		echo "Pass: ".$CFG->openmeetings_openmeetingsAdminUserPass."<br/>";
     //echo "DIRROOT: ".$CFG->dirroot."<br/>";
     $client_userService = new nusoap_client($this->getUrl() . "/services/UserService?wsdl", "wsdl");
     $client_userService->setUseCurl(true);
     //echo "Client inited"."<br/>";
     $err = $client_userService->getError();
     if ($err) {
         echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
         echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
         exit;
     }
     $result = $client_userService->call('getSession');
     if ($client_userService->fault) {
         echo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>';
         print_r($result);
         echo '</pre>';
     } else {
         $err = $client_userService->getError();
         if ($err) {
             echo '<h2>Error</h2><pre>' . $err . '</pre>';
         } else {
             //echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
             $this->session_id = $result["return"]["session_id"];
             //echo '<h2>Result</h2><pre>'; printf(); echo '</pre>';
             $params = array('SID' => $this->session_id, 'username' => $CFG->openmeetings_openmeetingsAdminUser, 'userpass' => $CFG->openmeetings_openmeetingsAdminUserPass);
             //$params = array();
             $result = $client_userService->call('loginUser', $params);
             //echo '<h2>Params</h2><pre>'; print_r($params); echo '</pre>';
             if ($client_userService->fault) {
                 echo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>';
                 print_r($result);
                 echo '</pre>';
             } else {
                 $err = $client_userService->getError();
                 if ($err) {
                     echo '<h2>Error</h2><pre>' . $err . '</pre>';
                 } else {
                     //echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
                     $returnValue = $result["return"];
                     //echo '<h2>returnValue</h2><pre>'; printf($returnValue); echo '</pre>';
                 }
             }
         }
     }
     if ($returnValue > 0) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:Neseek77,项目名称:openmeetings,代码行数:60,代码来源:openmeetings_gateway.php

示例4: _feed_stockbiz

function _feed_stockbiz($method, $url, $params, $debug = true)
{
    global $_services;
    require_once _NUSOAP_ABSPATH_ . 'nusoap.php';
    require_once _NUSOAP_ABSPATH_ . 'class.wsdlcache.php';
    $cache = new wsdlcache(_NUSOAP_CACHE_, 0);
    $wsdl = $cache->get($url);
    if (is_null($wsdl)) {
        $wsdl = new wsdl($url);
        $cache->put($wsdl);
    } else {
        $wsdl->clearDebug();
    }
    $client = new nusoap_client($wsdl, true);
    $client->decode_utf8 = false;
    $client->setUseCurl(false);
    $result = $client->call($method, $params);
    if ($client->fault) {
        if ($debug) {
            echo '<h2>Fault</h2><pre>';
            print_r($result);
            echo '</pre>';
        }
    } else {
        if ($err = $client->getError()) {
            if ($debug) {
                echo '<h2>Error</h2><pre>' . $err . '</pre>';
            }
        } else {
            if (!empty($result)) {
                return $result;
            }
        }
    }
    return false;
}
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:36,代码来源:eps.php

示例5: error

        echo '<h2>WSDL Constructor error (Expect - 404 Not Found)</h2><pre>' . $err . '</pre>';
        echo '<h2>Debug</h2><pre>' . htmlspecialchars($wsdl->getDebug(), ENT_QUOTES) . '</pre>';
        exit;
    }
    $cache->put($wsdl);
} else {
    $wsdl->clearDebug();
    $wsdl->debug('Retrieved from cache');
}
$client = new nusoap_client($wsdl, 'wsdl', $proxyHost, $proxyPort, $proxyUsername, $proxyPassword);
$err = $client->getError();
if ($err) {
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    exit;
}
$client->setUseCurl($useCURL);
$params = array('isbn' => '0060188782');
$result = $client->call('getPrice', $params);
// Check for a fault
if ($client->fault) {
    echo '<h2>Fault</h2><pre>';
    print_r($result);
    echo '</pre>';
} else {
    // Check for errors
    $err = $client->getError();
    if ($err) {
        // Display the error
        echo '<h2>Error</h2><pre>' . $err . '</pre>';
    } else {
        // Display the result
开发者ID:boskee,项目名称:soap,代码行数:31,代码来源:wsdlclient5.php

示例6: connectHkuSoap

function connectHkuSoap($url = EW_HKU_SOAP_SERVER)
{
    global $client;
    $proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
    $proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
    $proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
    $proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
    $useCURL = isset($_POST['usecurl']) ? $_POST['usecurl'] : '0';
    $client = new nusoap_client($url, false, $proxyhost, $proxyport, $proxyusername, $proxypassword);
    $err = $client->getError();
    $client->setUseCurl($useCURL);
    $params = array('login' => EW_CONN_USER_HKU, 'password' => EW_CONN_PASS_HKU);
    $result = $client->call('doLogin', $params, EW_HKU_SOAP_NAMESPACE);
    //, $params, 'http://soap.amazon.com', 'http://soap.amazon.com');
    $session = $result['session'];
    // print_r($session) . '<br>';
    return $session;
}
开发者ID:pezzabros,项目名称:Loki,代码行数:18,代码来源:function.php

示例7: _connect

	/**
	 * Initialize the SOAP client connection.
	 * @param String $endpoint URL to connect.
	 * @return Boolean True if the connection succeed.
	 */
	private function _connect ($endpoint, $proxyhost = null, $proxyport = null, $proxyuser = null, $proxypass = null)
	{
		if (is_null($proxyhost))
			$proxyhost = $this->_soapProxyHost;
		if (is_null($proxyport))
			$proxyport = $this->_soapProxyPort;
		if (is_null($proxyuser))
			$proxyuser = $this->_soapProxyUser;
		if (is_null($proxypass))
			$proxypass = $this->_soapProxyPass;

		$conn = new nusoap_client($endpoint, false, $proxyhost, $proxyport, $proxyuser, $proxypass);
		$err = $conn->getError();
		if ($err)
		{
                        $this->_log->logError($err);
                        $this->_log->logError($conn->getDebug());
			$this->_soapConn = null;
                        return false;
                }
		else
		{
                	$conn->setUseCurl(DEFAULT_NUSOAP_CURLREQUEST);
			$this->_soapConn = $conn;
			return true;
		}
	}
开发者ID:Kervinou,项目名称:OBM,代码行数:32,代码来源:LemonLDAP_SoapConnection.php

示例8: array

 function order_registerdomain($DomainName, $ServiceDetails, $ContactDetails)
 {
     //parametri dell'ordine
     $params = array('LoginEmail' => $this->LoginEmail, 'LoginPassword' => $this->LoginPassword, 'DomainName' => $DomainName, 'ServiceDetails' => $ServiceDetails, 'ContactDetails' => $ContactDetails);
     //Connection parameters
     //do not modify  -   non modificare
     $proxyhost = '';
     $proxyport = '';
     $proxyusername = '';
     $proxypassword = '';
     $useCURL = '0';
     $client = new nusoap_client("http://api.dominiofaidate.com/xml/Order.asmx?WSDL", true);
     $client->soap_defencoding = 'UTF-8';
     $err = $client->getError();
     if ($err) {
         echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
         echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
         exit;
     }
     $client->setUseCurl($useCURL);
     $client->useHTTPPersistentConnection();
     $result = $client->call('RegisterDomain', $params);
     if ($client->fault) {
         echo '<h2>Fault</h2><pre>';
         print_r($result);
         echo '</pre>';
     } else {
         $err = $client->getError();
         if ($err) {
             echo '<h2>Error</h2><pre>' . $err . '</pre>';
         }
     }
     return $result;
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:34,代码来源:Dfdt.class.php

示例9: ubio_findit

/**
 * @brief Call uBio's SOAP service to find all names in text
 *
 * @param Text The text to search.
 */
function ubio_findit($text)
{
    global $config;
    $names = array();
    $client = new nusoap_client('http://names.ubio.org/soap/', 'wsdl', $config['proxy_name'], $config['proxy_port'], '', '');
    $err = $client->getError();
    if ($err) {
        return $names;
    }
    // This is vital to get through Glasgow's proxy server
    $client->setUseCurl(true);
    $param = array('url' => '', 'freeText' => base64_encode($text), 'strict' => 0, 'threshold' => 0.5);
    $proxy = $client->getProxy();
    if (!isset($proxy)) {
        return $names;
    }
    $result = $proxy->findIT($param['url'], $param['freeText'], $param['strict'], $param['threshold']);
    // Check for a fault
    if ($proxy->fault) {
        print_r($result);
    } else {
        // Check for errors
        $err = $proxy->getError();
        if ($err) {
        } else {
            // Display the result
            //print_r($result);
            // Extract names
            $xml = $result['returnXML'];
            if ($xml != '') {
                if (PHP_VERSION >= 5.0) {
                    $dom = new DOMDocument();
                    $dom->loadXML($xml);
                    $xpath = new DOMXPath($dom);
                    $xpath_query = "//allNames/entity";
                    $nodeCollection = $xpath->query($xpath_query);
                    $nameString = '';
                    foreach ($nodeCollection as $node) {
                        foreach ($node->childNodes as $v) {
                            $name = $v->nodeName;
                            if ($name == "nameString") {
                                $nameString = $v->firstChild->nodeValue;
                                $names[$nameString]['nameString'] = $v->firstChild->nodeValue;
                            }
                            if ($name == "score") {
                                $names[$nameString]['score'] = $v->firstChild->nodeValue;
                            }
                            if ($name == "namebankID") {
                                $names[$nameString]['namebankID'] = $v->firstChild->nodeValue;
                            }
                            if ($name == "parsedName") {
                                // Much grief, we need to attribute of this node
                                $n = $v->attributes->getNamedItem('canonical');
                                $names[$nameString]['canonical'] = $n->nodeValue;
                            }
                        }
                    }
                }
            }
            //print_r($names);
            //echo '</pre>';
        }
    }
    //		echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
    //		echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
    //		echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
    return $names;
}
开发者ID:rdmpage,项目名称:bioguid,代码行数:73,代码来源:ubio_findit.php


注:本文中的nusoap_client::setUseCurl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。