[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Export of debug_msg() and debug_write() possible?



Hi Scout,

Good question! What about to add a procedure that a client (e.g. WSDL2RPG) 
could call to register himself as a participant of the HTTP API logger?

In other words how about to also add a http_debugOpen() and 
http_debugClose() procedure?

Now HTTP API could delay closing the log output file until the last client 
closed the log. Actually HTTP API itself could be treated as a client of 
the debug log.

A simple array with a few elements (e.g. 16) could be used as a handle pool 
whereas the array index is the handle and the item value might be the name 
of the client application.

Here is some pseudo code:

    dim g_handleArray as String[16];


Pseudo code of http_debugOpen() procedure interface:

    Integer http_debugOpen([String clientApp);

Pseudo code of http_debugOpen():

    handle = findFreeHandle();
    if (handle = 0) then return -1;

    if (isParameterAvailable(clientApp)) then {
          allocateHandle(handle: clientApp)
    } else {
          allocateHandle(handle: '*N')
    }

    return handle;


Pseudo code of allocateHandle() procedure interface:

    void allocateHandle(Integer handle, String clientApp);

Pseudo code of allocateHandle():

    g_handleArray[handle] = clientApp;
    return;


Pseudo code of http_debugClose() procedure interface:

    void http_debugClose(Integer handle);

Pseudo code of http_debugClose():

    if (not isHandleAllocated(handle)) then
       throw Exception('Invalid handle');

    freeHandle(handle);

    if (noMoreAllocatedHandle()) then closeDebugLog();

    handle = null;

    return;

Regards,

Thomas



Am 28.05.2010 19:41, schrieb Scott Klement:
> Hi Thomas,
>
> I will go ahead and export them (under new names that start with http_),
> however, I do have one question:
>
> How do we handle the timing of the debug_close()?   HTTPAPI will
> automatically close the file when it's done, what happens if WSDL2RPG
> wants to write to it after that?
>
>
> On 5/28/2010 5:38 AM, thomas.raddatz@xxxxxx wrote:
>>
>>      Hi Scott,
>>      What do you think about to export debug_msg() and perhaps
>>      debug_write()?
>>      Today the WSDL2RPG runtime service program opens the HTTP API debug
>>      file in order to add WSDL2RPG replated debug information to the HTTP
>>      API debug log. I add WSDL2RPG debug information to your log file
>>      because I think that it is a good idea to keep the HTTP and the
>>      WSDL2RPG debug information close together when calling a web service.
>>      The problem is that I cannot ensure for 100% that both applications
>>      use the same output file. Also it may happen that WSDL2RPG tries to
>>      write to the log before the file was been created by HTTP API. So for
>>      me it was quite easier if I could directly call your debug log
>>      procedures.
>>      Regards,
>>      Thomas.
>>
>>      --
>>      IMPORTANT NOTICE:
>>      This email is confidential, may be legally privileged, and is for the
>>      intended recipient only. Access, disclosure, copying, distribution, or
>>      reliance on any of it by anyone else is prohibited and may be a
>>      criminal
>>      offence. Please delete if obtained in error and email confirmation to
>>      the sender.
>>
>>
>>
>>
>> -----------------------------------------------------------------------
>> This is the FTPAPI mailing list.  To unsubscribe, please go to:
>> http://www.scottklement.com/mailman/listinfo/ftpapi
>> -----------------------------------------------------------------------
>
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------