dataconnect / rdc-vts
RDC VTS-XML
1.0.0
2024-08-27 09:52 UTC
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.5
README
使用PHP构建,用于从基于3.0版本的RDC VTS-XML检索车辆信息
要检索数据,您需要在RDC注册公司并有权访问VTS-XML服务。
备注:此功能仅适用于荷兰注册的牌照的车辆数据
要求
vts-xml可以使用PHP 8.0及以上版本运行。未测试较早版本。
安装
可以使用 Composer 进行安装。
要获取rdw-ovi的最新版本,请使用
composer require dataconnect/rdc-vts
示例
use RdcVts\RdcVtsApiClient;
use RdcVts\RdwVtsException;
// Simulate a POST request
$_POST['licenseplate'] = '123XYZ';
$_POST['mileage'] = 10000;
$licenseplate = strtoupper($_POST['licenseplate'] ?? '');
$mileage = $_POST['mileage'] ?? 1;
$url = 'https://services.rdc.nl/voertuigscan/3.0/wsdl';
$identifier = 'your_number'; // Replace with actual RDC customer number
$username = 'your_username'; // Replace with actual username
$password = 'your_password'; // Replace with actual password
$rdcApiService = new RdcVtsApiClient($url, $identifier, $username, $password);
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
try {
$response = $rdcApiService->getVehicleScan($licenseplate, $mileage);
echo $response;
} catch (RdwVtsException $e) {
echo json_encode(['error' => true, 'message' => $e->getMessage()]);
}
} else {
echo json_encode(['error' => true, 'message' => 'Invalid request method']);
}
支持
想要支持我们的工作?非常欢迎捐赠: https://buymeacoffee.com/dataconnect
联系方式
请随时联系我们,如果可能的话,添加选项!