gianluca-pettenon / soap-totvs
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 3
Open Issues: 0
pkg:composer/gianluca-pettenon/soap-totvs
Requires
- php: >=8.4
- laminas/laminas-soap: ^2.13
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.0
This package is auto-updated.
Last update: 2026-01-18 14:26:54 UTC
README
Requirements
PHP>=8.4Composer- Enabled
SOAPextension (php-soap)
Installation
Require the package in your project:
composer require gianluca-pettenon/soap-totvs
Configuration
The SOAP adapter reads the following environment variables:
WSHOST– base URL of the TOTVS server (for example:https://localhost:8051)WSUSER– web service userWSPASS– web service password
You can use any environment management solution (like vlucas/phpdotenv) in your application
to load these variables into the environment before creating the TotvsGateway.
Usage Overview
The main entry point of this SDK is TotvsGateway, which exposes dedicated gateways for each web service:
query()– SQL Query Web Serviceprocess()– Process Web ServicedataServer()– DataServer Web Service
Example of basic bootstrap:
use SoapTotvs\TotvsGateway; use SoapTotvs\Adapters\LaminasAdapter; $gateway = new TotvsGateway( adapter: new LaminasAdapter() );
SQL Query Web Service
use SoapTotvs\TotvsGateway; use SoapTotvs\Adapters\LaminasAdapter; use SoapTotvs\Enums\{ SystemEnum, AffiliateEnum }; $gateway = new TotvsGateway( adapter: new LaminasAdapter() ); $result = $gateway->query()->execute( sentence: 'Example.001', affiliate: AffiliateEnum::DEFAULT, system: SystemEnum::EDUCATIONAL, parameters: ['cdUser' => 1302] );
Process Web Service
use SoapTotvs\TotvsGateway; use SoapTotvs\Adapters\LaminasAdapter; $gateway = new TotvsGateway( adapter: new LaminasAdapter() ); $result = $gateway->process()->execute( process: 'ProcessName', xml: '<Parameters></Parameters>' );
DataServer Web Service
use SoapTotvs\TotvsGateway; use SoapTotvs\Adapters\LaminasAdapter; use SoapTotvs\Enums\ContextEnum; $gateway = new TotvsGateway( adapter: new LaminasAdapter() ); // SaveRecord $save = $gateway->dataServer()->saveRecord( dataServer: 'DataServerName', context: ContextEnum::DEFAULT, xml: '<Data></Data>' ); // ReadRecord $record = $gateway->dataServer()->readRecord( dataServer: 'DataServerName', context: ContextEnum::DEFAULT, primaryKey: 123 ); // ReadView $view = $gateway->dataServer()->readView( dataServer: 'ViewName', context: ContextEnum::DEFAULT, filter: 'FIELD = 1' );
Further Documentation
For details about specific parameters, constraints and behaviors of each web service, refer to the official TOTVS documentation.
Each class under SoapTotvs\WebServices contains a link to the corresponding TOTVS docs.