dmt-software / webservices-client
An implementation of the CompanyInfo WebservicesNl data integration
Requires
- php: ^7.1
- ext-curl: *
- ext-dom: *
- ext-json: *
- ext-simplexml: *
- dmt-software/command-bus-validator: ^1.0
- dmt-software/jms-soap-serializer: ^1.0
- doctrine/cache: ^1.7
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: ^7.2
- symfony/dotenv: ^4.1
Suggests
- dmt-software/webservices-dutchbusiness: Enables the DutchBusiness service methods
This package is auto-updated.
Last update: 2024-12-12 08:26:34 UTC
README
A generic client for consuming the services from CompanyInfo - WebservicesNl.
Installation
composer require dmt-software/webservices-client
Service packages
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.
Usage
Create a Client
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.
Make a service call using a request
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
.
Call a service method directly
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']);
Services
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:
Protocols
Currently this package supports the WebservicesNl endpoint for:
- soap
- soap_doclit