devcoffee/brerp-php-composite-wsc

Biblioteca em PHP para facilitar as requisições SOAP no BrERP.

v1.0.2 2019-02-22 14:51 UTC

This package is not auto-updated.

Last update: 2024-12-08 06:53:20 UTC


README

logo-brerp

O BrERP Web Service Connector tem como objetivo facilitar as requisições SOAP para os webservices do BrERP em sua aplicação PHP. Com sua arquitetura model oriented, não é necessário tratar os arquivos XML de request e response manualmente. Desta forma, com o auxílio desta biblioteca, é possível realizar facilmente tarefas como:

  • CRUDs, em qualquer tabela do sistema;
  • Extrair informações de views;
  • Executar Doc Actions em qualquer documento do BrERP;
  • Executar processos.

Compatibilidade

Este repositório conta com uma solução PHP, compatível com PHP > 5.3

Arquitetura

O repositório está dividido em 3 diretórios:

  • brerpwsc:
    • Este diretório contém o código fonte da biblioteca brerpwsc, que é compilada e inserida nos pacotes do pip;
  • test:
    • Este diretório contém uma série de arquivos de teste e arquivos de exemplo, que podem ser utilizadas como base para a utilização dessa biblioteca em sua aplicação PHP.
  • documents:
    • Este diretório contém arquivos utilizados pelos testes, como xmls e JSONs de exemplo, ou arquivos .png.

Instalação

O brerpwsc-php está publicado como biblioteca no Packagist, e portanto, para utiliza-lo em seu projeto php basta instalá-lo utilizando o composer:

composer require devcoffee/brerp-php-composite-wsc
composer update

Exemplo prático: Criando um Parceiro de Negócios com Imagem de Logo

Para podermos utilizar os webservices no BrERP, é necessário realizar uma configuração inicial, que deve informar o sistema sobre quais parâmetros esperar em um request e quais parâmetros enviar na response. Neste exemplo, criaremos uma aplicação capaz de Criar um parceiro de negócios com uma imagem de logo anexada. Para isso, será necessário utilizar três Web Services, um para o envio da imagem, outro para a criação do parceiro de negócios, com o record_id da imagem referenciado e por fim, um Web Service Composto que nos permite enviar todas as informações em uma única requisição.

Configurando os Webservices no BrERP

Para exportar ou importar dados no BrERP, nenhuma linha de código precisa ser escrita. Basta que sejam feitas algumas simples configurações na janela de Segurança de Serviços Web.

Segurança de Serviços Web

Esta é a janela de configuração dos Web Services, e possui 4 abas de configuração, sendo elas:

  • Parâmetros de Serviço Web:
    • Esta aba é de importância vital para o funcionamento do Web Service, uma vez que nela são configuradas as ações do Web Service, como a tabela a ser utilizada, a ação a ser realizada, entre outros.
  • Entradas de Serviço Web:
    • Aqui é informado os parâmetros de entrada do Web Service, ou seja, quais informações serão consumidas por ele. É comum que os parâmetros sejam classificados em conformidade com os nomes da coluna da tabela manipulada.
  • Resultado de Serviço Web:
    • Essa coluna diz respeito as informações que serão retornadas pelo Web Service, também tendo conformidade com o nome das colunas da tabela
  • Acesso de Serviço Web:
    • Nessa aba são configuradas as permissões de Login do Web Service, ou seja, quais perfis terão permissão para utiliza-lo.

SegurancaDeServicosWeb

Criando o Web Service CreateImageTest

Crie um novo WebService na janela Segurança de Serviços Web com o nome CreateImageTest, e preencha-o como a imagem abaixo. Atente-se para os parâmetros:

-Serviço Web: Deve ser Model Oriented Web Services, uma vez que o Web Service agirá diretamente com a base de dados. -Método de Serviço Web: Deve ser Create Data uma vez que o Web Service irá inserir registros na base de dados. -Tabela: Deve ser AD_Image

Lembre-se também de preencher os parâmetros da aba Parâmetros de serviço Web exatamente como na imagem: CreateImageTestWS

Na aba Entrada de Serviços Web crie três campos, referentes as colunas que terão dados inseridos na tabela AD_Image:

CreateImateTestWSEntrada

Por fim, na aba Acesso de Serviços Web insira todos os usuários que devem ter permissão para utilizar o Web Service:

CreateImageTestWSAcesso.png

Criando o Web Service CreateBPartnerTest

Crie um novo WebService na janela Segurança de Serviços Web com o nome CreateBPartnerTest, e preencha-o como a imagem abaixo. Atente-se para os parâmetros:

