<?php
i$usuario = "jorge.justino";
$senha = "e9ebc6f0a8debddbd95ddbf74gf9h660a0327d63c87892c58544540ea73d188a3cc";
$voucher = "001fd7d28f18";
$nome = "Jorge Justino";
$cpfcnpj = "72925515134";
$restrito = "false";
$key = $senha;
$nonce = time() . rand(1000, 9999);
$hkey = $nonce . $key;
$hash_hkey = hash("sha256", $hkey);
$dados = $usuario . $nonce . $voucher . $nome . $cpfcnpj . $restrito;
$hash_hkey_dados = hash("sha256", $hkey . $dados);
$hmac = hash("sha256", $hash_hkey . $hash_hkey_dados);
try {
$soap = new SoapClient("https://gvshom.ca.inf.br/GVS/webservices/GVSServices.jws?wsdl", array(
'trace' => 1,
'soap_version' => SOAP_1_2,
'cache_wsdl' => WSDL_CACHE_NONE,
'stream_context' => stream_context_create(
array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false
))))
);
$jsonReq = array(
'usuario' => $usuario,
'nonce' => $nonce,
'voucher' => $voucher,
'sugestao' => $nome,
'cpf-cnpj' => $cpfcnpj,
'restrito' => $restrito,
'Hmac' => $hmac
);
$resposta = call_user_func_array(array($soap, 'sugestaodeusovoucher'), $jsonReq);
echo ($resposta);
} catch (Exception $e) {
echo $e->getMessage();
}