doulan3966 2019-04-01 09:41
浏览 97

PHP / Laravel看起来在制作soapcall时我们没有XML文档

I am trying to do a soap call and I keep getting the following error:

looks like we got no XML document

EDIT error message

enter image description here

here's an example that works fine in my SOAP UI

enter image description here

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;
}
  • 写回答

1条回答 默认 最新

  • dtl4521 2019-04-01 09:53
    关注

    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());

    评论

报告相同问题?