REST services are 'just' webpages.
So you need to write a USP which can process the input/url called to parse them and perform the required actions/return the required data.
Here are the top and bottom of our basic API usp
operation exec
PUBLIC WEB
variables
string v_url ,v_params, v_id, v_data
struct v_output
endvariables
v_params = $webinfo("input")
v_url = $webinfo("pathinput")
structtojson v_data, v_output
putitem/id $webinfo("HTTPRESPONSEHEADERS"),"Content-Type","application/json; charset=utf-8"
$webinfo("output") = v_data
return(0)
The code in the middle parses v_url for the entity/function required and v_params for the data.
The response is then built in a struct (v_struct) and transposed to JSON for output by the end of the proc.
Hope this helps,
Iain
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
Original Message:
Sent: 09-03-2024 09:12
From: Marcelo Martins
Subject: Call-in for Uniface Service using REST API instead WebService
Dear all,
I´m looking for some documentation about how to publish a Uniface Service operation (call-in) thru REST API instead regular WebServices.
Any ideal will be welcome.
Best regards,
Marcelo Martins
------------------------------
Marcelo Martins
Uniface Consultant
Vertti Tecnologia Da Informa
Maringa PR BR
------------------------------