I have below code to get session id of another org and to connect it. Problem I am facing is not able to see session id .
HttpRequest request = new HttpRequest();
request.setEndpoint('https://' + LOGIN_DOMAIN + '.salesforce.com/services/Soap/u/22.0');
request.setMethod('POST');
request.setHeader('Content-Type', 'text/xml;charset=UTF-8');
request.setHeader('SOAPAction', '""');
request.setBody('<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><login xmlns="urn:partner.soap.sforce.com"><username>' + USERNAME + '</username><password>' + PASSWORD + '</password></login></Body></Envelope>');
Dom.XmlNode resultElmt = (new Http()).send(request).getBodyDocument().getRootElement()
.getChildElement('Body','http://schemas.xmlsoap.org/soap/envelope/')
.getChildElement('loginResponse','urn:partner.soap.sforce.com')
.getChildElement('result','urn:partner.soap.sforce.com');
//----------------------------------------------------------------------
// Grab session id and server url (ie the session)
//----------------------------------------------------------------------
final String SERVER_URL = resultElmt.getChildElement('serverUrl','urn:partner.soap.sforce.com').getText().split('/services')[0];
System.debug('SERVER_URL ->'+ SERVER_URL);
final String SESSION_ID = resultElmt.getChildElement('sessionId','urn:partner.soap.sforce.com').getText();
//----------------------------------------------------------------------
// Load first 10 accounts via REST API
//----------------------------------------------------------------------
final PageReference theUrl = new PageReference('https://xxx/services/apexrest/restCreateTaskForTrainings');
theUrl.getParameters().put('vEmail','[email protected]');
theUrl.getParameters().put('vSubject','Test Task Creation');
theUrl.getParameters().put('vDate','01/01/2018');
request = new HttpRequest();
System.debug('URL Clled :' + theUrl.getUrl());
request.setEndpoint(theUrl.getUrl());
request.setMethod('POST');
request.setHeader('Authorization', 'OAuth ' + SESSION_ID);
HttpResponse res = h.send(request);
I am getting this issue from today onwards.Any help would be appreciated.
UserInfo.getSessionId()
is being replaced withSESSION_ID_REMOVED
.