Linx Main Linx Help

RESTWebServices missing input parameters


#1

Hi,

I’m wondering to set up a RESTWebServices, in order to load up several parameters using a POST command and a multipart/form-data input message, composed by two strings and one file (PDF).

Since I don’t have any issue to import swagger WS description, I’m not able to catch the input parameters (guessing $.Input).

Thank you in advance for your support.

image

image

In attachment the WS swagger json definition.

swagger.json.txt (2.3 KB)


#2

Hi,

I’ve played with your definition. I don’t think Linx allows FormData yet. I will confirm for you. The rest works: Body, Query, Path.

Do you have control of the consuming service as well? You could use Body and accept a Base64 string as the file?


#3

Hi Dawie,

Yes, I have control of consuming services, so I can change the invoke method as well.
Is it possible to get several parameters (including a file) in Body, using POST method with Linx? If yes, could you please provide me an example? I’ve played with the other options but I didn’t succeed.

Thank you,
Ivan


#4

Hi,

Yes, I’ll write up a quick example. I’ll do both the consume and API in a single solution, just different processes.

Dawie


#5

Hi,

Here’s a quick example of how to do a Base64 upload Server and Client.

NB: The Service’s Base URI must not use the same port number as Linx (8022). In this example I’m using no port number (thus it defaults to 80)

Just set the Input parameters for the UploadAFile process. I’m writing the files to the c:\temp folder.

To show the way the process works I’m also writing the Source and Target Base64 strings to text files.

FileUploadExample.lsoz (8.9 KB)

Regards,
Dawie


#6

Hi Dawie,

Thank you! I’m gonna check your solution, I’ll provide you a feedback asap.

Regards,
Ivan

– Update
Yep, your solution works perfectly. Thank you!