PHPackages                             gianluca-pettenon/soap-totvs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. gianluca-pettenon/soap-totvs

ActiveLibrary

gianluca-pettenon/soap-totvs
============================

1.0.0(3mo ago)5113MITPHPPHP &gt;=8.4CI passing

Since Jan 17Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/gianluca-pettenon/soap-totvs)[ Packagist](https://packagist.org/packages/gianluca-pettenon/soap-totvs)[ RSS](/packages/gianluca-pettenon-soap-totvs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

 [![PHP version](https://camo.githubusercontent.com/10adc1cd2a4567edfb1ef59dbd13feb1a8cc672c01cf9f6ffa660a81c9a895aa/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d706870266d6573736167653d382e3426636f6c6f723d313831383142266c6162656c436f6c6f723d353335344644)](https://camo.githubusercontent.com/10adc1cd2a4567edfb1ef59dbd13feb1a8cc672c01cf9f6ffa660a81c9a895aa/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d706870266d6573736167653d382e3426636f6c6f723d313831383142266c6162656c436f6c6f723d353335344644) [![Code Coverage](https://camo.githubusercontent.com/9bb6cff427f5b61f25d5486be6215330e63750f274a3ee9855ff9c374992ca42/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6769616e6c7563612d70657474656e6f6e2f736f61702d746f747673)](https://camo.githubusercontent.com/9bb6cff427f5b61f25d5486be6215330e63750f274a3ee9855ff9c374992ca42/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6769616e6c7563612d70657474656e6f6e2f736f61702d746f747673) [![Total Downloads](https://camo.githubusercontent.com/7ee99b4cabf443a7d9b06ad967a0126b4f02e27f016b3b5f33cabecc2b4ab2e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6769616e6c7563612d70657474656e6f6e2f736f61702d746f747673)](https://camo.githubusercontent.com/7ee99b4cabf443a7d9b06ad967a0126b4f02e27f016b3b5f33cabecc2b4ab2e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6769616e6c7563612d70657474656e6f6e2f736f61702d746f747673) [![Latest Stable Version](https://camo.githubusercontent.com/a3db289f842a0f098be019aaef47c88d731b8ab98e2fdb54a0f13ab7fce09ea4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6769616e6c7563612d70657474656e6f6e2f736f61702d746f747673)](https://camo.githubusercontent.com/a3db289f842a0f098be019aaef47c88d731b8ab98e2fdb54a0f13ab7fce09ea4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6769616e6c7563612d70657474656e6f6e2f736f61702d746f747673) [![License](https://camo.githubusercontent.com/f33d87958efbcf3716981701ba435b0e1e707a3890e184ea9db72167607ac761/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6769616e6c7563612d70657474656e6f6e2f736f61702d746f747673)](https://camo.githubusercontent.com/f33d87958efbcf3716981701ba435b0e1e707a3890e184ea9db72167607ac761/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6769616e6c7563612d70657474656e6f6e2f736f61702d746f747673)

---

Requirements
------------

[](#requirements)

- `PHP` &gt;= `8.4`
- `Composer`
- Enabled `SOAP` extension (`php-soap`)

---

Installation
------------

[](#installation)

Require the package in your project:

```
composer require gianluca-pettenon/soap-totvs
```

---

Configuration
-------------

[](#configuration)

The `SOAP` adapter reads the following environment variables:

- `WSHOST` – base URL of the TOTVS server (for example: `https://localhost:8051`)
- `WSUSER` – web service user
- `WSPASS` – 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
--------------

[](#usage-overview)

The main entry point of this SDK is `TotvsGateway`, which exposes dedicated gateways for each web service:

- `query()` – SQL Query Web Service
- `process()` – Process Web Service
- `dataServer()` – DataServer Web Service

Example of basic bootstrap:

```
use SoapTotvs\TotvsGateway;
use SoapTotvs\Adapters\LaminasAdapter;

$gateway = new TotvsGateway(
    adapter: new LaminasAdapter()
);
```

---

SQL Query Web Service
---------------------

[](#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
-------------------

[](#process-web-service)

```
use SoapTotvs\TotvsGateway;
use SoapTotvs\Adapters\LaminasAdapter;

$gateway = new TotvsGateway(
    adapter: new LaminasAdapter()
);

$result = $gateway->process()->execute(
    process: 'ProcessName',
    xml: ''
);
```

---

DataServer Web Service
----------------------

[](#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: ''
);

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

[](#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.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance79

Regular maintenance activity

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

115d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/33305f7f28e49dd0d10689b9ae38c56b5bc43c49150fd96a5112434a2c36031a?d=identicon)[gianluca-pettenon](/maintainers/gianluca-pettenon)

---

Top Contributors

[![gianluca-pettenon](https://avatars.githubusercontent.com/u/25618235?v=4)](https://github.com/gianluca-pettenon "gianluca-pettenon (45 commits)")[![segianluca](https://avatars.githubusercontent.com/u/174508029?v=4)](https://github.com/segianluca "segianluca (6 commits)")

---

Tags

sdksoap-webservicesoapuitbctotvstotvs-rm

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gianluca-pettenon-soap-totvs/health.svg)

```
[![Health](https://phpackages.com/badges/gianluca-pettenon-soap-totvs/health.svg)](https://phpackages.com/packages/gianluca-pettenon-soap-totvs)
```

###  Alternatives

[magento/community-edition

Magento 2 (Open Source)

12.1k52.1k10](/packages/magento-community-edition)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[viewflex/zoap

For quickly deploying SOAP services in Laravel and Lumen, with auto-discovery of WSDL definitions.

61184.1k](/packages/viewflex-zoap)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
