NetTalk Central

Author Topic: ServiceErrorQueue - number of possible number of errors returned.  (Read 4905 times)

Wolfgang Orth

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
    • oData Wolfgang Orth
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

« Last Edit: February 03, 2017, 10:16:01 AM by Wolfgang Orth »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: ServiceErrorQueue - number of possible number of errors returned.
« Reply #1 on: February 05, 2017, 10:01:20 PM »
>> However, I still have one question: How can I trigger an error reliably, to test that my error-reporting actually works?

On the server side;
http://www.capesoft.com/docs/NetTalk9/NetTalkWebServices.htm#Errors

Cheers
Bruce

Wolfgang Orth

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
    • oData Wolfgang Orth
Re: ServiceErrorQueue - number of possible number of errors returned.
« Reply #2 on: February 06, 2017, 12:05:55 AM »
Hello Bruce,

p_web.AddServiceError sounds good!

The Prototype has changed meanwhile, compared to the manual, but once adjusted, it adds records to the retuned Servicequeue.

In NetWeb.CLW I found
NetWebServerWorkerBase.AddServiceError   Procedure(Long p_Number,String p_Pos, String p_RecordId, String p_Desc, String p_Rec)

I added some bogus records, with made-up p_Numbers from 1 to 5 and 99, also some strings.

However, all records I got back had the errornume 0 (zero) and empty strings. Did this happen, because I made up the wrong numbers?

Where do I have to look for the list of errors? I found some errors in NetAll.CLW, but nothing with Serviceerror.

TIA
Wolfgang

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: ServiceErrorQueue - number of possible number of errors returned.
« Reply #3 on: February 07, 2017, 12:13:05 AM »
Hi Wolfgang,

>> The Prototype has changed meanwhile, compared to the manual, but once adjusted, it adds records to the retuned Servicequeue.

Thanks, I've updated the docs.

>> However, all records I got back had the errornume 0 (zero) and empty strings. Did this happen, because I made up the wrong numbers?

no, you can write whatever you like into the Error Queue. It's there for your convenience.
Did the raw packet arriving at the client contain all blanks? or did your parsing of the incoming error queue turn it into blanks?

cheers
Bruce

Wolfgang Orth

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
    • oData Wolfgang Orth
Re: ServiceErrorQueue - number of possible number of errors returned.
« Reply #4 on: February 07, 2017, 12:34:39 PM »
> Did the raw packet arriving at the client contain all blanks?

Oh my goofness!

In all .PageReceived-Embeds I have a dbgView(SELF.Page) except in this one!

The reason was simple, as so often. For what reason ever, but all External Names were embraced with a single-quote, so xml.Load() failed.

Thanks again for pointing to the obvious!