0

I have imported the partner WSDL and I am getting NULL value in ServerURL/SessionId after login() call.

partnerSoapSforceCom p = new partnerSoapSforceCom();
partnerSoapSforceCom.LoginResult e = new partnerSoapSforceCom.LoginResult();
String uname = 'USERNAME';
String pwd = 'PWD+TOKEN';
System.debug('The result of the login call is => '+e);
System.debug('ServerURL = '+e.serverURL);
System.debug('Session Id = '+e.SessionId);
System.debug('Get Session Id = '+e.getSessionId());

Debug shows

16:12:27:015 USER_DEBUG [6]|DEBUG|The result of the login call is => LoginResult:[apex_schema_type_info=(urn:partner.soap.sforce.com, true, false), field_order_type_info=(metadataServerUrl, passwordExpired, sandbox, serverUrl, sessionId, userId, userInfo), metadataServerUrl=null, metadataServerUrl_type_info=(metadataServerUrl, urn:partner.soap.sforce.com, null, 1, 1, true), passwordExpired=null, passwordExpired_type_info=(passwordExpired, urn:partner.soap.sforce.com, null, 1, 1, false), sandbox=null, sandbox_type_info=(sandbox, urn:partner.soap.sforce.com, null, 1, 1, false), serverUrl=null, serverUrl_type_info=(serverUrl, urn:partner.soap.sforce.com, null, 1, 1, true), sessionId=null, sessionId_type_info=(sessionId, urn:partner.soap.sforce.com, null, 1, 1, true), userId=null, userId_type_info=(userId, urn:partner.soap.sforce.com, null, 1, 1, true), userInfo=null, userInfo_type_info=(userInfo, urn:partner.soap.sforce.com, null, 0, 1, false)]

enter image description here

Can someone let know what could be the issue ?

3

You are creating new object of partnerSoapSforceCom.LoginResult and printing it. As it does not contains any data its showing null.

Try to call login method store the response in partnerSoapSforceCom.LoginResult object and then print the result like:

partnerSoapSforceCom.soap obj = new partnerSoapSforceCom.soap();
partnerSoapSforceCom.LoginResult e = obj.login('xxxxx@xxxx.com','XXXXXXXXXXXXXXX');

System.debug(e);

You will see some values

  • How silly of me..tx – Rainmaker Feb 24 '16 at 6:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.