-Serviço Web: Deve ser Model Oriented Web Services, uma vez que o Web Service agirá diretamente com a base de dados. -Método de Serviço Web: Deve ser Create Data uma vez que o Web Service irá inserir registros na base de dados. -Tabela: Deve ser C_BParter

Lembre-se também de preencher os parâmetros da aba Parâmetros de serviço Web exatamente como na imagem: CreateImageTestWS

Na aba Entrada de Serviços Web crie três campos, referentes as colunas que terão dados inseridos na tabela AD_Image:

CreateImateTestWSEntrada

Por fim, na aba Acesso de Serviços Web insira todos os usuários que devem ter permissão para utilizar o Web Service:

CreateImageTestWSAcesso.png

Criando o Web Service CompositeBPartnerTest

Crie um novo WebService na janela Segurança de Serviços Web com o nome CompositeBPartnerTest, e preencha-o como a imagem abaixo. Atente-se para os parâmetros:

-Serviço Web: Deve ser CompositeInterface, uma vez que o Web Service não agirá diretamente com a base de dados, mas sim, será como um coringa, encapsulando outros Web Services.

Lembre-se também de preencher os parâmetros da aba Acesso de serviço Web exatamente como na imagem: CreateImageTestWS

Código PHP

Com os WebServices criados, podemos utilizar o brerpwsc-php para realizar a interface entre a aplicação e os Web Serives SOAP do BrERP. O brerpwsc-php utiliza arquivos JSON para montar os arquivos XML de requisição. Observe abaixo o exemplo de JSON para uma requisição do tipo CompositeOperation, para cadastrar uma imagem, a anexar seu ID no Parceiro de Negócio:

{
    "settings":{
        //Informações de Login e sobre o Tipo do Web Service a ser consultado.
       "url":"https://teste.brerp.com.br",
       "user":"superuser @ brerp.com.br",
       "password":"sua_senha_aqui",
       "language":"pt_BR",
       "clientId":"1000000",
       "roleId":"1000000",
       "orgId":"5000003",
       "warehouseId":"5000007",
       "stage":"9",
       "serviceType": "CompositeOperation",
       "compositeWebServiceName": "CompositeWebServiceTest"
    },
    //Por ser do tipo CompositeOperation, a chave call é representada por uma lista, que contém as requisições individuais
    "call":[
        {
            //Requisição no WS CreateImageTest
            "type":"createData",
            "preCommit":"false",
            "postCommit":"false",
            "serviceName":"CreateImageTest",
            "table":"c_bpartner",
            "action":"Create",
            "name":"bpartner_id",
            "values":{
                "Name":"devCoffee-logo.png",
                "Description":"Test create a BPartner with a Logo",
                "BinaryData":"123456" //Campo a ser preenchido com o conteúdo da imagem em base64.
            }
        },
        {
            //Requisição no WS CreateBPartnetTest
            //Em operações do tipo Composite, o campo type é obrigatório
            "type":"createData",
            "preCommit":"false",
            "postCommit":"false",
            "serviceName":"CreateBPartnerTest",
            "table":"c_bpartner",
            "action":"Create",
            "name":"bpartner_id",
            "values":{
                "Name":"Parceiro de Negócios",
                "Value":"123456",
                "Logo_ID":"@AD_Image.AD_Image_ID"
            }
        }
    ]
 }

Podemos então, utilizar o seguinte código PHP para consultar o Web Service:

<?php

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

use DevCoffee\BrerpPhpCompositeWsc\BrerpWsc;
use DevCoffee\BrerpPhpCompositeWsc\BinaryData;


//Lendo dados do arquivo json no diretorio documents
$request_content = file_get_contents("../documents/test_bpartner_image_create.json");
$json_request = json_decode($request_content, true);

//Instanciando o web service connector
$brerp_wsc = new BrerpWsc();


//Validando o formato JSON
$jsonValidate = $brerp_wsc->validate_JSON_request($json_request);

if($jsonValidate[0]){
    echo $jsonValidate[1];
} else {
    echo $jsonValidate[1];
    exit;
}

//Atribuindo valor aleatório para a chave de busca do parceiro
$json_request["call"][1]["values"]["Value"] = random_int(1000000, 10000000);


//Convertendo logo para base64 e atribuindo no BinaryData
$binarydata = new BinaryData();
$imgb64 = $binarydata->img2base64("../images/logoP.png");

//Atribuindo o logo em base64 no BinaryData
$json_request["call"][0]["values"]["BinaryData"] = $imgb64;



//Construindo requisição através do json
$brerp_wsc->build_request($json_request);
echo "\n". $brerp_wsc->get_json_request();

