dmt-software/webservices-client

An implementation of the CompanyInfo WebservicesNl data integration

v0.1.0 2018-12-10 21:38 UTC

This package is auto-updated.

Last update: 2024-11-12 08:19:51 UTC


README

Build Status Scrutinizer Code Quality Code Coverage

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 GetDossierV3Requestnoticing 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