PROCEDURE IS
procedure CallWebService(xmlRequest: Text): Text
var
httpClient: HttpClient;
httpResponse: HttpResponseMessage;
responseContent: Text;
begin
// Initialize HttpClient
httpClient := HttpClient;
// Send the POST request using the xmlRequest directly as content
if httpClient.Post('https://www.fatoortak.sa/EInvoiceWebService.asmx', xmlRequest, 'application/soap+xml; charset=utf-8', httpResponse) then begin
// Check if the response is successful
if httpResponse.IsSuccessStatusCode then
httpResponse.Content.ReadAs(responseContent) // Read the content directly
else
responseContent := 'Error: ' + Format(httpResponse.IsSuccessStatusCode) + ' - ' + httpResponse.ReasonPhrase;
end else
responseContent := 'Error sending request.';
exit(responseContent);
end;
AND ERROR IS No overload for method 'Post' takes 4 arguments. Candidates: built-in method 'Post(Text, HttpContent, var HttpResponseMessage)'ALAL0126
procedure Post(Path: Text, Content: HttpContent, var Response: HttpResponseMessage): Boolean
Sends a POST request to the specified URI as an asynchronous operation.
View Problem (Alt+F8)
No quick fixes available