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

Re: Suggestion - Procedure to Retrieve Version Number



Scott,

Honestly I do not want to search the library list for member HTTPAPI_H of file QRPGLESRC. Since WSDL2RPG needs to bind to the HTTP API service program I would rather ask the service program itself for its version number.

The return value of http_getVersion() could be a simple string which must be produced following some rules:

a) numbers are always formated 3 digits long
b) major and minor version numbers are separated by a dot
c) minor version number and beta build number are separated by a hyphen
d) for the final release the beta build number is set to '999'

Here are same sample values based on this rules in ascending order:

    '001.024-001'       (first beta of v1.24)
    '001.024-002'       (second beta of v1.24)
      ...
    '001.024-010'       (tenth beta of v1.24)
      ...
    '001.024-999'       (final release of v1.24)
      ...
    '001.025-001'       (first beta of v1.25)
      ...
    '001.025-999'       (final release of v1.25)

Now please assume that WSDL2RPG required at least HTTP API v1.24beta10 and that HTTP API 1.24 would have been already released (I know that it is not yet released).

The installer now:

a) dynamically binds to service program HTTPAPIR4.
b) tries to resolve procedure http_getVersion().
c) If http_getVersion() cannot be resolved the
    installer knows that it bound to an older version
    of HTTP API.
d) In case http_getVersion() is available the installer
    could call the procedure and compares its return value
    ('001.024-999') with an internal string specifying the
    minimal required version number ('001.024-010').
e) If the return value of http_getVersion() if greater than
    the internal version number string the installer knows
    that it found a valid HTTP API. Otherwise it could show
    an error message or perhaps change the compile rules for
    one or more WSDL2RPG objects.

Attached you find a sample program that converts the content of HTTPAPI_VERSION and converts it following the rules above.

Please have a look at "my" http_getVersion() and feel free to add it to HTTP API if you like it.

Regards,

Thomas.


Am 15.08.2010 18:19, schrieb Scott Klement:
Can't you check the HTTPAPI_VERSION constant from HTTPAPI_H?  I'm
wondering what the value of a procedure would be...?

thomas.raddatz@xxxxxx wrote:
    Hi Scott,
    Starting with the release of WSDL2RPG v1.12 I received several e-mails
    from users reporting a compile problem because of the missing
    procedures http_dclose() and http_dmsg(). For some reasons nobody
    noticed "install_instructions_v1.12.txt" that points out the need for
    HTTP API v1.24beta10 or higher and that also describes how to use an
    older version of HTTP API.
    The idea I have is to add a procedure to HTTP API to retrieve the
    version number of HTTP API. Then I and other developers could retrieve
    the version number and act appropriately, e.g. display a message or
    set a compiler condition.
    Sample:
       version = http_getVersion()
    The return value (version) might be a data structure containing the
    following sub fields:
       major_version
       minor_version
       beta_number
    What do you think about it?
    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
-----------------------------------------------------------------------


Attachment: http_getVersion_demo.zip
Description: Zip archive

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------