Working with base64Binary value returned from web service - Forum - OpenEdge Development - Progress Community

Working with base64Binary value returned from web service

 Forum

Working with base64Binary value returned from web service

  • Hello Everyone,


    I am trying to make use of the base64string data that was returned from a web service (RenderResponse).  The return response definition from it's wsdl is below:


    <s:element name="RenderResponse">
    <s:complexType>
    <s:sequence>
    <s:element name="Result" type="s:base64Binary" maxOccurs="1" minOccurs="0"/>
    <s:element name="Extension" type="s:string" maxOccurs="1" minOccurs="0"/>
    <s:element name="MimeType" type="s:string" maxOccurs="1" minOccurs="0"/>
    <s:element name="Encoding" type="s:string" maxOccurs="1" minOccurs="0"/>
    <s:element name="Warnings" type="tns:ArrayOfWarning" maxOccurs="1" minOccurs="0"/>   
    <s:element name="StreamIds" type="tns:ArrayOfString" maxOccurs="1" minOccurs="0"/>
    </s:sequence>
    </s:complexType>
    </s:element>


    I am interested in getting the "Result" base64Binary value converted into a character string that I can display.


    Currently I have the value returned from the web service call saved in a MEMPTR  variable.


    Does anyone know how I convert the base64Binary data to a character string?


    Thank you,


    Terry

  • Hi Terry,

    You can use COPY-LOB and BASE64-DECODE for this purpose.

    COPY-LOB can be used to copy the value from a MEMPTR to a LONGCHAR.

    Then you can use BASE64-DECODE to decode the string to whatever the original value was.

    If you can get the web service return value to be stored in a LONGCHAR instead of in a MEMPTR, you can use BASE64-DECODE immediately.

    I hope this answers your question.

    Best regards,

    Wouter

    Wouter Dupré

    Sr. Systems Engineer

    Progress Software