►Harbour 3.x | Minigui xx-x | HwGui◄ Pense nas possibilidades abstraia as dificuldades. Não corrigir nossas falhas é o mesmo que cometer novos erros. A imaginação é mais importante que o conhecimento. (Albert Einstein)
Tem que ir ajustando, aumentei nSend (SEND) para 30
O default do SetTimeouts é 120 segundos (2 min) para resposta do serviço
►Harbour 3.x | Minigui xx-x | HwGui◄ Pense nas possibilidades abstraia as dificuldades. Não corrigir nossas falhas é o mesmo que cometer novos erros. A imaginação é mais importante que o conhecimento. (Albert Einstein)
setTimeouts (long resolveTimeout, long connectTimeout, long sendTimeout, long receiveTimeout)
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2) "The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell" https://github.com/JoseQuintas/
And the point is that OP wants a 15-seconds timeout. Due to your code, operation may exceed 15 seconds. This is not an asynchronous request
...
you are right. I changed to SYNCHRONOUS, which is what the OP wants and changed the send/receive timeouts to 15 secs
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2) "The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell" https://github.com/JoseQuintas/
:Send( ::oXMLDoc:xml )
Do While :readyState != 4
hwg_DoEvents()
:WaitForResponse( 500 )
Enddo
►Harbour 3.x | Minigui xx-x | HwGui◄ Pense nas possibilidades abstraia as dificuldades. Não corrigir nossas falhas é o mesmo que cometer novos erros. A imaginação é mais importante que o conhecimento. (Albert Einstein)
Tem as duas funções: SetTimeOuts() e WaitForResponse().
Me parece que uma define apenas pra resposta, e a outra define geral.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2) "The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell" https://github.com/JoseQuintas/
//setTimeouts( long resolveTimeout, long connectTimeout, long sendTimeout, long receiveTimeout )
//oServer:SetTimeOuts( ::nSoapTimeOut, ::nSoapTimeOut, ::nSoapTimeOut, ::nSoapTimeOut )
oServer:Open( "POST", ::cSoapURL, .F. )
oServer:SetRequestHeader( "Content-Type", "application/soap+xml; charset=utf-8" )
oServer:Send( ::cXmlSoap )
oServer:WaitForResponse( ::nSoapTimeOut )
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2) "The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell" https://github.com/JoseQuintas/
Quando o serviço está fora o send() espera até 2 min. para responder o WaitForResponse ignora isso
►Harbour 3.x | Minigui xx-x | HwGui◄ Pense nas possibilidades abstraia as dificuldades. Não corrigir nossas falhas é o mesmo que cometer novos erros. A imaginação é mais importante que o conhecimento. (Albert Einstein)
Lembrando: timeout é o LIMITE de tempo.
Se der erro antes desse tempo... não tem mais o que esperar.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2) "The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell" https://github.com/JoseQuintas/
asimoes escreveu:Quando o serviço está fora o send() espera até 2 min. para responder o WaitForResponse ignora isso
Aí que está: WaitForResponse() é tempo pra esperar resposta, não para o send.
Acho que o SetTimeOuts() é mais abrangente.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2) "The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell" https://github.com/JoseQuintas/
SetTimeOuts define o tempo limite de resposta pata o Send se não for definido o default é 2 minutos, nunca vi o waitresponse funcionando
►Harbour 3.x | Minigui xx-x | HwGui◄ Pense nas possibilidades abstraia as dificuldades. Não corrigir nossas falhas é o mesmo que cometer novos erros. A imaginação é mais importante que o conhecimento. (Albert Einstein)
Talvez o SetTimeOuts() defina o tempo para a função da Microsoft.
E talvez o WaitForResponse() seja o tempo do APLICATIVO esperar.
Se for assim, as duas trabalham em conjunto, cada uma definindo uma coisa.
E aí sua rotina faz sentido, porque seria o tempo do aplicativo esperar.
O que acaba deixando na dúvida sobre o que acontece com a rotina Microsoft, se ela continuar esperando mesmo depois que o aplicativo não quer mais a resposta.
O problema vai ser como testar isso, já que depende de endereço falhando.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2) "The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell" https://github.com/JoseQuintas/
//setTimeouts( long resolveTimeout, long connectTimeout, long sendTimeout, long receiveTimeout )
oServer:SetTimeOuts( ::nSoapTimeOut, ::nSoapTimeOut, ::nSoapTimeOut, ::nSoapTimeOut )
oServer:Open( "POST", ::cSoapURL, .F. )
oServer:Send( ::cXmlSoap )
oServer:WaitForResponse( ::nSoapTimeOut )
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2) "The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell" https://github.com/JoseQuintas/
►Harbour 3.x | Minigui xx-x | HwGui◄ Pense nas possibilidades abstraia as dificuldades. Não corrigir nossas falhas é o mesmo que cometer novos erros. A imaginação é mais importante que o conhecimento. (Albert Einstein)