I am trying to do a soap call and I keep getting the following error:
looks like we got no XML document
here's an example that works fine in my SOAP UI
Here's my array that I send to my soapCall:
$params = [
'id' => '0000002721',
'options' => [
'returnAttachments' => 'false',
'returnPictures' => 'false',
'returnContract' => 'false'
]
];
Here is the code how I make the soap call
try {
$options = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
$context = stream_context_create($options);
$soapClient = new SoapClient(__DIR__ . '/Soap.wsdl', [
'stream_context' => $context,
'login' => 'login',
'password' => 'password',
'trace' => 1,
'exceptions' => true,
]);
$soapClient->__setLocation('url');
$this->soapClient = $soapClient;
} catch (\SoapFault $e) {
var_dump($e); exit;
}
try {
$result = $this->soapClient->__soapCall('getMaintenanceObject', $params);
} catch (\SoapFault $e) {
var_dump($e); exit;
}
SoapClient can be not very expressive when it comes to displaying the errors, add this:
var_dump($this->soapClient->__getLastRequestHeaders());
var_dump($this->soapClient->__getLastResponseHeaders());