Microsoft Dynamics 365 Business Central Developer — Question 84
You plan to call a web service by using the data type HttpClient from a Business Central AL extension.
You must provide the following implementation for the web service call:
• The web service must authenticate the client with a certificate.
• The certificate must include a password.
• The password must be hidden when you debug the code.
You need to include the certificate in the web service call.
Which instruction should you use?
Answer options
- A. HttpClient.AddCertificate(Certificate: SecretText, Password: SecretText);
- B. HttpClient.AddCertificate(Certificate: Blob, Password: SecretText);
- C. HttpClient.AddCertificate(Password: SecretText);
- D. HttpClient.AddCertificate(Certificate: Text, Password: Text);
Correct answer: A
Explanation
The correct answer is A, as it specifies both the certificate and password as SecretText, ensuring the password remains hidden during debugging. Option B is incorrect because it uses Blob instead of SecretText for the certificate, which doesn't meet the requirement for secure handling. Option C lacks the certificate parameter entirely, and option D does not use SecretText, leaving the password exposed.