webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Decode Base64 String

    Posted Thu April 21, 2016 08:00 AM

    Hi

    The client is sending Base64Encoded string to webMethods, which needs to be decoded to Base64 string what is the way to do so?

    I am using pub.string.base64Decode and pub.string:byteToString to get the Base64 string. Seems its not decoding properly, any help please.

    I wanted to replicate the functionality available in URL: https://www.base64decode.org/


    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Decode Base64 String

    Posted Thu April 21, 2016 10:32 AM

    Whatever you are doing is right. It is pub.string.base64Decode followed by pub.string:byteToString. Is that encoded base64 being decoded properly on https://www.base64decode.org/?


    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Decode Base64 String

    Posted Thu April 21, 2016 10:42 AM

    Please provide the example or string you have taken for decoding/encoding. Procedure you are trying is 100% correct.
    May be you can pass the encoding type while encoding and decoding the string.


    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: Decode Base64 String

    Posted Thu April 21, 2016 11:06 AM

    Hi,

    another option to check is PSUtilities-Package, which also contains a base64decode service.

    This package can be downloaed from the download section of the SAG community.

    Advantage over build in service is that you can test it in IS Admin UI or Designer directly instead of creating a wrapper to map the string to the object input.

    Regards,
    Holger


    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: Decode Base64 String

    Posted Mon April 25, 2016 06:53 AM

    Thank you for your quick response. There was some issue in the encoding from client side, which they corrected.
    Is there a way to find the image size from the Base64 string?
    Please help.


    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: Decode Base64 String

    Posted Mon April 25, 2016 07:55 AM

    Hi Sasanka,

    might be a rough estimate:

    The decoded size and the encoded size should have a factor of approx 1.2.

    decoded size multiplied with 1.2 equals encoded size

    Depends on data type (image, archive, pdf, …).

    Regards,
    Holger


    #Integration-Server-and-ESB
    #webMethods


  • 7.  RE: Decode Base64 String

    Posted Tue September 19, 2017 12:13 PM

    I have developed similar to this one using Javascript. Here is the link to test:


    #webMethods
    #Integration-Server-and-ESB