Jump to content
Fivewin Brasil

Ariston Santos

Membros
  • Posts

    500
  • Joined

  • Last visited

  • Days Won

    11

Reputation Activity

  1. Haha
    Ariston Santos reacted to kapiaba in Download de imagem do produto - eanpictures   
    Ariston? Tais vivo ainda? Faz a pergunta e some kralho! kkkkkkkkkk abs.
     
  2. Like
    Ariston Santos reacted to rochinha in qtd de semanas no mês   
    Amiguinhos,
    Conheço um método bem complexo mas deve funcionar:
    dData := CTOD("30/10/12")? "Esta data esta na semana: ", WEEK( dData ) O Padrão ISO 8601 define que uma semana começa no Domingo, portanto se o dia 1 do mês da consulta cair num sábado este mês possui 6 semanas. Em qualquer outro dia da semana define que o mês tem 5 semanas.
    Então você podeusar a função BOM( StringDate ) Begining Of Month ou a função CDOW( CTOD( StringDate ) ) == "Saturday" poderá obter bom resultado.
  3. Thanks
    Ariston Santos reacted to kapiaba in CEP - Resolvido   
    Eu acho a solucao do Ariston, excelente! Many thanks. Regards, saludos.
  4. Like
    Ariston Santos got a reaction from kapiaba in Função para teste de CRC de campos DBF   
    Conceito de CRC (Cyclical Redundancy Check)
    A sigla CRC (sigla da expressão inglesa Cyclical Redundancy Check e que em português é traduzida por Verificação de Redundância Cíclica) consiste num número criado por um cálculo matemático no computador fonte de um pacote de dados. Quando o pacote chega a seu destino, o cálculo é refeito. Se os resultados forem os mesmos, isso indica que os dados no pacote permaneceram estáveis. No caso do cálculo no destino diferir do cálculo na fonte, tal significa que os dados foram alterados durante a transmissão. Neste caso, a rotina CRC sinaliza o computador fonte para retransmitir os dados.
    Fonte: http://knoow.net/ciencinformtelec/informatica/crc-cyclical-redundancy-check/
     
  5. Like
    Ariston Santos reacted to rochinha in O fivewin   
    Amiguinhos,
    emotta
    Lembro do Joinner, mas se não me engano ele era compativel com o clipper summer. A partir do clipper 5.01 já não era, ou seja, macros e code blocks não se conseguia usar no Joinner... Estou certo Rochinha? Isso mesmo. Apesar de gerar aplicativos para Windows ela ficou presa em um visual muito Windows 95. As peculiaridades das versões 5 em diante como permitir agregar Assembler e C não eram possíveis.
    O fato é q o Fivewin mudou a vida dos programadores q a usam. fladimir
    Com certeza. A sua chegada suplantou a Clip4Win, que era a bola da vez na época e se não me engano tinha outra biblioteca, Vouch32, que tinha o mesmo nicho, mas Fivewin matou a pau.
    Creio que se quisermos programar para outras plataformas, estilo android ao invés de lançar mão de pesados SDKs o que precisariamos é de um servidor web fivewin portado para estes sistemas. Assim como o Flamenco, HTSoft WinASP ou o próprio servidor do Harbour.
    O problema é que queremos gerar EXEcutáveis rodáveis nestas plataformas, como se quiséssemos rodar aplicativos ERP num android. O equipamento não foi feito para isto, mas foi feito para ser um ponto de entrada.
    Ariston Santos
    Enfim, programador hoje tem que saber, não uma linguagem, mas PROGRAMAR! Resta que idéias se tornem realidade.
  6. Like
    Ariston Santos reacted to Ladinilson in O fivewin   
    Agora quais tecnologias se usam na TOTVS?

    Pois se o ADVPL (que ao meu ver é a mesma coisa do FW) tem suas particularidades assim como suas limitações parecidas com o FW, como é conhecida como a maior empresa de tecnologia da américa latina.

    Não sei se estou desatualizado mas ao meu ver ela é a gigante usado uma linguagem semelhante a nossa.
    E como disse o Ariston..."
    Enfim, programador hoje tem que saber, não uma linguagem, mas PROGRAMAR!  
  7. Like
    Ariston Santos got a reaction from fladimir in O fivewin   
    É verdade. Hoje a pergunta "em que linguagem você programa?" está quase sem sentido. Eu, por exemplo:
    - Para desktop uso Fivewin / xHarbour / Bcc / Workshop / ACBrMonitorPLUS / Inno Setup.
    - Para web uso Html / Html5 / Php / CSS / Javascript.
    - Para Mobile uso Basic 4 Andriod.
    - Como banco de dados uso DBFCDX / MySQL / SQLLite / Firebird (e em breve MariaDB).
    - Ainda tem os que não são linguagem programação, mas estruturas para transporte de dados na web, como XML e JSON.
    Creio que a maioria dos colegas aqui também conhecem e usam essas e ainda outras linguagens.
    Enfim, programador hoje tem que saber, não uma linguagem, mas PROGRAMAR!
  8. Like
    Ariston Santos reacted to sygecom in desinstalar certificado   
    Abre o CMD(MS-DOS) e digite: certmgr , vai abrir o gerenciador de certificados, lá você consegue excluir os maleditos.
  9. Like
    Ariston Santos reacted to kapiaba in Como saber ser você está como administrador ou não.   
    // Como saber ser você está como administrador ou não.

    #include "FiveWin.ch" function Main()    ? IsUserAdmin() return nil FUNCTION IsUserAdmin() Return IsUserAnAdmin() /* *********************************************************************************** */ DLL32 STATIC FUNCTION IsUserAnAdmin() AS BOOL PASCAL LIB "Shell32.dll" /* *********************************************************************************** */
     
  10. Like
    Ariston Santos reacted to kapiaba in Biometria   
    https://www.4shared.com/zip/K7NVsrt8ce/Biometria.html
    By Ariston Santos - dúvidas, fale com ele.
    https://www.4shared.com/rar/1WEwoTXWca/SISPONTO.html
    Abs.
  11. Like
    Ariston Santos got a reaction from rochinha in Foto no perfil - O retorno (kkk)   
    Deve ser isso mesmo. Vou me contentar com a imagem do "Sem foto". É mais linda! 
  12. Like
    Ariston Santos got a reaction from Theotokos in 2nd FWH + [x]Harbour 2018 international conference in Brazil   
    Quero participar mas não vou poder ir.
    Já pensaram na ideia de fazer a transmissão online? Talvez disponibilizando uma página onde apenas os cadastrados mediante o pagamento de uma taxa possam acessar e assistir ao evento?
    #ficaadica
  13. Like
    Ariston Santos reacted to kapiaba in Menus new clauses Wiki   
    http://wiki.fivetechsoft.com/doku.php?id=fivewin_menu_descolgante
     
    http://forums.fivetechsupport.com/viewtopic.php?f=6&t=34320
     
  14. Like
    Ariston Santos reacted to oribeiro in Impressão contínua com Printer   
    João,
    Segui o modelo do Ariston acima e funcionou perfeitamente.
    Muito obrigado pelo interesse em ajudar e pelas dicas. 
  15. Like
    Ariston Santos reacted to kapiaba in Senha por biometria   
    Valeu garoto. Agora abriu! Many trhanks.
     

     
    Obg. abs.
  16. Like
    Ariston Santos reacted to kapiaba in Senha por biometria   
    Ariston, correção:

       // Verificar erros de marcação    USE PONTO EXCLUSIVE NEW    IF ! NETERR()       OrdListClear()       OrdListAdd("PONTO", "PntoCODI", "PntoNOME", "PntoDATA", "PntoNDAT")       PONTO->(DBGOTOP())       IF ChecaErro(OrdCount()) .OR. PONTO->(RECCOUNT()) = 0 .OR. PONTO->(EOF()) = .T.          INDEX ON CODIGO TAG PntoCODI TO PONTO          INDEX ON ITEM02 TAG PntoNOME TO PONTO          INDEX ON ITEM05 TAG PntoDATA TO PONTO          INDEX ON INDICE TAG PntoNDAT TO PONTO       ENDIF    ENDIF    CLOSE ALL //-> Verifica a Integridade do indice FUNCTION ChecaErro(nKeys)    LOCAL lErr := .F.    c_Alias := ALIAS()    FOR Key := 1 TO nKeys       &(c_Alias)->(DBSETORDER(Key))       IF nKeys != LEN(&(c_Alias)->(GetOrdNames())) // .OR. ORDKEYCOUNT() # RECCOUNT()          lErr := .T.          MsgStop( "ATENÇÃO !..."+CRLF+CRLF+;                   "O sistema detectou que um dos índices do arquivo: " +ALIAS()+ ".DBF"+CRLF+ ;                   "está corrompido ou desatualizado. Isto ocorre às vezes por queda"+CRLF+ ;                   "de energia, vírus ou desligamento incorreto do computador. Será preciso"+CRLF+ ;                   "corrigir o problema para evitar erros na operação do Sistema."+CRLF+ ;                   "O arquivo corrompido será excluído e o Programa será encerrado. Execute"+CRLF+ ;                   "o programa novamente para que seja feia a correção. Tecle Enter...",;                   "Erro de índece: Correção obrigatória" )       ENDIF       SysRefresh()    NEXT RETURN(lErr)
     
  17. Like
    Ariston Santos got a reaction from kapiaba in Senha por biometria   
    Testei novamente e baixou sem problema. A bronca deve ser somente no PC de quem não está conseguindo baixar. Tentem outro navegador, ou até mesmo copiando e colando o link na barra de endereços.
    http://www.arsoft-ap.com.br/fd456406745d816a45cae554c788e754/08dc2d813326fd8ac79eb734d96b56ff/sisponto_completo.zip  
  18. Like
    Ariston Santos got a reaction from kapiaba in Senha por biometria   
    Posso disponibilizar sim. Baixem deste link:
    Baixar código fonte do SISPONTO
  19. Like
    Ariston Santos got a reaction from Theotokos in Senha por biometria   
    Posso disponibilizar sim. Baixem deste link:
    Baixar código fonte do SISPONTO
  20. Like
    Ariston Santos reacted to msdn in NFCe - qual opção é a melhor ?   
    Obrigado pelos esclarecimentos Ariston, vou acessar o site e pesquisar mais sobre o ACBr, como já programei um pouco com Delphi alguns anos atrás, vou tentar fazer o módulo da NFCe usando o Lazarus, instalando os componentes, nesse vídeo mostra como instalar :
    https://www.youtube.com/watch?v=lUe2Om19QhU&t=2s
    Abraços
  21. Like
    Ariston Santos reacted to rochinha in Imprimir via INTERNET   
    Amiguinhos,
    Isto é muito fácil de resolver, e não tem que ficar configurando VPN, TCP-IP do servidor, DDNS ou NoIP.
    Você precisará apenas criar um pequeno aplicativo que seja instalado nesta máquina do depósito e que leia o conteúdo de uma pasta e quando encontrar um arquivo especificado por você então processa a impressão.
    No servidor seu sistema mandará o arquivo para uma pasta especifica, ou seja:
    Crie a pasta c:\intranet\envios no servidor.
    Crie a pasta c:\intranet\recebidos no cliente distante.
    Crie uma conta no Mega Sync, Instale o [url=https://megasync.br.uptodown.com/windows]MegaSync Desktop[/url] nas duas máquinas e configure 
    no servidor para ler em c:\intranet\envios e no cliente distante para ler em c:\intranet\recebidos.
    Deixe os serviços rodarem e jogue arquivos nas pasta para ver o que acontece.
    Se gostou, dê um "LIKE" e ajude nosso canalforum.
  22. Like
    Ariston Santos reacted to william in SNGPC do zero - Preciso de ajuda   
    vamos lá:
     
    1 - De que se trata o inventário? Seria o estoque da farmácia no banco de dados do SNGPC?
    R- Sim é o cadastro de produtos controlados contendo quantidade, codigo de barras , numero do lote , numero da Anvisa do medicamento, etc...
     
    2 - Os medicamentos e insumos movimentados (enviados) são incluídos e baixados do inventário?
    R- Sim devem ser incluidos as quantidades e numeros de lote de tudo que é comprado. E tudo que se vende tambem deve ser baixado. Sendo assim , na Anvisa fica uma cópia do estoque da farmacia. Os envios diarios dos xmls que atualizam o estoque na Anvisa. Diariamente é transmitido um xml com o resumo de tudo que entrou e saiu dos medic e insumos controlados,
     
    3 - Quais as limitações ou requisitos para envio de inventários?
    R- Nao me lembro bem, mas acredito que o inventario deva ser entregue no inicio das operacoes da farmacia. Ou com a troca do responsavel , ou para acerto de estoque. Tem diversos motivos pra isso. No site  do SNGPC tem um item "Finalizar Inventario" e lá mostra a lista de motivos existentes.
     
    Att.
     
    William
     
     
     
  23. Like
    Ariston Santos reacted to william in SNGPC do zero - Preciso de ajuda   
    aos que precisarem, segue o restante :
     

     
    Exemplo - Enviando arquivo XML

    Nesse segundo exemplo, vamos enviar o arquivo XML para ANVISA. Note que no XML as tags < e > devem ser trocadas por & l t ; e & g t ;.
    Claro que esse hash calculado deve ser gravado em algum lugar para depois testar se o arquivo foi recebido, se está com erros, etc. Vamos ver o uso desse código no próximo exemplo.





     

     

     

     
    #define CR_LF chr(13) + chr(10)


     
    ***************

    FUNCTION MAIN()

    ***************

       if !InternetOK()

          Alert("Sem conexão com a Internet. Verifique...")

          return .F.

       endif

       //

       // ABERTURA DAS FUNCOES PARA WEBSERVICE DO XHARBOUR - OBJETO HTTP

       //

       try

          http := CreateObject( "MSXML2.XMLHTTP" )

       catch

          try

             http := CreateObject( "MSXML2.XMLHTTP" )

          catch

             Alert("Erro na criação do objeto MSXML2.XMLHTTP : " + Ole2TxtError())

          end

       end

       //

       // CRIA OBJETO XML

       //

       try

          doc := CreateObject( "MSXML2.DOMDocument" )

       catch

          try

             doc := CreateObject( "MSXML2.DOMDocument" )

          catch

             Alert("Erro na criacao do objeto MSXML2.DOMDocument : " + Ole2TxtError())

             return NIL

          end

       end


     
       cFile := memoread( seu_arquivo_xml )

       cHash := HB_MD5File( seu_arquivo_xml )


     
       cXml := ""

       cXml += '<?xml version="1.0" encoding="ISO-8859-1" ?>' + CR_LF

       cXml += '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">' + CR_LF

       cXml += '  <soapenv:Header/>' + CR_LF

       cXml += '  <soapenv:Body>' + CR_LF

       cXml += '    <tem:EnviaArquivoSNGPC>' + CR_LF

       cXml += '      <tem:Email>' + SEU_EMAIL_AQUI + '</tem:Email>' + CR_LF

       cXml += '      <tem:Senha>' + SUA_SENHA_AQUI + '</tem:Senha>' + CR_LF

       cXml += '      <tem:Arquivo>' + cFile + '</tem:Arquivo>' + CR_LF

       cXml += '      <tem:HashIdentificacao>' + cHash + '</tem:HashIdentificacao>' + CR_LF

       cXml += '    </tem:EnviaArquivoSNGPC>' + CR_LF

       cXml += '  </soapenv:Body> ' + CR_LF

       cXml += '</soapenv:Envelope>' + CR_LF


     
    //

    // ENDERECO HOMOLOGACAO

    //

       http:Open( "POST", "http://homologacao.anvisa.gov.br/sngpc/webservice/sngpc.asmx?WSDL HTTP/1.1", .F. )

       http:SetRequestHeader( "Content-Type"   , "text/xml;charset=ISO-8859-1" )

       http:SetRequestHeader( "SOAPAction"     , "http://tempuri.org/EnviaArquivoSNGPC" )

       http:SetRequestHeader( "Host"           , "homologacao.anvisa.gov.br" )


     
    //

    // ENDERECO PRODUCAO

    //

    // http:Open( "POST", "http://sngpc.anvisa.gov.br/webservice/sngpc.asmx?WSDL HTTP/1.1", .F. )

    // http:SetRequestHeader( "Content-Type"   , "text/xml;charset=ISO-8859-1" )

    // http:SetRequestHeader( "SOAPAction"     , "http://tempuri.org/EnviaArquivoSNGPC" )

    // http:SetRequestHeader( "Host"           , "sngpc.anvisa.gov.br" )


     
       doc:LoadXML( cXml )

       http:send( doc:xml )

       response  := http:responseText

       oXmlDoc   := TXmlDocument():new()

       oXMlDoc:read( response )


     
       oXmlNode := oXmlDoc:findFirst( "EnviaArquivoSNGPCResult" )

       if empty( oXmlNode:cData )

          Alert("Erro no envio do arquivo para ANVISA. Tente outra vez.")

       elseif upper( left( oXmlNode:cData, 28 ) ) == "ARQUIVO RECEBIDO COM SUCESSO"

          Alert(oXmlNode:cData)

       else

          Alert(oXmlNode:cData)

          Alert("Erro no envio do arquivo para ANVISA. Tente outra vez.")

       endif

    RETURN NIL


     
    *********************

    FUNCTION InternetOK()

    *********************

       local aHosts, cName, cAddress := "www.google.com.br"

       InetInit()

       aHosts := InetGetHosts( cAddress )

       if aHosts == NIL .or. len(aHosts) == 0

          InetCleanup()

          return .F.

       endif

       InetCleanup()

    RETURN .T.

  24. Like
    Ariston Santos reacted to william in SNGPC do zero - Preciso de ajuda   
    olá achei isso, veja se te ajuda.
    William
    // // Recuperar inventario da ANVISA para o SNGPC. // Manoel Angeiras, 2011 // #define STRU_TMP { { "NUMMS ", "C", 13, 0 }, { "NOMEPRO ", "C", 46, 0 },; { "NUMLOTE ", "C", 20, 0 }, { "QTDLOTE ", "N", 6, 0 } } *************** FUNCTION MAIN() *************** if !InternetOK() Alert("Sem conexão com a Internet. Verifique...") return .F. endif // // ABERTURA DAS FUNCOES PARA WEBSERVICE DO XHARBOUR // try http := CreateObject( "MSXML2.XMLHTTP" ) catch try http := CreateObject( "MSXML2.XMLHTTP" ) catch Alert("Erro na criação do objeto MSXML2.XMLHTTP : " + Ole2TxtError()) end end // // AS COMUNICACOES SEGUINTES FORAM BASEADAS NA MINHA OBSERVACAO DE LOGIN // MANUAL NO SITE DA ANVISA, USANDO UM WEB DEBUGGER // // // VERIFICAR A DISPONIBILIDADE DO SITE DA ANVISA // cRet := RequestOpen() // // CONFIGURAR E LER COOKIE CRIADO POR ESSA COMUNICACAO // cCookie := LerCookie() // // FAZER LOGIN NO SITE ANVISA // cRet := Login( alltrim( cCookie ), SEU_EMAIL, SUA_SENHA ) memowrit("lerinv.txt", cRet) // // SALVEI A RESPOSTA EM .TXT, MAS NA VERDADE UM XML, ACHO QUE Dµ PRA LER // COM A CLASSE TxmlDocument // cEmpresa := cRT := cNome := "" AchaToken("lerinv.txt", @cEmpresa, @cRT, @cNome) if empty( cEmpresa ) Alert("Problema na identificacao da empresa. Verifique...") return .F. endif if empty( cRT ) Alert("Problema na identificacao do Responsavel Tecnico. Verifique") return .F. endif // // SELECIONA A EMPRESA. TEM AQUI UMA LIMITACAO : O RESPONSAVEL TECNICO SO // PODE ESTAR LIGADO A UMA EMPRESA ( FARMACEUTICO NO INTERIOR DOS ESTADOS // PODEM CONTROLAR AT DUAS FARMACIAS/DROGARIAS ). SE POSSUIR MAIS DE UMA // EMPRESA, NAO LE CORRETAMENTE // cRet := SelEmpresa( cCookie, cEmpresa, cRT, cNome ) memowrit("lerinv.txt", cRet) cID1 := AchaToken2("lerinv.txt") // // SELECIONA RESPONSAVEL TECNICO // cRet := SelRT( cCookie, cEmpresa, cRT, cNome, cID1 ) // // LER MENU DO SITE ANVISA // LerMenu( cCookie ) // // LER INVENTARIO. ACHO QUE ESSE PASSO PODE SER DESCONSIDERADO // cRet := VerInv( cCookie ) memowrit("verinv.txt", cRet) // // CHAMO A TELA DE FINALIZACAO DO INVENTARIO, QUE CONTEM OS PRODUTOS COM OS // SEUS LOTES // cRet := FimInv( cCookie ) memowrit("lotesinv.txt", cRet) // // GRAVO O RESULTADO EM UM DBF PARA PROCESSAR DEPOIS // lRet := CriaDBF( "lotesinv.txt" ) RETURN lRet ***************************** STATIC FUNCTION REQUESTOPEN() ***************************** // // ENDERECO DE HOMOLOGACAO // http:Open( "GET", "http://homologacao.anvisa.gov.br/sngpc/", .F. ) http:SetRequestHeader( "Accept", "*/*" ) http:SetRequestHeader( "Accept-Language", "pt-br" ) http:SetRequestHeader( "Accept-Encoding", "gzip, deflate" ) http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) http:SetRequestHeader( "Host" , "homologacao.anvisa.gov.br" ) http:SetRequestHeader( "Connection" , "Keep-Alive" ) // // ENDERECOS DE PRODUCAO // // http:Open( "GET", "https://sngpc.anvisa.gov.br/", .F. ) // http:SetRequestHeader( "Accept", "*/*" ) // http:SetRequestHeader( "Accept-Language", "pt-br" ) // http:SetRequestHeader( "Accept-Encoding", "gzip, deflate" ) // http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) // http:SetRequestHeader( "Host" , "sngpc.anvisa.gov.br" ) // http:SetRequestHeader( "Connection" , "Keep-Alive" ) http:send() response := http:statusText RETURN response *************************** STATIC FUNCTION LERCOOKIE() *************************** // // ENDERECO DE HOMOLOGACAO // http:Open( "GET", "http://homologacao.anvisa.gov.br/sngpc/includes/fundo.asp", .F. ) http:SetRequestHeader( "Accept", "image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-silverlight, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*" ) http:SetRequestHeader( "Referer", "http://homologacao.anvisa.gov.br/sngpc/" ) http:SetRequestHeader( "Accept-Language", "pt-br" ) http:SetRequestHeader( "Accept-Encoding", "gzip, deflate" ) http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) http:SetRequestHeader( "Host" , "homologacao.anvisa.gov.br" ) http:SetRequestHeader( "Connection" , "Keep-Alive" ) // // ENDERECO DE PRODUCAO // // http:Open( "GET", "https://sngpc.anvisa.gov.br/includes/fundo.asp", .F. ) // http:SetRequestHeader( "Accept", "image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-silverlight, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*" ) // http:SetRequestHeader( "Referer", "https://sngpc.anvisa.gov.br/" ) // http:SetRequestHeader( "Accept-Language", "pt-br" ) // http:SetRequestHeader( "Accept-Encoding", "gzip, deflate" ) // http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) // http:SetRequestHeader( "Host" , "sngpc.anvisa.gov.br" ) // http:SetRequestHeader( "Connection" , "Keep-Alive" ) http:send() response := http:getResponseHeader("Set-Cookie") RETURN response ************************************************ STATIC FUNCTION LOGIN( cCookie, memail, msenha ) ************************************************ // // ENDERECO DE HOMOLOGACAO // http:Open( "POST", "http://homologacao.anvisa.gov.br/sngpc/includes/AcessoPersistir.asp", .F. ) http:SetRequestHeader( "Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ) http:SetRequestHeader( "Referer" , "http://homologacao.anvisa.gov.br/sngpc/includes/login.asp" ) http:SetRequestHeader( "Accept-Language" , "pt-br" ) http:SetRequestHeader( "Accept-Encoding" , "gzip, deflate" ) http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) http:SetRequestHeader( "Host" , "homologacao.anvisa.gov.br" ) http:SetRequestHeader( "Connection" , "Keep-Alive" ) http:SetRequestHeader( "Keep-Alive" , "115" ) http:SetRequestHeader( "Cookie" , cCookie ) http:SetRequestHeader( "Content-Type" , "application/x-www-form-urlencoded" ) // // ENDERECO DE PRODUCAO // // http:Open( "POST", "https://sngpc.anvisa.gov.br/includes/AcessoPersistir.asp", .F. ) // http:SetRequestHeader( "Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ) // http:SetRequestHeader( "Referer" , "https://sngpc.anvisa.gov.br/includes/login.asp" ) // http:SetRequestHeader( "Accept-Language" , "pt-br" ) // http:SetRequestHeader( "Accept-Encoding" , "gzip, deflate" ) // http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) // http:SetRequestHeader( "Host" , "sngpc.anvisa.gov.br" ) // http:SetRequestHeader( "Connection" , "Keep-Alive" ) // http:SetRequestHeader( "Keep-Alive" , "115" ) // http:SetRequestHeader( "Cookie" , cCookie ) // http:SetRequestHeader( "Content-Type" , "application/x-www-form-urlencoded" ) http:send( "email=" + memail + "&senha=" + msenha + "&Entrar=Entrar" ) response := http:responseText RETURN response ****************************************************** STATIC FUNCTION SELEMPRESA( cCookie, cID, cRT, cNome ) ****************************************************** // // ENDERECO DE HOMOLOGACAO // http:Open( "POST", "http://homologacao.anvisa.gov.br/sngpc/includes/AcessoPersistir.asp", .F. ) http:SetRequestHeader( "Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ) http:SetRequestHeader( "Referer" , "http://homologacao.anvisa.gov.br/sngpc/includes/AcessoPersistir.asp") http:SetRequestHeader( "Accept-Language" , "pt-br" ) http:SetRequestHeader( "Accept-Encoding" , "gzip, deflate" ) http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) http:SetRequestHeader( "Host" , "homologacao.anvisa.gov.br" ) http:SetRequestHeader( "Connection" , "Keep-Alive" ) http:SetRequestHeader( "Keep-Alive" , "115" ) http:SetRequestHeader( "Cookie" , cCookie ) http:SetRequestHeader( "Content-Type" , "application/x-www-form-urlencoded" ) // // ENDERECO DE PRODUCAO // // http:Open( "POST", "https://sngpc.anvisa.gov.br/includes/AcessoPersistir.asp", .F. ) // http:SetRequestHeader( "Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ) // http:SetRequestHeader( "Referer" , "https://sngpc.anvisa.gov.br/includes/AcessoPersistir.asp") // http:SetRequestHeader( "Accept-Language" , "pt-br" ) // http:SetRequestHeader( "Accept-Encoding" , "gzip, deflate" ) // http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) // http:SetRequestHeader( "Host" , "sngpc.anvisa.gov.br" ) // http:SetRequestHeader( "Connection" , "Keep-Alive" ) // http:SetRequestHeader( "Keep-Alive" , "115" ) // http:SetRequestHeader( "Cookie" , cCookie ) // http:SetRequestHeader( "Content-Type" , "application/x-www-form-urlencoded" ) http:send( "hidPasso=1&hidPessoaRepresentada=" + cID +; "&hidTipoPessoaRepresentada=&hidPessoaFisica=" + cRT +; "&hidNomeEmpresa=" + cNome +; "&hidRepresentante=&hiComboRepresentacao=&hiComboRepresenta=" + cID +; "&Representa=&Representacao=&IDPESSOAREPRESENTADA=" + cID ) response := http:responseText RETURN response ******************************************************* STATIC FUNCTION SELRT( cCookie, cID, cRT, cNome, cID1 ) ******************************************************* // // ENDERECO DE HOMOLOGACAO // http:Open( "POST", "http://homologacao.anvisa.gov.br/sngpc/includes/AcessoPersistir.asp", .F. ) http:SetRequestHeader( "Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ) http:SetRequestHeader( "Referer" , "http://homologacao.anvisa.gov.br/sngpc/includes/AcessoPersistir.asp") http:SetRequestHeader( "Accept-Language" , "pt-br" ) http:SetRequestHeader( "Accept-Encoding" , "gzip, deflate" ) http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) http:SetRequestHeader( "Host" , "homologacao.anvisa.gov.br" ) http:SetRequestHeader( "Connection" , "Keep-Alive" ) http:SetRequestHeader( "Keep-Alive" , "115" ) http:SetRequestHeader( "Cookie" , cCookie ) http:SetRequestHeader( "Content-Type" , "application/x-www-form-urlencoded" ) // // ENDERECO DE PRODUCAO // // http:Open( "POST", "https://sngpc.anvisa.gov.br/includes/AcessoPersistir.asp", .F. ) // http:SetRequestHeader( "Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ) // http:SetRequestHeader( "Referer" , "https://sngpc.anvisa.gov.br/includes/AcessoPersistir.asp") // http:SetRequestHeader( "Accept-Language" , "pt-br" ) // http:SetRequestHeader( "Accept-Encoding" , "gzip, deflate" ) // http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) // http:SetRequestHeader( "Host" , "sngpc.anvisa.gov.br" ) // http:SetRequestHeader( "Connection" , "Keep-Alive" ) // http:SetRequestHeader( "Keep-Alive" , "115" ) // http:SetRequestHeader( "Cookie" , cCookie ) // http:SetRequestHeader( "Content-Type" , "application/x-www-form-urlencoded" ) http:send( "hidPasso=2&hidPessoaRepresentada=" + cID +; "&hidTipoPessoaRepresentada=1" +; "&hidPessoaFisica=" + cRT +; "&hidNomeEmpresa=" + cNome +; "&hidRepresentante=" + cID1 +; "&hiComboRepresentacao=RESPONS%C1VEL+T%C9CNICO" +; "&hiComboRepresenta=" + cID +; "&Representa=" + cID +; "&Representacao=" +; "&IDPESSOAREPRESENTADA=" + cID +; "&CBOTIPOS=1" ) response := http:responseText RETURN response ********************************** STATIC FUNCTION LERMENU( cCookie ) ********************************** // // ENDERECO DE HOMOLOGACAO // http:Open( "GET", "http://homologacao.anvisa.gov.br/sngpc/includes/menu.asp", .F. ) http:SetRequestHeader( "Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ) http:SetRequestHeader( "Referer" , "http://homologacao.anvisa.gov.br/sngpc/includes/AcessoPersistir.asp") http:SetRequestHeader( "Accept-Language" , "pt-br" ) http:SetRequestHeader( "Accept-Encoding" , "gzip, deflate" ) http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) http:SetRequestHeader( "Host" , "homologacao.anvisa.gov.br" ) http:SetRequestHeader( "Connection" , "Keep-Alive" ) http:SetRequestHeader( "Cookie" , cCookie ) // // ENDERECO DE PRODUCAO // // http:Open( "GET", "https://sngpc.anvisa.gov.br/includes/menu.asp", .F. ) // http:SetRequestHeader( "Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ) // http:SetRequestHeader( "Referer" , "https://sngpc.anvisa.gov.br/includes/AcessoPersistir.asp") // http:SetRequestHeader( "Accept-Language" , "pt-br" ) // http:SetRequestHeader( "Accept-Encoding" , "gzip, deflate" ) // http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) // http:SetRequestHeader( "Host" , "sngpc.anvisa.gov.br" ) // http:SetRequestHeader( "Connection" , "Keep-Alive" ) // http:SetRequestHeader( "Cookie" , cCookie ) http:send() response := http:responseText RETURN response ********************************* STATIC FUNCTION VERINV( cCookie ) ********************************* // // ENDERECO DE HOMOLOGACAO // http:Open( "GET", "http://homologacao.anvisa.gov.br/sngpc/sngpc_frmVisualizaInventario.asp", .F. ) http:SetRequestHeader( "Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ) http:SetRequestHeader( "Referer" , "http://homologacao.anvisa.gov.br/sngpc/includes/menu.asp") http:SetRequestHeader( "Accept-Language" , "pt-br" ) http:SetRequestHeader( "Accept-Encoding" , "gzip, deflate" ) http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) http:SetRequestHeader( "Host" , "homologacao.anvisa.gov.br" ) http:SetRequestHeader( "Connection" , "Keep-Alive" ) http:SetRequestHeader( "Cookie" , cCookie ) // // ENDERECO DE PRODUCAO // // http:Open( "GET", "https://sngpc.anvisa.gov.br/sngpc_frmVisualizaInventario.asp", .F. ) // http:SetRequestHeader( "Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ) // http:SetRequestHeader( "Referer" , "https://sngpc.anvisa.gov.br/includes/menu.asp") // http:SetRequestHeader( "Accept-Language" , "pt-br" ) // http:SetRequestHeader( "Accept-Encoding" , "gzip, deflate" ) // http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) // http:SetRequestHeader( "Host" , "sngpc.anvisa.gov.br" ) // http:SetRequestHeader( "Connection" , "Keep-Alive" ) // http:SetRequestHeader( "Cookie" , cCookie ) http:send() response := http:responseText RETURN response ********************************* STATIC FUNCTION FIMINV( cCookie ) ********************************* // // ENDERECO HOMOLOGACAO // http:Open( "GET", "http://homologacao.anvisa.gov.br/sngpc/sngpc_frmFinalizaInventario.asp", .F. ) http:SetRequestHeader( "Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ) http:SetRequestHeader( "Referer" , "http://homologacao.anvisa.gov.br/sngpc/includes/menu.asp") http:SetRequestHeader( "Accept-Language" , "pt-br" ) http:SetRequestHeader( "Accept-Encoding" , "gzip, deflate" ) http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) http:SetRequestHeader( "Host" , "homologacao.anvisa.gov.br" ) http:SetRequestHeader( "Connection" , "Keep-Alive" ) http:SetRequestHeader( "Cookie" , cCookie ) // // ENDERECO DE PRODUCAO // // http:Open( "GET", "https://sngpc.anvisa.gov.br/sngpc_frmFinalizaInventario.asp", .F. ) // http:SetRequestHeader( "Accept" , "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ) // http:SetRequestHeader( "Referer" , "https://sngpc.anvisa.gov.br/includes/menu.asp") // http:SetRequestHeader( "Accept-Language" , "pt-br" ) // http:SetRequestHeader( "Accept-Encoding" , "gzip, deflate" ) // http:SetRequestHeader( "User-Agent" , "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS25991; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; AskTB5.6)" ) // http:SetRequestHeader( "Host" , "sngpc.anvisa.gov.br" ) // http:SetRequestHeader( "Connection" , "Keep-Alive" ) // http:SetRequestHeader( "Cookie" , cCookie ) http:send() response := http:responseText RETURN response ************************************************** STATIC FUNCTION ACHATOKEN( cFile, cEmp, cRT, cRS ) ************************************************** local aLines, nHand2, nA, nB, nPos, cRet := "" aLines := {} nHand2 := fopen( cFile ) cLine := "" while HB_FReadLine( nHand2, @cLine ) == 0 aadd( aLines, upper( cLine ) ) enddo aadd( aLines, cLine ) fClose( nHand2 ) for nA := 1 to len( aLines ) if ( nPos := at( '<INPUT TYPE="HIDDEN" NAME="HIDPESSOAFISICA" VALUE="', aLines[nA] ) ) # 0 for nB := nPos+51 to len( aLines[ nA ] ) if substr( aLines[ nA ], nB, 1 ) # '"' cRT += substr( aLines[ nA ], nB, 1 ) else exit endif next endif if ( nPos := at( "<OPTION VALUE='", aLines[nA] ) ) # 0 for nB := nPos+15 to len( aLines[ nA ] ) if substr( aLines[ nA ], nB, 1 ) # "<" cEmp += substr( aLines[ nA ], nB, 1 ) else exit endif next endif next x1 := x2 := "" lOK:= .F. for nA := 1 to len( cEmp ) if substr( cEmp, nA, 1 ) # "'" .and. !lOk x1 += substr( cEmp, nA, 1 ) else if !lOK nA++ lOk := .T. else x2 += substr( cEmp, nA, 1 ) endif endif next cEmp := x1 cRS := strtran( x2, " ", "+" ) RETURN *********************************** STATIC FUNCTION ACHATOKEN2( cFile ) *********************************** local aLines, nHand2, nA, nB, nPos, cRet := "" aLines := {} nHand2 := fopen( cFile ) cLine := "" while HB_FReadLine( nHand2, @cLine ) == 0 aadd( aLines, alltrim( upper( cLine ) ) ) enddo aadd( aLines, cLine ) fClose( nHand2 ) for nA := 1 to len( aLines ) if ( nPos := at( "<OPTION ID='", aLines[nA] ) ) # 0 for nB := nPos+12 to len( aLines[ nA ] ) if substr( aLines[ nA ], nB, 1 ) # "'" cRet += substr( aLines[ nA ], nB, 1 ) else exit endif next endif next RETURN cRet ******************************** STATIC FUNCTION CRIADBF( cFile ) ******************************** local aLines, nHand2, nA, nB, nPos, cRet := "" aLines := {} nHand2 := fopen( cFile ) cLine := "" while HB_FReadLine( nHand2, @cLine ) == 0 aadd( aLines, alltrim( upper( cLine ) ) ) enddo aadd( aLines, cLine ) fClose( nHand2 ) lMS := lNome := lLote := lQtd := .F. cMS := cNome := cLote := cQtd := "" aInv:= {} for nA := 1 to len( aLines ) // // LE O MS DO PRODUTO // if ( nPos := at( '<TD WIDTH="17%" CLASS="SEMBORDA" HEIGHT="20">', aLines[nA] ) ) # 0 for nB := nPos+45 to len( aLines[ nA ] ) if substr( aLines[ nA ], nB, 1 ) # "<" cMS += substr( aLines[ nA ], nB, 1 ) lMS := .T. else exit endif next endif // // LE O NOME DO PRODUTO // if ( nPos := at( '<TD WIDTH="50%" CLASS="SEMBORDA" HEIGHT="20">', aLines[nA] ) ) # 0 for nB := nPos+45 to len( aLines[ nA ] ) if substr( aLines[ nA ], nB, 1 ) # "<" cNome += substr( aLines[ nA ], nB, 1 ) lNome := .T. else exit endif next endif // // LE O LOTE DO PRODUTO // if ( nPos := at( '<TD WIDTH="18%" CLASS="SEMBORDA" HEIGHT="20">', aLines[nA] ) ) # 0 for nB := nPos+45 to len( aLines[ nA ] ) if substr( aLines[ nA ], nB, 1 ) # "<" cLote += substr( aLines[ nA ], nB, 1 ) lLote := .T. else exit endif next endif // // LE A QUANTIDADE DO PRODUTO // if ( nPos := at( '<TD WIDTH="15%" CLASS="SEMBORDA" HEIGHT="20">', aLines[nA] ) ) # 0 for nB := nPos+45 to len( aLines[ nA ] ) if substr( aLines[ nA ], nB, 1 ) # "<" cQtd += substr( aLines[ nA ], nB, 1 ) lQtd := .T. else exit endif next endif if lMS .and. lNome .and. lLote .and. lQtd aadd( aInv, { cMS, cNome, cLote, cQtd } ) lMS := lNome := lLote := lQtd := .F. cMS := cNome := cLote := cQtd := "" endif next if empty( aInv ) return .F. endif dbCreate( "TEMP.DBF", STRU_TMP ) use ("TEMP.DBF") alias tmp exclusive new if neterr() return .F. endif for nA := 1 to len( aInv ) tmp->(dbAppend()) tmp->numms := TiraPonto( aInv[ nA, 1 ] ) tmp->nomepro := aInv[ nA, 2 ] tmp->numlote := aInv[ nA, 3 ] tmp->qtdlote := val( aInv[ nA, 4 ] ) next tmp->(dbCloseArea()) RETURN .T. ******************************* STATIC FUNCTION TIRAPONTO( ms ) ******************************* local nA, nLen := len( alltrim( ms ) ), cRet := "" for nA := 1 to nLen if isdigit( substr( ms, nA, 1 ) ) cRet += substr( ms, nA, 1 ) endif next RETURN cRet ********************* FUNCTION InternetOK() ********************* local aHosts, cName, cAddress := "www.google.com.br" InetInit() aHosts := InetGetHosts( cAddress ) if aHosts == NIL .or. len(aHosts) == 0 InetCleanup() return .F. endif InetCleanup() RETURN .T.  
  25. Like
    Ariston Santos reacted to william in SNGPC do zero - Preciso de ajuda   
    Olá, Depois de muito tempo gerando o XML e usando o próprio site do SNGPC para enviar meus arquivos, decidi que já era hora de enviar esses arquivos do meu sistema. Criei os tres serviços oficiais do SNGPC ( validar usuário, enviar arquivo XML e testar arquivo enviado ) mais a importação do inventário direto da ANVISA. Essa primeira rotina, valida um email/senha para ver se esta cadastrado no SNGPC da ANVISA. No código estão os endereços de homologação e produção. // // WebService com xHarbour // // Nesse exemplo estamos testando se o email/senha do usuario // esta cadastrado no SNGPC da ANVISA. // // Existem ainda mais 2 servicos : // // a) enviar arquivo XML. // b) verificar se arquivo XML enviado foi validado. // // Manoel Angeiras // #define CR_LF chr(13) + chr(10) *************** FUNCTION MAIN() *************** if !InternetOK() Alert("Conexao com a internet falhou !") else Alert("Conexao OK") endif // // Abertura das funcoes para WebService do xHarbour // try doc := CreateObject( "MSXML2.DOMDocument" ) catch try doc := CreateObject( "MSXML2.DOMDocument" ) catch Alert("Erro na criacao do objeto MSXML2.DOMDocument : " + Ole2TxtError()) return NIL end end try http := CreateObject( "MSXML2.XMLHTTP" ) catch try http := CreateObject( "MSXML2.XMLHTTP" ) catch Alert("Erro na criacao do objeto MSXML2.XMLHTTP : " + Ole2TxtError()) end end // // Criar o XML request // cXml := "" cXml += '<?xml version="1.0" encoding="utf-8"?>' + CR_LF cXml += '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">' + CR_LF cXml += ' <soapenv:Header/>' + CR_LF cXml += ' <soapenv:Body>' + CR_LF cXml += ' <tem:ValidarUsuario>' + CR_LF cXml += ' <tem:Email>seu_email_aqui</tem:Email>' + CR_LF // SEU EMAIL AQUI cXml += ' <tem:Senha>sua_senha_aqui</tem:Senha>' + CR_LF // SUA SENHA AQUI cXml += ' </tem:ValidarUsuario>' + CR_LF cXml += ' </soapenv:Body> ' + CR_LF cXml += '</soapenv:Envelope>' + CR_LF // // ENDERECO DE HOMOLOGACAO // http:Open( "POST", "http://homologacao.anvisa.gov.br/sngpc/webservice/sngpc.asmx?WSDL HTTP/1.1", .F. ) http:SetRequestHeader( "Content-Type" , "text/xml;charset=UTF-8" ) http:SetRequestHeader( "SOAPAction" , "http://tempuri.org/ValidarUsuario" ) http:SetRequestHeader( "Host" , "homologacao.anvisa.gov.br" ) // // ENDERECO DE PRODUCAO // // http:Open( "POST", "http://sngpc.anvisa.gov.br/webservice/sngpc.asmx?WSDL HTTP/1.1", .F. ) // http:SetRequestHeader( "Content-Type" , "text/xml;charset=UTF-8" ) // http:SetRequestHeader( "SOAPAction" , "http://tempuri.org/ConsultaDadosArquivoSNGPC" ) // http:SetRequestHeader( "Host" , "sngpc.anvisa.gov.br" ) Alert("Carrega o request...") doc:LoadXML( cXml ) // Carrega o request de string Alert("Envia o xml...") http:send( doc:xml ) // Envia o request Alert("Ler a resposta...") response := http:responseText // Recebe a resposta Alert("Apresentando a resposta") oXmlDoc := TXmlDocument():new() oXMlDoc:read( response ) oXmlNode := oXmlDoc:findFirst( "ValidarUsuarioResult" ) Alert(oXmlNode:cName + " = " + oXmlNode:cData ) RETURN NIL ********************* FUNCTION InternetOK() ********************* local aHosts, cName, cAddress := "www.google.com.br" InetInit() aHosts := InetGetHosts( cAddress ) if aHosts == NIL .or. len(aHosts) == 0 InetCleanup() return .F. endif InetCleanup() RETURN .T.  
×
×
  • Create New...