本文整理汇总了PHP中nusoap_client::setUseCURL方法的典型用法代码示例。如果您正苦于以下问题:PHP nusoap_client::setUseCURL方法的具体用法?PHP nusoap_client::setUseCURL怎么用?PHP nusoap_client::setUseCURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nusoap_client
的用法示例。
在下文中一共展示了nusoap_client::setUseCURL方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: array
//29260
//$arrCodSiorg = array('17125', '17125', '29260', '29260');
$arrCodSiorg = array('17125');
$exercicio = '2014';
$configWs = array('wsdl_url' => 'https://testews.siop.gov.br/services/WSQualitativo?wsdl', 'namespace' => 'http://servicoweb.siop.sof.planejamento.gov.br/', 'usuario' => 'WS-SGDOC', 'senha' => 'eebeca4ba6657c201d96cd06bec548a1', 'perfil' => '32');
$proxy = array('server' => false, 'port' => false, 'username' => false, 'password' => false);
$bolUtf = false;
foreach ($arrCodSiorg as $codigoSiorg) {
$orgaosParametros = array('credencial' => array('perfil' => $configWs['perfil'], 'senha' => $configWs['senha'], 'usuario' => $configWs['usuario']), 'exercicio' => $exercicio, 'codigoSiorg' => $codigoSiorg);
echo "\n\nBuscando o orgao: {$codigoSiorg}, " . ($bolUtf ? 'com' : 'sem') . " UTF8\n\n";
echo "Criando cliente para o WebService {$configWs['wsdl_url']}.....";
$client = new nusoap_client($configWs['wsdl_url'], false, $proxy['server'], $proxy['port'], $proxy['username'], $proxy['password'], 0, 3000);
//$client = new nusoap_client($configWs['wsdl_url'], 0, 3000 );
//$client->setHTTPProxy($proxy['server'], $proxy['port']);
$client->setDebugLevel(9);
$client->setUseCURL(true);
$client->decode_utf8 = $bolUtf;
$bolUtf = !$bolUtf;
testarErroNuSoap($client);
echo "[ OK ]\n";
echo "Chamando o método 'obterOrgaoPorCodigoSiorg(codigoSiorg={$codigoSiorg}, exercicio={$exercicio})'.....\n";
$result = $client->call('obterOrgaoPorCodigoSiorg', $orgaosParametros, $configWs['namespace']);
echo "Validando o retorno.....";
testarErroNuSoap($client);
echo "[ OK ]\n";
echo "Obtendo registros.....";
$registros = array();
if (array_key_exists('registros', $result)) {
if (isset($result['registros'][0])) {
$registros = $result['registros'];
} else {
示例3: getPrecoNusoap
/**
*
* @param type $params
* @param type $hash
* @return boolean
*/
private function getPrecoNusoap($params, $hash)
{
require_once 'vendor/lib/nusoap.php';
$nusoap = new nusoap_client($this->_urlWebservice, 'wsdl');
$nusoap->setUseCURL(true);
$result = $nusoap->call("CalcPreco", $params);
if (intval($result['CalcPrecoResult']['Servicos']['cServico']['Erro']) !== 0) {
$this->setCache($hash, false);
return false;
} else {
return (double) str_replace(",", ".", $result['CalcPrecoResult']['Servicos']['cServico']['Valor']);
}
}
示例4: 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;
}