Web Service Gera Guias GNRE

Click here for a complete list of operations.

CadastraEmpresa

Função para cadastro de novas empresas no sistema. Função de uso restrito. Esta função recebe os dados necessários para cadastro, e retorna uma estrutura de dados com os detalhes da operação, inclusive o token para utilização do webservice pela nova empresa. Parâmetros: String sCnpjResponsavel = CNPJ da empresa responsável pelo cadastro (matriz) | String sUsuarioEmpResponsavel = E-mail habilitado para uso do webservice na empresa responsável pelo cadastro | String sChaveApiEmpResponsavel = Token de autorização de uso do webservice da empresa responsável | String sCnpjNovaEmpresa = CNPJ da nova empresa (filial) que será cadastrada vinculada à empresa responsável\matriz | Integer iProdutoPrincipal = Código do produto principal, conforme lista disponível em nossa documentação. | Integer iProdutoSecundario = Código do produto secundário, conforme lista disponível em nossa documentação. | | Lista de códigos de retorno: 0 = Sucesso | 1 = Não autorizado. Verifique o CNPJ, Usuário e Token da empresa responsável pelo cadastro. | 2 = Erro no cadatro da nova empresa. | 9 = Sistema em manutenção

Test

To test the operation using the HTTP POST protocol, click the 'Invoke' button.
ParameterValue
sCnpjResponsavel
sUsuarioEmpResponsavel
sChaveApiEmpResponsavel
sCnpjNovaEmpresa
iProdutoPrincipal
iProdutoSecundario
To view the output in JSON format, click here.

SOAP 1.1

The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

POST /webgnre/geraguiagnre.wso HTTP/1.1
Host: www.guiasgnre.com.br
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CadastraEmpresa xmlns="http://guiasgnre/webgnre">
      <sCnpjResponsavel>string</sCnpjResponsavel>
      <sUsuarioEmpResponsavel>string</sUsuarioEmpResponsavel>
      <sChaveApiEmpResponsavel>string</sChaveApiEmpResponsavel>
      <sCnpjNovaEmpresa>string</sCnpjNovaEmpresa>
      <iProdutoPrincipal>int</iProdutoPrincipal>
      <iProdutoSecundario>int</iProdutoSecundario>
    </CadastraEmpresa>
  </soap:Body>
</soap:Envelope>

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CadastraEmpresaResponse xmlns="http://guiasgnre/webgnre">
      <CadastraEmpresaResult>
        <Login>string</Login>
        <Razao>string</Razao>
        <CNPJ>string</CNPJ>
        <TokenAPI>string</TokenAPI>
        <Retorno>int</Retorno>
        <Msg_retorno>string</Msg_retorno>
      </CadastraEmpresaResult>
    </CadastraEmpresaResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.

POST /webgnre/geraguiagnre.wso HTTP/1.1
Host: www.guiasgnre.com.br
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <CadastraEmpresa xmlns="http://guiasgnre/webgnre">
      <sCnpjResponsavel>string</sCnpjResponsavel>
      <sUsuarioEmpResponsavel>string</sUsuarioEmpResponsavel>
      <sChaveApiEmpResponsavel>string</sChaveApiEmpResponsavel>
      <sCnpjNovaEmpresa>string</sCnpjNovaEmpresa>
      <iProdutoPrincipal>int</iProdutoPrincipal>
      <iProdutoSecundario>int</iProdutoSecundario>
    </CadastraEmpresa>
  </soap12:Body>
</soap12:Envelope>

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <CadastraEmpresaResponse xmlns="http://guiasgnre/webgnre">
      <CadastraEmpresaResult>
        <Login>string</Login>
        <Razao>string</Razao>
        <CNPJ>string</CNPJ>
        <TokenAPI>string</TokenAPI>
        <Retorno>int</Retorno>
        <Msg_retorno>string</Msg_retorno>
      </CadastraEmpresaResult>
    </CadastraEmpresaResponse>
  </soap12:Body>
</soap12:Envelope>

JSON

The following is a sample JSON request and response. The placeholders shown need to be replaced with actual values.

POST /webgnre/geraguiagnre.wso HTTP/1.1
Host: www.guiasgnre.com.br
Content-Type: application/json; charset=utf-8
Content-Length: length
{
   "sCnpjResponsavel": string
   "sUsuarioEmpResponsavel": string
   "sChaveApiEmpResponsavel": string
   "sCnpjNovaEmpresa": string
   "iProdutoPrincipal": int
   "iProdutoSecundario": int
}

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: length

{

   "Login": string
   "Razao": string
   "CNPJ": string
   "TokenAPI": string
   "Retorno": int
   "Msg_retorno": string
}