Probaj sa ovim:
Code:
<?php
$username = "username";
$password = "password";
$wsdl = https://service1.apr.gov.rs:4430/plwstest/PlService.svc?wsdl;
$location = https://service1.apr.gov.rs:4430/plwstest/PlService.svc;
$client = new SoapClient($wsdl, [
'location' => $location,
'encoding' => 'utf-8',
'trace' => 1,
'exceptions' => true,
'cache_wsdl' => WSDL_CACHE_NONE,
'stream_context' => stream_context_create([
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
],
]),
]);
$auth = '<wsse:Security xmlns:wsse=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd>
<wsse:UsernameToken>
<wsse:Username>'.$username.'</wsse:Username>
<wsse:Password Type=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText>'.$password.'</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>';
$client->__setSoapHeaders(new SoapHeader('http://docs.oasis-open.org/wss...-wss-wssecurity-secext-1.0.xsd', 'Security', new SoapVar($auth, XSD_ANYXML)));
$params = [
'privredniSubjektiUlazniPodaci' => [
'privredniSubjekti' => [
'maticniBroj' => '20869623',
'tip' => '1'
],
],
];
$response = $client->PreuzmiPodatkeOPrivrednomSubjektu($params);
debug($response);
exit();
?>
Stop, Dave…
My mind is going…
I can feel it…
I can feel it…
Stop… Please…
HAL 9000