1 回答
TA贡献1772条经验 获得超8个赞
您在 soap 消息中缺少预期值:parameters
$soapmessage = [
'credentials' => [
'username' => 'admin',
'password' => 'adminpass'
],
// Add this
'parameters' => [
'culture' => 'en',
'airbagid' => 1,
],
];
如果您查看 soap URL,则可以看到示例请求:
<soap:Body>
<airbags_get xmlns="https://www.onderdelenlijn.nl/services/cars/v2.asmx">
<credentials>
<username>string</username>
<password>string</password>
</credentials>
<parameters>
<culture>nl or en or de or fr or es or pl</culture>
<airbagid>int</airbagid>
</parameters>
</airbags_get>
</soap:Body>
因此,您的完整代码将如下所示:
$client = new SoapClient('https://www.onderdelenlijn.nl/services/cars/v2.asmx?wsdl');
$soapmessage = [
'credentials' => [
'username' => 'admin',
'password' => 'adminpass'
],
'parameters' => [
'culture' => 'en',
'airbagid' => 1,
],
];
$result = $client->airbags_get($soapmessage);
print_r($result);
- 1 回答
- 0 关注
- 72 浏览
添加回答
举报