PHP code example of paulosscruz / senior-g5-php

1. Go to this page and download the library: Download paulosscruz/senior-g5-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

paulosscruz / senior-g5-php example snippets


/**
* @param string $user
* @param string $password
* @param int $encryption
* @param clientesobterClienteIn $parameters
* @return clientesobterClienteOut
*/
public function obterCliente($user, $password, $encryption, clientesobterClienteIn $parameters)
{
    // 
}



$usuarioErp = 'teste';
$senhaErp = '123456';
$tipoCriptografia = 0;

$parametros = new clientesobterClienteIn();
$parametros->setCodigoEmpresa(1)
    ->setCodigoFilial(1)
    ->setCodigoCliente(10);

$cliente = new Clientes();
$retorno = $cliente->obterCliente($usuarioErp, $senhaErp, $tipoCriptografia, $parametros);

/* O retorno é um objeto do tipo clientesobterClienteOut conforme assinatura do método */
echo $cliente->getNomeCliente();
echo $cliente->getSaldoDuplicatas();



use Senior\Services\Clientes\Clientes;
use Senior\Services\Clientes\clientesobterClienteIn as ObterClientesIn;
use Senior\Services\Clientes\clientesobterClienteOut as ObterClientesOut;

$usuarioErp = 'teste';
$senhaErp = '123456';
$tipoCriptografia = 0;

$parametros = (new ObterClientesIn())
    ->setCodigoEmpresa(1)
    ->setCodigoFilial(1)
    ->setCodigoCliente(10);
$cliente = (new Clientes())
    ->obterCliente($usuarioErp, $senhaErp, $tipoCriptografia, $parametros);

/* O retorno é um objeto do tipo clientesobterClienteOut conforme assinatura do método */
echo $cliente->getNomeCliente();
echo $cliente->getSaldoDuplicatas();

/**
* @param array $options A array of config values
* @param string $wsdl The wsdl file to use
*/
public function __construct(array $options = array(), $wsdl = null) {
    //
}



$usuarioErp = 'teste';
$senhaErp = '123456';
$tipoCriptografia = 0;

$parametros = new clientesobterClienteIn();
$parametros->setCodigoEmpresa(1)
    ->setCodigoFilial(1)
    ->setCodigoCliente(10);

$cliente = new Clientes([], WSDL::CLIENTES);
$retorno = $cliente->obterCliente($usuarioErp, $senhaErp, $tipoCriptografia, $parametros);

/* O retorno é um objeto do tipo clientesobterClienteOut conforme assinatura do método */
echo $cliente->getNomeCliente();
echo $cliente->getSaldoDuplicatas();
bash
composer 
cmd
# php vendor/paulosscruz/senior-g5-php/bin/generator --wsdl http://example.com/g5-senior-services/sapiens_Synccom_senior_g5_co_ger_cad_clientes?wsdl --serviceName Clientes --outputDir senior/services
cmd
# php vendor/paulosscruz/senior-g5-php/bin/generator --wsdl http://example.com/g5-senior-services/sapiens_Synccom_senior_g5_co_ger_cad_clientes?wsdl --serviceName Clientes --outputDir senior/services --operationNames obterCliente
cmd
# php vendor/paulosscruz/senior-g5-php/bin/generator --wsdl http://example.com/g5-senior-services/sapiens_Synccom_senior_g5_co_ger_cad_clientes?wsdl --serviceName Clientes --outputDir senior/services --operationNames "obterCliente, ExcluirClientes, GravarClientes_5"
cmd
# php vendor/paulosscruz/senior-g5-php/bin/generator --wsdl http://example.com/g5-senior-services/sapiens_Synccom_senior_g5_co_ger_cad_clientes?wsdl --serviceName Clientes --outputDir senior/services --namespace Senior\Services\Clientes