//Executando requisição e exibindo resposta
$brerp_wsc->make_request();
echo "\n\n" . $brerp_wsc->get_xml_response();


?>

XML de Envio ao servidor

<soapenv:Envelope xmlns:_0="http://idempiere.org/ADInterface/1_0" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Header/>
  <soapenv:Body>
    <_0:compositeOperation>
      <_0:CompositeRequest>
        <_0:serviceType>CompositeBPartnerTest</_0:serviceType>
        <_0:operations>
          <_0:operation preCommit="false" postCommit="false">
            <_0:TargetPort>createData</_0:TargetPort>
            <_0:ModelCRUD>
              <_0:serviceType>CreateImageTest</_0:serviceType>
              <_0:DataRow>
                <_0:field column="Name">
                  <_0:val>brerp-logo.png</_0:val>
                </_0:field>
                <_0:field column="Description">
                  <_0:val>Test create a BPartner with a Logo</_0:val>
                </_0:field>
                <_0:field column="BinaryData">
                  <_0:val>iVBORw0KGgoAAAANSUhEUgAAASwAAABWCAYAAAB1s6tmAAAgAElEQVR4nOy9e5xV1ZXv+/2tvamUdEFojofL9cPH9ti0x+sxNhTGB1WFJlEoX6VtTHxQgOTRiZ1jtFDatpE2BivGRsRHbNs2EQoKNSYxCRotjRpbCjQeKdS2aWMbj5e2PTSXD02wUpKyao37x1xzrbl27XoABZikBp9i770ec475+s0xxhxzTPFbSPPmzYsgKsYxY6OIY4FjgD8GJgHjJSpAmBmgGKwL2Ar8vxJvxrG9Fse9bxYKhe6WlpU9B7EoIzRCI7QHpIPNwFBp7tzPFSUbD9QCs4DpEseYEflnpNLiGGblroOZ7QReBH4GtJnxxqpVK7r2XwlGaIRGaF/pQw1Yc+bMiaTCOEmngi4GTpMYZ2ZIToLyYJRIU0D+Wrnn+t4nBnsV+KEZD0L89qpVLd0HvMAjNEIjNCB9KAHr4osbo4qKisPBGoE5ko7aH/k46Sv8bQCdwGPA3XHMC6tXr9i9P/IeoREaoT2nDxVgNTZ+LioU7HDgS6BLJSb2laLKq3jlyAGSk7w8OLkkbIA00ue7wdqAZT09vLBmzYoRiWuERugg04cGsObNmz8emAs0STrcXfXgYYEkpOS6/56nDOCyZ0LQy9IN3/GSloJrqTrZCTwIttQsfnPVqlXxvpRzhEZohPaeDjpgXXjhRVFl5SEzgCWg6RJRqe2pv888WSI9hRJYOaO7t3WVpwwclXvezLYAS3p7e1tbW1eNqIkjNEIHgQ4qYM2dO3+sxELgq5LGln+qHMCEklf+Xl6F9Coh/aaRf6cc6IVp0w12P7CwpWXF9iEVcoRGaISGjQ4aYM2de+lkSXdJOg0yqQrKr+SV+w55YAltVgMBXem98nnkpbOSZ54xY96qVSveGabqGKERGqEh0EEBrHnz5p8ErAYm521SlKh85UADygBRtxlbgR24Vb5uIAIqgLHAOEkT3O8QrPISVSkIhiooKDHap9deimM7d/Xqle8OZ92M0AiNUP90wAFr3rxLZ4AeAB2WSUOhxEQK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:DataRow>
            </_0:ModelCRUD>
          </_0:operation>
          <_0:operation preCommit="false" postCommit="false">
            <_0:TargetPort>createData</_0:TargetPort>
            <_0:ModelCRUD>
              <_0:serviceType>CreateBPartnerTest</_0:serviceType>
              <_0:DataRow>
                <_0:field column="Name">
                  <_0:val>Parceiro de Negócios do BrERP</_0:val>
                </_0:field>
                <_0:field column="Value">
                  <_0:val>4074800</_0:val>
                </_0:field>
                <_0:field column="Logo_ID">
                  <_0:val>@AD_Image.AD_Image_ID</_0:val>
                </_0:field>
              </_0:DataRow>
            </_0:ModelCRUD>
          </_0:operation>
        </_0:operations>
        <_0:ADLoginRequest>
          <_0:user>superuser @ brerp.com.br</_0:user>
          <_0:pass>sua senha aqui</_0:pass>
          <_0:lang>en_US</_0:lang>
          <_0:ClientID>1000000</_0:ClientID>
          <_0:RoleID>1000000</_0:RoleID>
          <_0:OrgID>5000003</_0:OrgID>
          <_0:WarehouseID>5000007</_0:WarehouseID>
        </_0:ADLoginRequest>
      </_0:CompositeRequest>
    </_0:compositeOperation>
  </soapenv:Body>
