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
17 replies
Subscribers
7 subscribers
Views
10266 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Integrations
Hello, We want to use an external document management system via dedi
fabienb
A Score Level 1
over 9 years ago
Hello,
We want to use an external document management system via dedicated REST web services. One of them is a multipart/form-data REST POST to create a new document. We encoded appian document content in base64 but the server does not seem to support base64 encoding.
Is there any alternative solution?
Thank you for help. Cheers.
OriginalPostID-161721
OriginalPostID-161721
Discussion posts and replies are publicly visible
0
Stefan Helzle
A Score Level 3
over 9 years ago
AFAIK base64 is the standard used in transferring files over HTTP. But I think this DMS should have some documentation telling you how to encode files.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
fabienb
A Score Level 1
over 9 years ago
The specification is light and I have attached an extract of it. For now, I use the following body but nothing is decoded:
--AaB03xContent-Disposition: form-data; name="content";
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
QnVzaW5lcw==
--AaB03x-
Anything wrong?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 9 years ago
The docs talk about MTOM and XOP. I checked wikipedia for that. It will be a bit more complex.
en.wikipedia.org/.../Message_Transmission_Optimization_Mechanism
de.wikipedia.org/.../XML-binary_Optimized_Packaging
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
fabienb
A Score Level 1
over 9 years ago
There are 2 versions of the web service: the first one is SOAP, the other one is REST. The SOAP uses MTOM which is not supported by Appian. The other option should be a standard REST web service from what I understand.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 9 years ago
OK, I understand. The other parameters are also sent in the same format?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
fabienb
A Score Level 1
over 9 years ago
Yes. Here is an example. Everything works fine but the content is not decoded:
--AaB03xContent-Disposition: form-data; name="parentId"
0b02c1818249f69f
--AaB03xContent-Disposition: form-data; name="objectName"
Test.txt
--AaB03xContent-Disposition: form-data; na...
Monday, 6:10 AM Unstarred Open Message Comment
Profile photo for Fabien Bouquignaud
Fabien Bouquignaud ...me="title"
Test
--AaB03xContent-Disposition: form-data; name="subject"
--AaB03xContent-Disposition: form-data; name="authors"
ghost
--AaB03xContent-Disposition: form-data; name="keywords"
test
--AaB03xContent-Disposition: form-data; name="isFullTextIndex"
1
--AaB03xContent-Disposition: form-data; name="docDate"
08/04/2015
--AaB03xContent-Disposition: form-data; name="content";
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
QnVzaW5lcw==
--AaB03x--
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
fabienb
A Score Level 1
over 9 years ago
Sorry, there was an error in my previous message:
--AaB03xContent-Disposition: form-data; name="parentId"
0b02c1818249f69f
--AaB03xContent-Disposition: form-data; name="objectName"
Test.txt
--AaB03xContent-Disposition: form-data; name="title"
Test
--AaB03xContent-Disposition: form-data; name="subject"
--AaB03xContent-Disposition: form-data; name="authors"
ghost
--AaB03xContent-Disposition: form-data; name="keywords"
test
--AaB03xContent-Disposition: form-data; name="isFullTextIndex"
1
--AaB03xContent-Disposition: form-data; name="docDate"
08/04/2015
--AaB03xContent-Disposition: form-data; name="content";
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
QnVzaW5lcw==
--AaB03x--
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 9 years ago
Did you try to put the boundary (--AaB03x) and the Content-Disposition in separate lines? You also need to define the used boundary in the HTTP header. Setting the content-length could also be important. Maybe you first try it outside of Appian using cURL.
stackoverflow.com/.../example-of-multipart-form-data
www.redmine.org/.../Rest_api_with_curl
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
fabienb
A Score Level 1
over 9 years ago
Boundary and Content-Disposition are actually in separated lines. I have attached the rule that creates the body to be more precise. Boundary and content type are also defined in the header too. I will have a look at other header parameter, maybe the encoding one and the content-length as you proposed. Unfortunately I can't use cURL as the web service is only available in a VPN between the DMS and Appian cloud.
RESTBody.txt
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 9 years ago
Looks all good for me. Sorry ... I am out of questions ... Check returned error messages, try to find an example, ask DMS supplier
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>