所以我知道有很多关于这个问题的问题,但每个问题都适用于标题。我有一个没有标头的 SOAP 请求:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="https://www.onderdelenlijn.nl/services/cars/v2.asmx">
<soapenv:Header/>
<soapenv:Body>
<v2:airbags_get>
<v2:credentials>
<!--Optional:-->
<v2:username>admin</v2:username>
<!--Optional:-->
<v2:password>adminpass</v2:password>
</v2:credentials>
</v2:airbags_get>
</soapenv:Body>
</soapenv:Envelope>
我正在尝试使用以下代码通过正文进行身份验证:
<?php
$client = new SoapClient('https://www.onderdelenlijn.nl/services/cars/v2.asmx?wsdl');
$soapmessage = [
'credentials' => [
'username' => 'admin',
'password' => 'adminpass'
]
];
$result = $client->airbags_get($soapmessage);
print_r($result);
?>
需要明确的是:正常的SOAP请求需要在标头中进行身份验证,我没有?
错误:未捕获的肥皂保险箱异常:[客户端] SOAP 错误:编码:对象没有“参数”属性
y
料青山看我应如是