定制 gianluca-pettenon/soap-totvs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gianluca-pettenon/soap-totvs

最新稳定版本:1.0.0

Composer 安装命令:

composer require gianluca-pettenon/soap-totvs

包简介

README 文档

README

PHP version Code Coverage Total Downloads Latest Stable Version License

Requirements

  • PHP >= 8.4
  • Composer
  • Enabled SOAP extension (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 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

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

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.

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固