Jump to content
Fivewin Brasil

infosys2

Membros
  • Posts

    78
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by infosys2

  1. Estou tentando fazer downloads dos xml do e-Social com ACBreSocial32.dll e nao estou conseguindo passar a as informações quando se trata de datas!
    Exemplo: oEsocial:ConsTrabalhador("04050400000000",15, "ID1040504000000002023071401271100629", "01/06/2023" , "30/06/2023")
    mas na dll só chaga assim "04050400000000", 15,"ID1040504000000002023071401271100629", "30/12/1899" , "30/12/1899" não importa o parâmetro que envio como a data sempre retorna 30/12/1899 não importando se passo 30/06/2023, 2023-06/30 ou seja não leva em consideração as informações das datas

    Os três primeiros parâmetros chegam certinhos agora o problema estar nas variáveis tipo data.

    Alguém já chegou a ver isto ? e se consegue ajudar

     

     

    	**  A chamada do metodo é assim
    	 cXmlResposta   :=    oEsocial:ConsTabela("04050400000000", 15, "ID1040504000000002023071401271100629","01/06/2023" , "30/06/2023")
    	 
    	METHOD ConsTabela( aIdEmpregador, aTipoEvento, aChave,aDataInicial,aDataFinal )
    	 
    	/*-------------------------------------------------------------------------*/
    	//01 aIdEmpregador String    Informe o ID do Empregador.
    	//02 aTipoEvento   Integer   Informe o Tipo do Evento.
    	//03 aChave        String    Informe a Chave para Consulta.
    	//04 aDataInicial  Date      Data Inicial da Consulta.
    	//05 aDataFinal    Date      Data Final de Consulta.
    	//06 sResposta     String    Usado pelo retorno, contem as informações retornadas pela consulta.
    	//07 esTamanho     Integer   Usado pelo retorno, contem o tamanho da string (sResposta).
    	METHOD ConsTabela(aIdEmpregador, aTipoEvento, aChave,aDataInicial,aDataFinal) CLASS tEsocial
    	    local hResult, buffer, bufferLen
    	    bufferLen := STR_LEN
    	    buffer := Space(bufferLen)
    	    hResult := DllCall(::hHandle, DLL_STDCALL, "eSocial_ConsultaIdentificadoresEventosTabela", hb_StrToUTF8(aIdEmpregador), aTipoEvento, aChave, hb_StrToUTF8(aDataInicial), hb_StrToUTF8(aDataFinal),@buffer, @bufferLen)
    	    ::CheckResult(hResult)
    	RETURN ::ProcessResult(buffer, bufferLen)
    	*----------------------------------------------------------------------------------------------------------*
    	 

     

  2. O Marcos gambeta adicionou ao seu repositório do hb++, e  dá pra ser compilado com o harbour 3.2 e 3.4, assim como também já removeu a dependência do bison pra compilar o mesmo, e disse que pretende remover a dependência de usar o xhb.hbp na compilação, o que seria ideal também.
    Está caminhando, em breve acredito que vai estar no repositório do harbour na pasta contrib.

     

    Baixe os fontes já corrigidos para  harbour  aqui neste link:


    https://github.com/marcosgambeta/sqlrddpp/tree/main

  3. Em 17/08/2023 at 11:32, emotta disse:

    só pra ficar registrado aqui e ajudar alguem que também estava com este problema.

    eu já tinha instalado o gnu BISON mas ele estava no meu drive C

    a compilação do projeto eu estava fazendo no drive G

    então só precisei copiar a pasta c:\GnuWin32 para g:\GnuWin32 de forma que o arquivo g:\GnuWin32\bin\bison.exe fosse encontrado pelo xBuildw e gerou o sqly.h

     

    agora estou com outros problemas que estou investigando

    coloca ai este arquivo sqly.h      para mim fazer um teste 

    Compilando   com  este esta linha de comando   aqui :  hbmk2 -xhb sqlrdd.hbp 

    Error E2209 sqllex.c 16: Unable to open include file 'sqly.h'
    Error E2147 sqllex.c 23: 'YYSTYPE' cannot start a parameter declaration
    Error E2147 sqllex.c 31: 'YYSTYPE' cannot start a parameter declaration
    Error E2147 sqllex.c 42: 'YYSTYPE' cannot start a parameter declaration
    Error E2451 sqllex.c 71: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2451 sqllex.c 77: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2451 sqllex.c 82: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2288 sqllex.c 93: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 95: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2451 sqllex.c 102: Undefined symbol 'INTEGERVAL' in function sqlyylex
    Error E2288 sqllex.c 107: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 109: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2451 sqllex.c 116: Undefined symbol 'REALVAL' in function sqlyylex
    Error E2288 sqllex.c 142: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2288 sqllex.c 143: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 145: Undefined symbol 'STRINGVAL' in function sqlyylex
    Error E2451 sqllex.c 150: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2288 sqllex.c 163: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2288 sqllex.c 164: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 166: Undefined symbol 'QUOTED_IDENT' in function sqlyylex
    Error E2451 sqllex.c 170: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2288 sqllex.c 180: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2288 sqllex.c 181: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 183: Undefined symbol 'DATEVAL' in function sqlyylex
    Error E2451 sqllex.c 186: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2451 sqllex.c 194: Undefined symbol 'BINDVAR' in function sqlyylex
    Error E2288 sqllex.c 201: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 203: Undefined symbol 'OPERATOR' in function sqlyylex
    Error E2288 sqllex.c 208: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 210: Undefined symbol 'OPERATOR' in function sqlyylex
    Error E2288 sqllex.c 215: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 217: Undefined symbol 'ASTERISK' in function sqlyylex
    Error E2288 sqllex.c 222: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 224: Undefined symbol 'OPERATOR' in function sqlyylex
    Error E2288 sqllex.c 234: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 236: Undefined symbol 'EQUALS' in function sqlyylex
    Error E2288 sqllex.c 243: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 245: Undefined symbol 'COMPARE' in function sqlyylex
    Error E2288 sqllex.c 247: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 249: Undefined symbol 'COMPARE' in function sqlyylex
    Error E2288 sqllex.c 256: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 258: Undefined symbol 'COMPARE' in function sqlyylex
    Error E2288 sqllex.c 262: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 264: Undefined symbol 'COMPARE' in function sqlyylex
    Error E2288 sqllex.c 266: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 268: Undefined symbol 'COMPARE' in function sqlyylex
    Error E2288 sqllex.c 275: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 277: Undefined symbol 'COMPARE' in function sqlyylex
    Error E2451 sqllex.c 279: Undefined symbol 'NOT' in function sqlyylex
    Error E2288 sqllex.c 284: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2228 sqllex.c 284: Too many error or warning messages in function sqlyylex
    *** 51 errors in Compile ***
    hbmk2[sqlrdd]: Erro: Executando compilador C/C++. 2
    bcc32.exe -c -q -CP437 -d -O2 -OS -Ov -Oc -Oi -6  -tWM -w -Q -w-sig- -n.hbmk\win\bcc -Ic:\bcc7\Include -Ic:\bcc7\Include\dinkumware -Ic:\bcc7\Include\windows\crtl -Ic:\bcc7\Include\windows\rtl -Ic:\bcc7\Include\windows\sdk -IC:\harbour32\include -I.hbmk\win\bcc -I. sqlact.c sqllex.c

     

  4. fiz um teste de compilar um pequeno exemplo em harbour mais deu estes erros aqui 

    C:\SQLRDD\harbour>c:\bcc7\bin\make -fESOCIAL.mak
    MAKE Version 5.41  Copyright (c) 1987, 2014 Embarcadero Technologies, Inc.
            c:\bcc7\bin\ilink32 -Gn -aa -Tpe -s @b32_LNK.bc
    Turbo Incremental Link 6.70 Copyright (c) 1997-2014 Embarcadero Technologies, Inc.
    Error: Unresolved external '_HB_FUN_SR_DBQUALIFY' referenced from C:\SQLRDD\HARBOUR\LIB\MYSQLRDD.LIB|sqlrdd2
    Error: Unresolved external '_HB_FUN_SR_ESCAPESTRING' referenced from C:\SQLRDD\HARBOUR\LIB\MYSQLRDD.LIB|sqlgen1
    Error: Unresolved external '_HB_FUN_SR_STRTOHEX' referenced from C:\SQLRDD\HARBOUR\LIB\MYSQLRDD.LIB|sqlgen1
    Error: Unresolved external '_HB_IS_TIMEFLAG' referenced from C:\SQLRDD\HARBOUR\LIB\MYSQLRDD.LIB|sqlrdd1
    Error: Unresolved external '_HB_FUN_SR_HEXTOSTR' referenced from C:\SQLRDD\HARBOUR\LIB\MYSQLRDD.LIB|utils
    Error: Unresolved external '_sr_escapeNumber' referenced from C:\SQLRDD\HARBOUR\LIB\MYSQLRDD.LIB|mysql
    Error: Unresolved external '_hb_timeEncStr' referenced from C:\SQLRDD\HARBOUR\LIB\MYSQLRDD.LIB|mysql
    Error: Unable to perform link
    
    ** error 2 ** deleting JAIR.EXE

     

  5. eu tenei compilar tambem em harbour 3.2    e  nao teve muinto erro nao. segue abaixo a lista de erros

     

    firebird3.c:
    Error E2293 firebird3.c 1414: ) expected in function HB_FUN_FBLINEPROCESSED3
    *** 1 errors in Compile ***
    
    sqlact.c:
    Error E2209 sqlact.c 15: Unable to open include file 'sqly.h'
    *** 1 errors in Compile ***
    sqllex.c:
    Error E2209 sqllex.c 16: Unable to open include file 'sqly.h'
    Error E2147 sqllex.c 23: 'YYSTYPE' cannot start a parameter declaration
    Error E2147 sqllex.c 31: 'YYSTYPE' cannot start a parameter declaration
    Error E2147 sqllex.c 42: 'YYSTYPE' cannot start a parameter declaration
    Error E2451 sqllex.c 71: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2451 sqllex.c 77: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2451 sqllex.c 82: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2288 sqllex.c 93: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 95: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2451 sqllex.c 102: Undefined symbol 'INTEGERVAL' in function sqlyylex
    Error E2288 sqllex.c 107: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 109: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2451 sqllex.c 116: Undefined symbol 'REALVAL' in function sqlyylex
    Error E2288 sqllex.c 142: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2288 sqllex.c 143: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 145: Undefined symbol 'STRINGVAL' in function sqlyylex
    Error E2451 sqllex.c 150: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2288 sqllex.c 163: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2288 sqllex.c 164: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 166: Undefined symbol 'QUOTED_IDENT' in function sqlyylex
    Error E2451 sqllex.c 170: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2288 sqllex.c 180: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2288 sqllex.c 181: Pointer to structure required on left side of -> or ->* in function sqlyylex
    Error E2451 sqllex.c 183: Undefined symbol 'DATEVAL' in function sqlyylex
    Error E2451 sqllex.c 186: Undefined symbol 'ERRORVAL' in function sqlyylex
    Error E2228 sqllex.c 186: Too many error or warning messages in function sqlyylex
    *** 26 errors in Compile ***
    
    Error E2209 oci.h 320: Unable to open include file 'oratypes.h'
    Error E2209 oci.h 324: Unable to open include file 'ocidfn.h'
    Error E2257 oci.h 1699: , expected
    Error E2209 oci.h 1945: Unable to open include file 'oci1.h'
    Error E2209 oci.h 1949: Unable to open include file 'oro.h'
    Error E2209 oci.h 1953: Unable to open include file 'ori.h'
    Error E2209 oci.h 1957: Unable to open include file 'orl.h'
    Error E2209 oci.h 1961: Unable to open include file 'ort.h'
    Error E2209 oci.h 1965: Unable to open include file 'ociextp.h'
    Error E2209 oci.h 1969: Unable to open include file 'ociapr.h'
    Error E2209 oci.h 1970: Unable to open include file 'ociap.h'
    Error E2209 oci.h 1977: Unable to open include file 'oci8dp.h'
    Error E2209 oci.h 1981: Unable to open include file 'ociextp.h'
    Error E2209 oci.h 1985: Unable to open include file 'ocixad.h'
    Error E2209 ociap.h 168: Unable to open include file 'oratypes.h'
    Error E2209 ociap.h 177: Unable to open include file 'ocidfn.h'
    Error E2209 ociap.h 181: Unable to open include file 'nzt.h'
    Error E2209 ociap.h 189: Unable to open include file 'ort.h'
    Error E2293 ociap.h 5869: ) expected
    Error E2293 ociap.h 5873: ) expected
    Error E2293 ociap.h 5878: ) expected
    Error E2293 ociap.h 5882: ) expected
    Error E2293 ociap.h 5886: ) expected
    Error E2293 ociap.h 5890: ) expected
    Error E2293 ociap.h 5893: ) expected
    Error E2228 ociap.h 5893: Too many error or warning messages
    *** 26 errors in Compile ***
    
    sqlora2.c:
    Error E2193 sqlora2.c 643: Too few parameters in call to 'hb_timeEncode' in function HB_FUN_ORACLEGETBINDDATA2
    Error E2227 sqlora2.c 869: Extra parameter in call to hb_itemPutCPtr in function SQLO2_FieldGet

    Ou seja poucos erros:

    firebird3.c:
    sqlact.c:
    sqllex.c:
    sqlora2.c:
     

    Ainda nao fiz teste mas ja me arrisco a dizer que vai funcionar na maioria dos banco de dados! 

     

     

  6. Baxei aqui na minha maquia e compilei apenas o sqlrdd.

    so ficou  6   arquivos que nao conseguir compilar por que nao conseguir encontrar  alguns include  existentes neste arquivos

     sqlact.c        
     sqlex1ora.c     
     sqlex2ora.c     
     sqlex3ora.c     
     sqllex.c        
     sqlora.c        
     

    Depois de compilado conseguir fazer o seguinte teste  com xharbour1.2.3  bcc7 :

       RddSetDefault( "SQLRDD" )
       SET DELETED ON
       IF SR_ExistTable( "clientes" )
          USE clientes NEW alias temp VIA "SQLRDD"
          BROWSE()
       endif 
       dbcloseall() 

     

  7. Em 05/11/2022 at 01:49, alex2002 disse:

    Olá amigo.

    Cara, fica tranquilo e entre de cabeça. Você só tem a ganhar.

    Comece com um cursinho básico de MySQL. Instale o MariaDB ou MySQL (eles são gratuítos). Instale também o SQLYOG Comunity, ele é um aplicativo onde vc acessa o SQL e consegue executar as querys.

    Por fim pratique bastante e tente usar RDDS que vão te deixar bem a vontade com os comandos do DBF (dbskip, dbusearea...). Eu utilizo o SQLLIB há mais ou menos uns 17 anos e sou muito tranquilo com isso. Prefiro usar nativamente, mas tem situação onde dbusearea é extremamente rápido de usar.

    Qualquer coisa o fórum está aqui para te ajudar no que for necessário.

    Um abraço,

    Alexandre Pereira

    Alexandre !  Qual versão do sqllib você usa  com xharbour ?  eu gostaria de fazer um teste para ver como funciona. Eu tenho um programa compilado com a versao 1.1  do xharbour e fwh 2009   mas nunca utilizei este programa para ver se funciona...  queria ver se funciona mas não sei com qual versão do mysql  que eu poderia testar sera qu so serve a versai mysql 5.5 ?   

  8. 16 minutos atrás, emotta disse:

    Como eu já vi algumas pessoas postando duvidas de eSocial aqui imagino que tenham pessoas que possam me ajudar.

    Eu preciso fazer download, via aplicação, de eventos que estão no eSocial. Hoje é possivel fazer esse download pelo portal (https://www.gov.br/esocial/pt-br/noticias/esocial-download-para-facilitar-a-vida-do-empregador)

    Eu gostaria de fazer esse download via aplicação, tanto o pedido como o download do arquivo.

    Alguém aqui sabe como fazer? O exemplo pode ser em qualquer linguagem e eu já sei que com certeza vai precisar do certificado digital da empresa. 

    Fico agradecido se alguém puder me ajudar nisso

    abraços

     

    
    Voce pode utilizar os seguintes modelos de xml para fazer downloads 
    
    // Eventos de tabelas  
    <?xml version="1.0" encoding="UTF-8"?>
    <eSocial xmlns="http://www.esocial.gov.br/schema/consulta/identificadores-eventos/tabela/v1_0_0">
    <consultaIdentificadoresEvts>
    <ideEmpregador>
    <tpInsc>1</tpInsc>
    <nrInsc>06117473000150</nrInsc>
    </ideEmpregador>
    <consultaEvtsTabela>
    <tpEvt>str123</tpEvt>
    <chEvt>str1234</chEvt>
    <dtIni>2018-10-02T12:12:12</dtIni>
    <dtFim>2018-10-02T12:12:12</dtFim>
    </consultaEvtsTabela>
    </consultaIdentificadoresEvts>
    </eSocial
    
    // eventos de trabalhadores 
    <?xml version="1.0" encoding="UTF-8"?>
    <eSocial xmlns="http://www.esocial.gov.br/schema/consulta/identificadores-eventos/trabalhador/v1_0_0">
    <consultaIdentificadoresEvts>
    <ideEmpregador>
    <tpInsc>1</tpInsc>
    <nrInsc>06117473000150</nrInsc>
    </ideEmpregador>
    <consultaEvtsTrabalhador>
    <cpfTrab>35090092079</cpfTrab>
    <dtIni>2018-10-02T12:12:12</dtIni>
    <dtFim>2018-10-02T12:12:12</dtFim>
    </consultaEvtsTrabalhador>
    </consultaIdentificadoresEvts>
    </eSocial
    
    // Eventos do empregador 
    <?xml version="1.0" encoding="UTF-8"?>
    <eSocial xmlns="http://www.esocial.gov.br/schema/consulta/identificadores-eventos/empregador/v1_0_0">
    <consultaIdentificadoresEvts>
    <ideEmpregador>
    <tpInsc>1</tpInsc>
    <nrInsc>06117473000150</nrInsc>
    </ideEmpregador>
    <consultaEvtsEmpregador>
    <tpEvt>str123</tpEvt>
    <perApur>2017-10</perApur>
    </consultaEvtsEmpregador>
    </consultaIdentificadoresEvts>
    </eSocial
    
    // por numero de recibo 
    <?xml version="1.0" encoding="UTF-8"?>
    <eSocial xmlns="http://www.esocial.gov.br/schema/download/solicitacao/nrRecibo/v1_0_0">
    <download>
    <ideEmpregador>
    <tpInsc>1</tpInsc>
    <nrInsc>06117473000150</nrInsc>
    </ideEmpregador>
    <solicDownloadEventosPorNrRecibo>
    <nrRec>1.2.0000000000133846592</nrRec>
    </solicDownloadEventosPorNrRecibo>
    </download>
    </eSocial
    
    // Eventos periodicos pelo ID 
    <?xml version="1.0" encoding="UTF-8"?>
    <eSocial xmlns="http://www.esocial.gov.br/schema/download/solicitacao/id/v1_0_0">
    <download>
    <ideEmpregador>
    <tpInsc>1</tpInsc>
    <nrInsc>06117473000150</nrInsc>
    </ideEmpregador>
    <solicDownloadEvtsPorId>
    <id>ID1061174730000002018081415303000001</id>
    </solicDownloadEvtsPorId>
    </download>
    </eSocial

     

  9. 11 horas atrás, mkyx disse:


            oServerWS := CreateObject( 'MSXML2.ServerXMLHTTP.5.0' )  
              oServerWS := CreateObject( 'MSXML2.ServerXMLHTTP.6.0' )  
                 oServerWS := CreateObject("Microsoft.XMLHTTP")
     

     

     Windows 7 nao tem este recurso tentei varias veses inclusive instale os pack mais atualuizados e nao deu certo.  

    
            oServerWS := CreateObject( 'MSXML2.ServerXMLHTTP.5.0' )  
              oServerWS := CreateObject( 'MSXML2.ServerXMLHTTP.6.0' )  
                 oServerWS := CreateObject("Microsoft.XMLHTTP")

     

  10. Boa tarde!   

     

    Estou tentando implementar o acbr boletos  e estou sem conseguir gerar o numero de lote no arquivo de remessa    sempre  retoirna o mesmo numero de sequencial de arquivo lote. 

    oBoleto:GerarRemessa(".\remessa\rem\",2 ,"arquivo.rem")
    
    
    * metoda  estar assim 
    METHOD GerarRemessa(eDir, eNumArquivo, eNomeArq) CLASS ACBrBoleto
        local hResult
        hResult := DllCall(::hHandle, DLL_OSAPI, "Boleto_GerarRemessa", hb_StrToUTF8(eDir), eNumArquivo, hb_StrToUTF8(eNomeArq))
        ::CheckResult(hResult)
    RETURN nil
    
    
    

    Toda ajuda será bem vinda!   

  11. Em 31/03/2022 at 11:21, rochinha disse:

    Amiguinhos,

    Não vejo também problema em usar interface com outros programas:

    
    ...
          if file( cPathDados+"curl.exe" )
             cParameters := ' --get http://api.labelary.com/v1/printers/8dpmm/labels/4x6/0/' + ;
                            ' --data-urlencode "' + charRem( chr(13)+chr(10), cEtiqueta ) + '" > ' + cArquivo2
             cMacro      := cPathDados+"ZPLCURL.BAT"
             cComando    := cPathDados+"CURL.EXE " + cParameters
             //
             errhandle   := fCreate( cMacro )         
             fWrite( errhandle, cComando )
             fClose( errhandle )
             //
             MsgRun( "Aguarde o termino do processo", "Envio da Etiqueta...", {|| WaitRun( cMacro, 0 ) } )
          endif
    ...

    O curl.exe pode ser baixado deste link

    Rochinha, tem como pegar o retorno da api quando consumir a  API  com um comando externo tipo curl.exe   parametros 

  12. 5 horas atrás, rochinha disse:

    Amiguinhos,

    Não vejo também problema em usar interface com outros programas:

    
    ...
          if file( cPathDados+"curl.exe" )
             cParameters := ' --get http://api.labelary.com/v1/printers/8dpmm/labels/4x6/0/' + ;
                            ' --data-urlencode "' + charRem( chr(13)+chr(10), cEtiqueta ) + '" > ' + cArquivo2
             cMacro      := cPathDados+"ZPLCURL.BAT"
             cComando    := cPathDados+"CURL.EXE " + cParameters
             //
             errhandle   := fCreate( cMacro )         
             fWrite( errhandle, cComando )
             fClose( errhandle )
             //
             MsgRun( "Aguarde o termino do processo", "Envio da Etiqueta...", {|| WaitRun( cMacro, 0 ) } )
          endif
    ...

    O curl.exe pode ser baixado deste link

    Valeu Rochinha pelas dicas. Com certeza vai ajudar sim!

     

  13. 5 minutos atrás, gilmer disse:

    Bom Dia,

    O Harbour tem lib para libcurl, seria uma solução

     

    Sim eu vi esta lib conseguir fazer a parte de GET  porem na parte de post  nao achei nenhum exemplo mostrando como fazer um post e informar a chave key  precizo de um exemplo de posto ou put onde tem que informar a chave Key

  14. NDIR VISUALIZAÇÃO
     
    Com este codigo dar a menssagem que nao foi informato a chave key .... mas nao tenho a meno ideia de como passar esta chave key se alguem poder ajudar ficarei imenssamente grato.
     

    //------------------------------------------------------------------------------------------------
    function Send( )
       
       hCurl := curl_easy_init()
       
       cUrl := "https://bling.com.br/Api/v2/produtos/json/"
       cKey := "?apikey=81672077cde47c5ed795349ae17a98c1c1b10c9826041ecf9b9d28d9a1961c7204dc3b13"
       //cKey := "apikey=81672077cde47c5ed795349ae17a98c1c1b10c9826041ecf9b9d28d9a1961c7204dc3b13"
       cKey := "81672077cde47c5ed795349ae17a98c1c1b10c9826041ecf9b9d28d9a1961c7204dc3b13"
       cXml:= "<produto><codigo></codigo><descricao>Caneta Preta 001 xxxx</descricao><situacao>Ativo</situacao><descricaoCurta>Descrição curta da caneta</descricaoCurta><descricaoComplementar>Descrição produto 002</descricaoComplementar><un>Pc</un><vlr_unit>1.68</vlr_unit><preco_custo>1.23</preco_custo><peso_bruto>0.2</peso_bruto><peso_liq>0.18</peso_liq><class_fiscal>1000.01.01</class_fiscal><marca>Marca da Caneta</marca><origem>0</origem><estoque>10</estoque><deposito><id>14886559917</id><estoque>200</estoque></deposito><gtin>223435780</gtin><gtinEmbalagem>54546</gtinEmbalagem><largura>11</largura><altura>21</altura><profundidade>31</profundidade><estoqueMinimo>1.00</estoqueMinimo><estoqueMaximo>100.00</estoqueMaximo><cest>28.040.00</cest><idGrupoProduto>12345</idGrupoProduto><condicao>Novo</condicao><freteGratis>N</freteGratis><linkExterno>https://minhaloja.com.br/meu-produto</linkExterno><observacoes>Observações do meu produtos</observacoes><producao>P</producao><dataValidade>20/11/2019</dataValidade><descricaoFornecedor>Descrição do fornecedor</descricaoFornecedor><idFabricante>0</idFabricante><codigoFabricante>123</codigoFabricante><unidadeMedida>Centímetros</unidadeMedida><garantia>4</garantia><itensPorCaixa>2</itensPorCaixa><volumes>2</volumes><urlVideo>https://www.youtube.com/watch?v=zKKL-SgC5lY</urlVideo><imagens><url>https://bling.com.br/bling.jpg</url></imagens><idCategoria>4573031</idCategoria></produto>"
     *  Local httpcode

       curl_easy_setopt( hCurl, HB_CURLOPT_POST, 1 )
       curl_easy_setopt( hCurl, HB_CURLOPT_URL, cUrl + cKey )
      * curl_easy_setopt( hCurl, HB_CURLOPT_USERPWD, "xxxxxxxxxx$#B<SHJGHKxxxx" + ':' + "x@#$F&^%DEE" )
       
       /* define nome de usuário e senha para autenticação */
        *curl_easy_setopt(hCurl, 26 , cKey )
        *curl_easy_setopt( hCurl, 5, cKey )
        *curl_easy_setopt(hCurl, 87, cKey)
        //CURLOPT_HTTPHEADER 23
        curl_easy_setopt(hCurl, 23, "apikey: 81672077cde47c5ed795349ae17a98c1c1b10c9826041ecf9b9d28d9a1961c7204dc3b13");
       curl_easy_setopt( hCurl, HB_CURLOPT_DL_BUFF_SETUP )
       curl_easy_setopt( hCurl, HB_CURLOPT_SSL_VERIFYPEER, .F. )
    *    curl_easy_setopt(hCurl, 131, cXml )
        curl_easy_setopt (hCurl, 36 , "PUT" )
        curl_easy_setopt(hCurl, 15, cXml)
       //  aqui vai o xml do PUT DELETE OU POST
      // curl_easy_setopt( hcurl, HB_CURLOPT_POSTFIELDS, Send() )  15
       nError := curl_easy_perform( hCurl )
       ? nError
    *   curl_easy_getinfo( hCurl, HB_CURLINFO_RESPONSE_CODE, @httpcode )

          cResponse := curl_easy_dl_buff_get( hCurl )

      ?  cResponse
     
    return NIL            
  15. Estou tentando fazer um post  na  API BLING    e  gostaria da  ajuda dos colegas.

    Fazendo experiências primeiro com CURL.EXE  mandando um post  de cadastro na api conforme segue:.

     

    E estou recebendo este retorno de erro no xml:  

    {"retorno":{"erros":[[{"erro":{"cod":6,"msg":"Start tag expected, '&#60;' not found\n"}}]]}}

    Alguem poderia dar uma forca para mim.   NO final de tudo quero montar uma funcao em arbur para fazer esta interacao.

     

     curl -X POST "https://bling.com.br/Api/v2/deposito/json/"
          -d "apikey=81672077cde47c5ed795349ae17a98c1c1b10c9826041ecf9b9d28d9a1961c7204dc3b13"
          -d "xml=dep001.xml"
     

    <?xml version="1.0" encoding="UTF-8"?>
    <depositos>
        <deposito>
            <descricao>Depósito Padrão</descricao
            <situacao>A</situacao>
            <depositoPadrao>true</depositoPadrao>
            <desconsiderarSaldo>false</desconsiderarSaldo>
        </deposito>
    </depositos>

     

×
×
  • Create New...