Salesforce
PDII · Question #101
A developer has generated Apex code from a WSDL for an external web service. The web service requires Basic authentication. What code should the developer use to authenticate?
The correct answer is B. stub.inputHttpHeaders_x.put('Authorization' , 'Basic QthZGprjpchVulHNchFtZQ'). See the full explanation below for the reasoning.
Question
A developer has generated Apex code from a WSDL for an external web service. The web service requires Basic authentication. What code should the developer use to authenticate?
Options
- AHttp.setHeader ('Authorization' , 'Basic QthZGprjpchVulHNchFtZQ')
- Bstub.inputHttpHeaders_x.put('Authorization' , 'Basic QthZGprjpchVulHNchFtZQ')
- CHttp.setAuthentication('Basic QthZGprjpchVulHNchFtZQ')
- Dstub.authentication.put ('Authorization','Basic QthZGprjpchVulHNchFtZQ')
How the community answered
(19 responses)- A11% (2)
- B68% (13)
- C16% (3)
- D5% (1)
Community Discussion
No community discussion yet for this question.