function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shanmuga Prasath PushpanathanShanmuga Prasath Pushpanathan 

How to add 'Authorization' as Key and 'Bearer '+'Access token' as value in the header section in Wsdl for Soap?

Getting this below error :
'System.CalloutException: Web service callout failed: Unable to find header type info fortokenRes'
Omar Rajab 94Omar Rajab 94
Hi Shanmuga,

if you create named credential with endpoint ans the credential data then you have no need to add the authorization header in the code. Named credential do it from itself.

here how you can create named credential in Salesforce:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_named_credentials.htm

regards,
Omar Rajab