we are integrating Salesforce and SAP systems. For that we are making a callout to SAP with username and password in the header. When i checked the debug log the callout_request entry contains an xml request. But i did not find the header information which is the username and password in that request XML. Where can i find it? How could i ensure that i am sending the headers correctly? Experts please suggest. Thanks
sap1.inputHttpHeaders_x = new Map<String, String>();
//Setting a basic authentication header
String username = 'SFDCUSER';
String password = 'xxxxxxc1';
Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +EncodingUtil.base64Encode(headerValue);
sap1.inputHttpHeaders_x.put('Authorization',authorizationHeader);
Best Answer
The DEBUG logging will have two CALLOUT_REQUEST entries.
The first will have the SOAP formatted POST body. I.e. the
<env:Envelope ...>
The second will have the same details, but JSON formatted. This will also end with the Request headers.
The interesting part here is the trailing: