Hi,
I want to create a rest service that will can get a file from an http post file.
So i use postman chrome plugin in order to call my rest service and i send a file.
ex:http://localhost:5555/rest/Test/Service/file
But i don’t succeed in getting my file.
Which flow services must to be use to get the file either binary or form-data?.
do you have an exemple ?
best regards.
thanks for your help.
rmg
(rmg)
October 7, 2016, 9:19pm
2
I believe you can’t use regular http service to test the REST instead you can use pub.jason* service to receive the payload from the REST API invoke.
Is that the way you want the functionality rather than just http post a XML and receive the payload to the target service?
HTH,
RMG
1 Like
MR_as173d
(MR as173d)
October 8, 2016, 10:27am
3
Regina – You didn’t succeeded in achieving – Did you see any errors ? Can you please more specific ?
Thanks,
Hi,
i will try to explain what i want. it’s very simple.
i want to expose a rest service that can get a file from a http post.
So a customer could want to call ma rest service and send me a zip file a jpg, an xml file ,a text file or another.
so my rest service should be able to get the file sent and then copy it on a local folder.
But i don’t know how to do this. i dont’t find any service that can help me to achieve my goal.
can you help me ?
best regards,
Patrick.
MR_as173d
(MR as173d)
October 9, 2016, 3:08pm
5
Please go through below link which is helpful to you. Also please read documentation on REST for better understanding.
Thanks,
Hi,
i will try to explain what i want. it’s very simple.
i want to expose a rest service that can get a file from a http post.
So a customer could want to call ma rest service and send me a zip file a jpg, an xml file ,a text file or another.
so my rest service should be able to get the file sent and then copy it on a local folder.
But i don’t know how to do this. i dont’t find any service that can help me to achieve my goal.
can you help me ?
best regards,
Patrick.
One way of doing this is keep the fileName parameter in the rest post service which can accept the full file name. Then in the flow service you can use ftp services to get the file and store it in the local system.
Patrick,
You could ask the source system to send the file in base64 encoded format. Once you receive via REST call, you can make use of the public built in services under pub.file folder (stringToFile, bytesToFile etc.,) to place the file in specific folder in the same machine.
-Senthil
Krishna_PB
(Krishna PB)
October 14, 2016, 3:03pm
8
Frank_xu
(Frank xu)
October 17, 2016, 4:02am
9
try to use this url http://localhost:5555/rest/Test/Service/file?jsonFormat=stream . Use jsonStream object as the input of the service.
hi everyone,
thanks a lot.
i’m succeed in resolving my issue.
indeed i put a contentStream object in my input parameter.
then i used the pub.file:streamToFile service in order to write the file in my local repository.
Krishna_PB
(Krishna PB)
October 17, 2016, 11:30am
11
Good to know that you resolved the issue.
Krish