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
SignavioSignavio 

INVALID_SESSION_ID: webService call from salesforce TO salesforce

Hi, i implemented a batch job which makes a webservice call within the same salesforce instance, which then is supposed to send emails with a pds attachment, since you cannot send pdf attachments directly from a batch job. My webservice call looks like this: public static void callOut(List ids){ InvoiceAttachmentConnector.InvoiceAttachmentService ws = new InvoiceAttachmentConnector.InvoiceAttachmentService(); ws.SessionHeader = new InvoiceAttachmentConnector.SessionHeader_element(); ws.SessionHeader.sessionId = UserInfo.getSessionId(); ws.handleInvoicePdfAttachment(ids); } However in batch jobs UserInfo.getSessionId() returns null. How can i log in to get a SessionId? So far I found no solution for sf to sf. If u can help I would appreciate it! Thanks!
SignavioSignavio
Sorry salesforce messed up my formatting... :( I can't even edit my post. Here is the formatted code: http://pastebin.com/efUfwCDx Still hope for some help! Thank you!