0

I am using schedulable class which will invoke apex call out. This is the salesforce web service from same org. I am getting the following error:

System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor=

Can any one help me on this? I am using UserInfo.getSessionId() method to get session id.

Boris Bachovski
  • 16,216
  • 8
  • 47
  • 85
goodForce
  • 1,245
  • 1
  • 21
  • 38

1 Answers1

1

You cannot get the session ID when running a batch:

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_userinfo.htm

Look up "getSessionId()" usage.

Boris Bachovski
  • 16,216
  • 8
  • 47
  • 85