marcoboom/voertuigdata

Voertuidata.nl SOAP webservice 的 PHP 包装器

1.0 2015-03-30 16:38 UTC

This package is not auto-updated.

Last update: 2024-09-14 16:19:27 UTC


README

Voertuidata.nl SOAP webservice 的 PHP 包装器

安装和需求

首先,您需要使用 Composer 需求该软件包

$ composer require marcoboom/voertuigdata

此软件包需要安装 PHP 5.4 和 SOAP

使用方法

首先,创建 Voertuigdata 类的一个实例

$vd = new Voertuigdata\Voertuigdata('username', 'password');

将用户名和密码替换为提供的账户。

可选地,您可以将选项数组作为第三个参数传递

$options = [
	'environment' 	=> 	'production',
	'cache_wsdl' 	=> 	WSDL_CACHE_NONE
];

如果没有传递环境选项,则类将搜索 ENVIRONMENT 常量。如果不等于生产环境,则将使用 Voertuigdata 的测试环境。

调用

在实例中,您可以调用定义在 http://www.voertuigdata.nl/soap/voertuigservice.asmx 的 webservice 中的方法。方法参数应通过数组发送。

每个方法都返回 webservice 给出的原始对象。

如果调用失败,它将抛出 VoertuigdataException。

try {
	$result = $vd->getPersonenautoInformatieMiddelsKenteken(['Kenteken'=>'56RPFV']);

	var_dump($result);

} catch (Voertuigdata\VoertuigdataException $e) {

	var_dump($e->getMessage());

}