I WORK ON E-INVOICING OF ZATCA ON BUSSINESS CENTAL BUT GET ERROR GENERATING XML IN THIS PROCEDURE

LAIBA AKHTER 0 Reputation points
2024-09-22T08:09:13.74+00:00

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

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,120 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Kiran P 3,940 Reputation points Microsoft Vendor
    2024-09-23T04:01:04.76+00:00

    Hi LAIBA AKHTER,

    Thank you for reaching out to us on the Microsoft Q&A forum.

    This topic is currently not supported in the Q&A forums.

    I recommend initiating a new discussion through the https://community.dynamics.com/

    Moderators are readily available there to assist you and provide guidance.

    Please don't forget to Accept helpful answer and close this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.