dev-master
9999999-devAfas client for an easy soap connection.
The Requires
- php >=5.5.9
- wyz/practicalafas dev-master
- fergusean/nusoap ^0.9.5
Afas client for an easy soap connection.
AfasClient is a package to make easy soap requests. For now this only supports NuSoap requests and removes NTLM authentication and CURL login. Later on this wil be configurable., (*1)
First you have to "configure" AfasClient to make a call. You can do this by adding the information in an array in a new AfasClient object., (*2)
$this->afas = new AfasClient([ 'urlBase' => 'https://example.com/profitservices/', 'environmentId' => 'YourEnviromentId', 'useWSDL' => TRUE, 'userId' => 'YourUserId', 'password' => 'YourPassword', ]);
To make the call you have to construct a query. This will be done by chaining functions. The functions you can use are: * range * filter * orderBy * option, (*3)
$query = $this->afas->get('some_connector') ->range(10, 10) // Take 10, Skip 10. ->filter('title', 'WIP:%', AfasClient::OP_STARTS_WITH) // Title starts with "WIP:". ->orderBy('title', AfasClient::OP_ASC) // Order by title ascending. ->option('Outputmode', AfasClient::GET_OUTPUTMODE_ARRAY) // Return array.
Finnaly you want to make the call., (*4)
$result = $query->execute();
You can install this package with composer by executing
$ composer install vdmi/afas-client
., (*5)
Afas client for an easy soap connection.