Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
13 replies
Subscribers
7 subscribers
Views
5807 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
We are looking to request/receive a PDF document via a webservice call, how do w
adamm
over 11 years ago
We are looking to request/receive a PDF document via a webservice call, how do we go about presenting the received document? Ideally we would like to present it inline in a UIT, but only see the option of including images (gif and jpeg), does it have to be linked to a stored document somehow?
I am also unsure how to convert the data from the webservice to a PDF to be displayed or linked to, are is there an existing example application or other resource to work from as a baseline?
Thanks!...
OriginalPostID-101607
OriginalPostID-101607
Discussion posts and replies are publicly visible
0
Eduardo Fuentes
Appian Employee
over 11 years ago
Have you looked a the Base64 Utilities plug-in? it has a smart service that will take a base64 string and convert it to a document in Appian which you can later display in a form.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Rully
over 11 years ago
As Eduardo pointed out above, you can build your web service to pass back base64 data (string) to Appian. Then use the smart service "Appian Document from Base64 String" which is available under Document Generation category after you install the Base64 plug-in.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sponnada
over 11 years ago
Just checking, after using the above smart service, will the UIT having inline document work fine in Tempo?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 11 years ago
Maybe you could build a plugin that converts the PDF to PNGs and show them in the UIT.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
adamm
over 11 years ago
thanks for the response! I am in the process of tossing together a prof of concept process. I will update later and may include a version of the flow if it is worth sharing.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
adamm
over 11 years ago
Ok, I've built a process and been fiddling with it, but I have not yet gotten it to work.
I have the string from the webservice isolated in a text PV, and am then running the decode function on it:
base64decode(pv!isolatedBase64_text)
When I write that value to a text variable, the header information looks good, so I do think the decode is occurring correctly. However if I pass the result to a Document variable, I get a -1. I have got to be missing something, any clues?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 11 years ago
There should be a smart service that takes the base64 encoded string an creates a new document.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 11 years ago
If you installed this plug-in
forum.appian.com/.../summary
then there's a smart service called "Appian Document from Base 64 Smart Service" (see attachment)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
adamm
over 11 years ago
I am still not getting a document out of it, I am attaching a screen shot of my model.
Some datapoints:
the string in the response body comes out to about 44,000 characters, but when base64decode() is run against it the resulting string is just over 700 chars (seems short to me.) bring this up because the logs show a couple of errors:
first (the reson I think there is an issue with the input to [Appian Document from Base 64 string] is being truncated somewhere):
2014-03-11 13:02:48,627 [default-threads - 15] ERROR com.appiancorp.process.runtime.activities.custom.Base64StringToDocumentActivity - java.lang.ArrayIndexOutOfBoundsException: 65533
java.lang.ArrayIndexOutOfBoundsException: 65533
at org.castor.util.Base64Decoder.translate(Base64Decoder.java:167)
...
then (I interpet this as just "it failed to create the document" likely due oto the prior error:
2014-03-11 13:02:48,635 [default-threads - 15] ERROR com.appiancorp.process.engine.UnattendedJavaActivityRequest - An error occurred while executing activity: id=3592, classname=com.appiancorp.process.runtime.activities.custom.Base64StringToDocumentActivity
com.appiancorp.suiteapi.process.framework.ActivityExecutionException: The document could not be created. Error: 65533
at com.appiancorp.process.runtime.activities.custom.Base64StringToDocumentActivity.execute(Base64StringToDocumentActivity.java:45)
...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 11 years ago
You have to put the base64 encoded string into the smart service. The base64decode function is of no use in this case.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>