Hello all,
during a chat on the Clarion-channel I asked, how many records the ServiceErrorQueue may contain, which is returned from the SOAPserver to the SOAPclient.
Bruce responded, that there is the possibility of more than just one record.
This is how I catch the errors in the .Pagereceived method:
IF INSTRING('ServiceErrors', SELF.Page, 1,1)
! GLOCS:ServiceErrorQueue is a GLObal Variable on the client side, identical with the Nettalk-ErrorQueue
FREE(GLOCS:ServiceErrorQueue)
xml.Load(GLOCS:ServiceErrorQueue, SELF.Page, SELF.PageLen,'ServiceErrors','Error')
!
stERROR.FREE()
stERROR.Append(' # # # # # # # # # # # GLOCS:ServiceErrorQueue: # # # # # # # # # # #' & CRLF)
p# = 0
LOOP RECORDS(GLOCS:ServiceErrorQueue) TIMES
p# += 1
GET(GLOCS:ServiceErrorQueue, p#)
stERROR.Append(p# & ': ServiceErrorQueue:ErrorPosition ' & ServiceErrorQueue:ErrorPosition & CRLF)
stERROR.Append(ServiceErrorQueue:ErrorNumber & ' : ' & ServiceErrorQueue:ErrorDescription & CRLF)
stERROR.Append((ServiceErrorQueue:ErrorRecomendation & CRLF)
END
stERROR.Append((' # # # # # # # # # # # /GLOCS:ServiceErrorQueue: # # # # # # # # # # #' & CRLF)
stERROR.SaveFile(_insert_name_for_errorlog_here_)
! This was written into the log-file,
! now we need to inform the user about this calamity.
! We may use a Messagebox to display the very first error:
GET(GLOCS:ServiceErrorQueue, 1)
MESSAGE('We are sorry to say, but one or even more errors have occured, like: ' & RECORDS(GLOCS:ServiceErrorQueue) & '||Description: ' & |
CLIP(ServiceErrorQueue:ErrorDescription) & '||The errors have been written to , 'Attention', ICON:Hand)
ELSE
! here goes the source for processing the successful received data
....
END
However, I still have one question: How can I trigger an error reliably, to test that my error-reporting actually works?
Nothing is worse than an illusion, except in las Vegas.
Thanks,
Wolfgang