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

RE: Help consuming a REST webservice with HTTPAPI.



   Thanks Mike. I believe I have the Username:Password converted to Base64
   no problem.
   I don't understand what you mean when you say "The additional header
   support does not play well with more than one procedure. You should
   combine any additional headers into one procedure?"
   Sorry - I'm lost - I don't really know what the "additional header
   support" is...do you mean in HTTPAPI?
   ___________________________________________________________
   Paul Reid
   Application Developer III
   Erb Group of Companies | 290 Hamilton Road | New Hamburg, Ontario | N3A
   1A2
   Phone: 519.662.6133 ext. 2363
   Web: [1]http://www.erbgroup.com/
   From:        Mike Krebs <mkrebs@xxxxxxxxxxxxxxxxxx>
   To:        HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
   Date:        24/06/2014 12:41 PM
   Subject:        RE: Help consuming a REST webservice with HTTPAPI.
   Sent by:        ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
     __________________________________________________________________

   > You would just have two procedures for the two different additional
   headers you need.
   The additional header support does not play well with more than one
   procedure. You should combine any additional headers in one procedure.
   I think the base64 part of your question also needs to be fleshed
   out...Thinking out loud since I have not done this in practice. Make
   string, convert to ASCII, Base64 encode, convert back to EBCDIC, pass
   to the header (which will reconvert to ascii and send to your service
   which will decode the base64 string into ASCII).
   Pseudo code:
      String = user + ':' + password;
      StringASCII = iconv(String);
      StringBase64 = Base64EncodingRoutine(StringASCII);
      StringBase64EBCDIC = iconv(String);
      HeaderData = 'Authorization: Basic ' + StringBase64EBCDIC + CRLF +
                   'Account: ' + accountID + CRLF;
   I see that Scott wrote an article about how to do Base64 using
   "built-in" functions for IBMi.
   You might want to take a look. It looks like there is support for a
   "one-step" conversion.
   [2]http://iprodeveloper.com/application-development/base64-built-ibm-i
   There are BASE64 routines in the "private" area of HTTPAPI. Previously,
   Scott cautioned against using them.
   Scott wrote Base64 routines you can you use
   [3]http://www.scottklement.com/base64/
   -----------------------------------------------------------------------
   This is the FTPAPI mailing list.  To unsubscribe, please go to:
   [4]http://www.scottklement.com/mailman/listinfo/ftpapi
   -----------------------------------------------------------------------

References

   1. http://www.erbgroup.com/
   2. http://iprodeveloper.com/application-development/base64-built-ibm-i
   3. http://www.scottklement.com/base64/
   4. 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
-----------------------------------------------------------------------