SOAP Login from Salesforce TO Salesforce

stacyrose

Member
I executed a cluster work which makes a webservice call inside the equivalent salesforce occasion, which at that point should send messages with a pdf connection, since you can't send pdf connections straightforwardly from a bunch work. My webservice call resembles 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, therefore i get a INVALID_SESSION_ID exception.

How can i log in to get a SessionId? So far I found no solution to login from salesforce to salesforce and Salesforce training hyderabad. If u can help I would appreciate it! Thanks!
 
Back
Top