</soapenv:Envelope>

Resultado

A aplicação PHP utilizando a biblioteca brerpwsc-php construiu o .xml e enviou a requisição ao servidor do BrERP. Se observarmos a janela de Parceiro de Negócios podemos observar que o parceiro de negócios definido no código foi criado, juntamente com a imagem de logo escolhida:

TestBPartnerCreated.png

Realizando Requisições simples

Para realizar requisições simples, que apenas consultem um WebService por vez, o arquivo JSON sofre algumas alterações na sua forma. Observe um exemplo de requisição do tipo queryData:

{
    "settings":{
       "url":"http://teste.brerp.com.br",
       "user":"superuser @ brerp.com.br",
       "password":"sua senha aqui",
       "language":"pt_BR",
       "clientId":"1000000",
       "roleId":"1000000",
       "orgId":"5000003",
       "warehouseId":"5000007",
       "stage":"9",
       //serviceType deve se referir ao serviço que será acessado
       "serviceType": "queryData"
    },
    //Por se tratar de uma requisição simples, a chave call é representada por um único dicionário.
    "call":
        {
            "preCommit":"false",
            "postCommit":"false",
            "serviceName":"QueryBPartnerTest",
            "table":"c_bpartner",
            "action":"queryData",
            "name":"bpartner_id",
            //queryConfig contém os parâmetros responsáveis pelos limites e inicío da busva
            "queryConfig":{
                //parâmetro que limita o retorno das informações
                "limit": 2,
                //Parâmetro que determina qual o índice inicial da busca.
                "offset": 0
            }
        }
 }

O código PHP mantém-se igual, apenas utilizando os objetos da classe BrerpWsc. O método get_raw_json_response() pode ser utilizado para exibir a resposta do servidor, já transformada em JSON.

<?php

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

use DevCoffee\BrerpPhpCompositeWsc\BrerpWsc;

$request_content = file_get_contents("../documents/test_query_data.json");
$json_request = json_decode($request_content, true);

$brerp_wsc = new BrerpWsc();

//Validando o formato JSON
$jsonValidate = $brerp_wsc->validate_JSON_request($json_request);

if($jsonValidate[0]){
    echo $jsonValidate[1];
} else {
    echo $jsonValidate[1];
    exit;
}

$brerp_wsc->build_request($json_request);

// $brerp_wsc->set_xml_request($xml);
echo "\n\n" . $brerp_wsc->get_xml_request();


$brerp_wsc->make_request();

//Exibindo resposta do servidor
echo "\n\n\n" . $brerp_wsc->get_raw_json_response();

Resposta do Servidor

Com o envio acima, o servidor retornará um XML contendo informações de 2 Parceiros de Negócio, iniciando no indice 0. Esse XML é convertido para JSON e exibido na tela:

{
    "soapBody": {
        "ns1queryDataResponse": {
            "WindowTabData": {
                "@attributes": {
                    "NumRows": "2",
                    "TotalRows": "80",
                    "StartRow": "0"
                },
                "DataSet": {
                    "DataRow": [
                        {
                            "field": [
                                {
                                    "@attributes": {
                                        "column": "C_BPartner_ID"
                                    },
                                    "val": "5000029"
                                },
                                {
                                    "@attributes": {
                                        "column": "Value"
                                    },
                                    "val": "0-00994786000100"
                                },
                                {
                                    "@attributes": {
                                        "column": "Name"
                                    },
                                    "val": "PARCEIRO DE NEGÓCIOS 1"
                                },
                                {
                                    "@attributes": {
                                        "column": "Logo_ID"
                                    },
                                    "val": {}
                                }
                            ]
                        },
                        {
                            "field": [
                                {
                                    "@attributes": {
                                        "column": "C_BPartner_ID"
                                    },
                                    "val": "5000031"
                                },
                                {
                                    "@attributes": {
                                        "column": "Value"
                                    },
                                    "val": "001-35019195812"
                                },
                                {
                                    "@attributes": {
                                        "column": "Name"
                                    },
                                    "val": "PARCEIRO DE NEGÓCIOS 2"
                                },
                                {
                                    "@attributes": {
                                        "column": "Logo_ID"
                                    },
                                    "val": {}
                                }
                            ]
                        }
                    ]
                },
                "RowCount": "2",
                "Success": "true"
            }
        }
    }
}