Skip to content

Instantly share code, notes, and snippets.

@jakubboucek
Created July 25, 2022 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakubboucek/de9652d2573f694e45d8bbc9ed3a3fc5 to your computer and use it in GitHub Desktop.
Save jakubboucek/de9652d2573f694e45d8bbc9ed3a3fc5 to your computer and use it in GitHub Desktop.
Subreg.cz SOAP request /w Bearer token
<?php
$token = 'FILL/YOUR/TOKEN/HERE+FILL/YOUR/TOKEN/HERE='; // <-- Fill it
$context = stream_context_create([
'http' => [
'protocol_version' => 1.1,
'header' => "Authorization: Bearer {$token}",
],
]);
$client = new SoapClient(
null,
[
'location' => 'https://soap.subreg.cz/cmd.php',
'uri' => 'https://soap.subreg.cz/soap',
'soap_version' => SOAP_1_2,
'stream_context' => $context,
'trace' => 1,
]
);
try {
$responseContent = $client->__soapCall(
'Domains_List',
['data' => []]
);
var_dump($responseContent);
} catch (SoapFault $e) {
var_dump($e);
}
var_dump($client);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment