gavin887/ntvspa-big-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

gavin887/ntvspa-big-sdk

最新稳定版本:v1.0.0

Composer 安装命令:

composer require gavin887/ntvspa-big-sdk

包简介

Package generated from official `.wsdl` using wsdltophp/packagegenerator

README 文档

README

This is a library that uses NTVSPA Big API by soap

Installation

composer require gavin887/ntvspa-big-sdk

Usage

This is a simple example of how to use the NTVSPA Big API.

<?php

use Ntvspa\Big\ServiceFactory;
use Ntvspa\Big\Session\Enums\SourceSystem;
use Ntvspa\Big\Session\Services\Login;
use Ntvspa\Big\Session\Structs\LoginRequest;
use Ntvspa\Big\Session\Structs\LoginResponse;

require_once __DIR__ . '/vendor/autoload.php';

$username = 'WWW_Anonymous';
$password = 'Accenture$1';
$domain = 'WWW';

/** @var Login $oLoginSvc */
$oLoginSvc = ServiceFactory::create(Login::class, ['debug_mode' => true]);
$oLoginReq = (new LoginRequest)->setSourceSystem(SourceSystem::VALUE_FOREIGN_AGENCY)
    ->setLogin(
        (new \Ntvspa\Big\Session\Structs\Login())
            ->setUsername($username)
            ->setPassword($password)
            ->setDomain($domain));

if ($oLoginSvc->Login($oLoginReq) !== false) {
    /** @var LoginResponse $result */
    $result = $oLoginSvc->getResult();
} else {
    /** @var \SoapFault[] $result */
    $result = $oLoginSvc->getLastError();
    foreach ($result as $error) {
        if ($error instanceof \SoapFault) {
            echo "SoapFault: ", $error->getMessage(), PHP_EOL;
        } else {
            echo get_class($error), ": ", $error->getMessage(), PHP_EOL;
        }
    }
    exit;
}

print("--------------- Result map to class ------------------". PHP_EOL);
print(get_class($result). PHP_EOL);

print("--------------- Agent ------------------". PHP_EOL);
print(json_encode($result->getAgent()->jsonSerialize(), JSON_PRETTY_PRINT). PHP_EOL);

print("--------------- Signature ------------------". PHP_EOL);
print($result->getSignature(). PHP_EOL);

Thanks

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-02