You need to sign in to do that
Don't have an account?

UserInfo.getSessionId () returning null for site user
We have a site for our customers to use to view their accounts / bill / update their details / etc. As part of the site we have a wizard where the customer can sign up as a user (the public user for the site has access to those pages).
On submission of the last page in the wizard, there is a webservice call back to Salesforce to create the user (I believe it was done this way due to restrictions in creating a user).
This whole process is currently working successfully in production, however, our testers needed to setup some users in our Test sandbox and we are getting the following error in the Test environment:
EXCEPTION_THROWN|[63]|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=
The code at line 63 is just a WebServiceCallout.invoke.
The session Id is set in the controller with the following code:
The Test sandbox is on CS5 (winter 15), but I have also tested the process in our Training sandbox which is on CS6 (Summer 14) and the same error is occuring there.
I'm not sure how long this has been happening because we haven't tested this process for a little while and it hasn't been modified in several months either.
On submission of the last page in the wizard, there is a webservice call back to Salesforce to create the user (I believe it was done this way due to restrictions in creating a user).
This whole process is currently working successfully in production, however, our testers needed to setup some users in our Test sandbox and we are getting the following error in the Test environment:
EXCEPTION_THROWN|[63]|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=
The code at line 63 is just a WebServiceCallout.invoke.
The session Id is set in the controller with the following code:
PortalUtil_WS.PortalUtil stub = new PortalUtil_WS.PortalUtil(); stub.SessionHeader = new PortalUtil_WS.SessionHeader_element(); stub.SessionHeader.sessionId = UserInfo.getSessionId();
The Test sandbox is on CS5 (winter 15), but I have also tested the process in our Training sandbox which is on CS6 (Summer 14) and the same error is occuring there.
I'm not sure how long this has been happening because we haven't tested this process for a little while and it hasn't been modified in several months either.
All Answers