A generic client for consuming the services from CompanyInfo - WebservicesNl.
composer require dmt-software/webservices-client
Install a service package using composer:
composer require dmt-software/webservices-dutchbusiness
After installation all of the service methods become available in this client. See Services for a complete list of supported services.
Create a client for communication with CompanyInfo - WebservicesNl.
<?php
use DMT\WebservicesNl\Client\Factory\ClientFactory;
$credentials = ['username' => '{username}', 'password' => '{password}'];
$client = ClientFactory::createClient('soap_doclit', $credentials);
In this case a client is returned for communication with the soap_doclit
endpoint.
See Protocols for all supported endpoints.
The client uses a CommandBus to delegate a request to a handler that can process it.
<?php
use DMT\WebservicesNl\Client\Client;
use DMT\WebservicesNl\DutchBusiness\Request\GetDossierV3Request;
use DMT\WebservicesNl\DutchBusiness\Response\GetDossierV3Response;
$request = new GetDossierV3Request();
$request->setDossierNumber('34221165');
/** @var Client $client */
/** @var GetDossierV3Response $response */
$response = $client->execute($request);
This example sends a GetDossierV3Request
noticing to the DutchBusiness service
and returns a GetDossierV3Response
.
Alternatively the client accepts a direct service method call with an array of arguments. This functionality is similar to the native SoapClient behaviour.
NOTE: The requests created from your call, might be erroneous without notice. This makes it hard to debug.
<?php
use DMT\WebservicesNl\Client\Client;
/** @var Client $client */
$response = $client->dutchBusinessGetDossierV3(['dossier_number' => '34221165']);
Goal is to support as many services as WebservicesNl provides. If the service you are looking for isn't available, feel free to leave a feature request.
The services that can be installed are:
Currently this package supports the WebservicesNl endpoint for:
- soap
- soap_doclit