cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve binary data document from webservice using Web APIs feature

ElsaSklavounou1
Level 2
Hello,

We are trying to send a document using a webservice , then retrieve the document modified and returned by the webservice in Blue Prism.

We are able to call the service successfully using Postman  with the Web APIs feature of Blue Prism version 6.6.
But we couldn't correctly retrieve the document.

The webservice returns the document in a" binary data". But Blue Prism catchs the Response Content and converts it in "Text" format.
So we couldn't save correctly the document.

I have tried to change the type of the Response Content into "Binary" or Use the Action "Utility - File Management - Write Binary Data"  .

But I have the following message error:

"Internal : Failed to translate data - No conversion available from Text to Binary"

Is ther a way to retrieve the Response Content directly in Binary data format  ?
Could you advice?


------------------------------
Elsa Sklavounou
Head of Partnerships
SYSTRAN SAS
Europe/Paris
------------------------------
7 REPLIES 7

PriteshJadhav
Level 3
I am facing the same issue. the response_content from sharepoint REST call is binary data (excel file) which BP returns as text cannot be written into a file. Did anyone find a solution to this?

------------------------------
Pritesh Jadhav
Senior Associate
PwC
America/New_York
------------------------------

​We too have this problem, and if we set the input "File URL" to True,

Then we get a error that we are not allowed to use empty Path.

If we put the Path in Body, the error is File Not Found.
Please help 🙂



------------------------------
Pia van Acker
Digitaliseringskonsulent
Gladsaxe Commune
Europe/Copenhagen
------------------------------

Hi, Elsa,

usually web services returns binary data encoded in Base64 therefore saving it as plain text would not help. I created a code stage for one of our customers (integration with IBM Content Manager) which returned mix of xml and binary data. If you are interested you can write me privately and we can sort it out.

Regards,


------------------------------
Zdeněk Kabátek
Head of Professional Services
NEOOPS
http://www.neoops.com/
Europe/Prague
------------------------------

Hi,

The current web api object is unable to accommodate files in the web response. When working with endpoints that return files please use a VBO with code stages.

------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------

PhilipTrovato
Level 4

CodeStage below works for us.

outBinary = System.Convert.FromBase64String(inString)

Then use "Utility - File Management > Write Binary Data" to save.


30007.png


------------------------------
Philip Trovato
------------------------------

@PhilipTrovato

I tired your solution. But I can see the  binary data is corrupted.

Did someone resolve this issue?
If so, Could you please share me the logic.


------------------------------
Sheela Parthasarathy
Assistant Consultant
TCS
Pacific/Apia
------------------------------

Hi Sheela,

Are you receiving a binary response in the API call? Have you tried out the Request File action in Utility - HTTP. On a separate note, the VBO now also has a action for HTTP multipart requests.

------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------