Hi all,
I have a REST WS with method post that returns a base64, but I don't know how to call it and save the result as a appian document
I tried to save the value in the database but the result can be around 14,000,000 (a pdf document with 21 pages) and the text datatype can save only 60,000
Any suggest???
Discussion posts and replies are publicly visible
As of 19.2, Appian has this out of the box with the Integration Object and the limit for a response with documents is 75mb.
https://docs.appian.com/suite/help/19.2/Appian_Release_Notes.html#receive-binary-with-integrations-and-receive-base64-inline-with-json
https://docs.appian.com/suite/help/19.2/Integration_Object.html
Before this, I have used the Base64 Request to REST Web Service plugin to turn base64 in a WS response directly into an Appian document. I don't know if there are any limits on this one.
https://community.appian.com/b/appmarket/posts/base64-request-to-rest-web-service
Thanks Steven,
I'm trying with Base64 Request to Rest Web Service plugin with the smart service "http json multidocument WS"
I have:
endpoint like "https://transversal..../consultar/base64"
method:post
request body: "{ ""value"": ""1""}"
but when I execute the process i got an error
errorocurred=true
errorlog= "the response did not include valid JSON Local Appian Error: null"
when I execute the Ws it returns something like this
contentType: "text/plain:charset=ISO-8859-1"
body: "jkasjkdjkajksdhkjahdsajkshdjaksdhajkshdaskjhdakjh"
Any help??
I'm most interested in the "body". Is "jkasjkdjkajksdhkjahdsajkshdjaksdhajkshdaskjhdakjh" meant to represent the fact that the body just contains the base64 string? Is that the only thing in the response body? No labels? Other fields?
It's correct in the body is the only thing, the base64 string
That's rather strange. JSON is generally name/value pairs:
https://www.w3schools.com/js/js_json_syntax.asp
Since yours is not, I would not be surprised if the plugin is not designed to work for this edge case, which is what the error message is indicating.
Can the service be changed to have a name/value pair as the response body?
I think the same, I made a request to the programmer maybe on thursday could be done the change, until that I suppose I have to wait.
Correct. And if the body for example becomes:
{"document":"jkasjkdjkajksdhkjahdsajkshdjaksdhajkshdaskjhdakjh"}
then the node input called "Document JSON Path" becomes "document"
ok, thanks
I'll tell you how everything goes.
Thanks!!!!!!
My team did the change today
This is the response
Dictionary success: true result: HttpResponse statusLine: "HTTP/1.1 200 " statusCode: 200 headers: Dictionary Content-Type: "application/json;charset=UTF-8" Transfer-Encoding: "chunked" Date: "Tue, 25 Jun 2019 23:18:20 GMT" Set-Cookie: "2fda0f841098fcd74d7c1f0e5a1e16ce=cddacee4b606584a58d5a087c2d642e9; path=/; HttpOnly; Secure" contentType: "application/json;charset=UTF-8" body: "{"respuesta":"A001","codigoBase64":"JVBERi0xLjUNCiW1tbW1DQoxI........
and i configured this entries
Endpoint:
="">transversalservice-aperturabei-destdoc-dev.appls.cto1.paas.gsnetcloud.corp/.../base64"
Method:
=POST
Request Body:
="{ ""canal"":""CANAL DIGITAL"", ""appOrigen"":""APERTURA DE CUENTAS"", ""nivel"":""PMN1"", ""tipoDocumento"":"""", ""tipoConsulta"":""B64"", ""tipoOper"":""A"", ""parametros"":[ { ""filenet"":""morales"", ""idDocumento"":""A089E56A-0000-CD17-970C-4FE9ED4F6C85"" } ]}"
Document Json Path:
="codigoBase64"
File Name:
="archivo.txt"
Folder:
"TMP_From_WS"
But I have an error, but I don't know which is
the errorocurred=true
the errrorlog=Changed to Local Appian Error: null Local Appian Error: null
Any help???
Thanks
Well the content type changed from "text/plan;charset=ISO-8859-1" to "application/json;charset=UTF-8" which is a step forward. Did you check the logs for a stacktrace on the error?
Hi, I set the content type in headers but I'm having the same error, I can´t see the logs but I tried downloading the base64 in a file with the http download component and then using Base64 json Doc to binary and I have an error "java.lang.nullpointerexception" (in logs).
I think that my base64 string it's ok, and I tried with more strings , empty file, and nothing works.
I am not sure what you mean by "http download component and then using Base64 json Doc to binary", but I am still referring to the Base64 Request to Rest Web Service plugin. You saw that errrorlog=Changed to Local Appian Error: null Local Appian Error: null. The next troubleshooting step is to look at the application server log. You will not be able to troubleshoot without it.