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
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??
The error message indicates that the plugin is expecting a JSON response body, but did not find a valid one.
What more specifically is the structure of the response body?
SOMETHING LIKE THIS
Dictionary
success:true
result:HttpResponse
statusLine:"HTTP/1.1.200"
statusCode:200
headers:Dictionary
contentType:"text/plan;charset=ISO-8859-1"
ContentLenght:"1420552"
Date:SOMETHIG
Setcookie:"ASDJASLDJI28478JK"
contenttype:":"text/plan;charset=ISO-8859-1"
..
...
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