Skip to content

Instantly share code, notes, and snippets.

@asimpkin
Last active December 10, 2015 21:48
Show Gist options
  • Save asimpkin/4497344 to your computer and use it in GitHub Desktop.
Save asimpkin/4497344 to your computer and use it in GitHub Desktop.
SN Soap Client Failure
<?
require_once('class.Record.php');
require_once('Class.SoapClient.php');
/*
# Happy Kitty
$clientOptions = array(
'login' => 'admin',
'password' => 'admin',
'instance' => 'demo013',
'debug' => TRUE,
'tableName' => 'incident'
);
$sys_id = '9d385017c611228701d22104cc95c371';
*/
# Sad Kitty :(
$clientOptions = array(
'login' => 'snc_discovery_user',
'password' => '*********',
'instance' => 'central1dev',
'debug' => TRUE,
'tableName' => 'incident'
);
$sys_id = '2c6b466fec1a7000b5030d07148970e8';
$client = new SNSoapClient($clientOptions);
$data = $client->getRecords(array('sys_id'=>$sys_id));
?><pre><?
print_r($data);
/*
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://central1dev.service-now.com/incident.do?WSDL&displayvalue=all' : failed to load external entity "https://central1dev.service-now.com/incident.do?WSDL&displayvalue=all" in /var/www/soap/Class.SoapClient.php:212 Stack trace: #0 /var/www/soap/Class.SoapClient.php(212): SoapClient->SoapClient('https://central...', Array) #1 /var/www/soap/test.php(24): SNSoapClient->__construct(Array) #2 {main} thrown in /var/www/soap/Class.SoapClient.php on line 212
*/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment