You need to sign in to do that
Don't have an account?
Clint
Accessing Apex webService Classes: Invalid Session Id
I'm new to salesforce and having been trying to access some Apex webServices. I've downloaded the php toolkit and both the partner and integration wsdls, and tried to
access a simple method called "subscribe", which gave me a
"INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal
Session" error.
Looking about a bit I discovered it was necessary to get a session id first, which I am able to do via the partner wsdl and the "login" method. I then tried setting the sessionId for a new connection via a setSessionHeader call, but when I try and call the "subscribe" method again, I get the same invalid session error.
I am posting a bit of code to illustrate what I'm referring to below.
Any tips, pointers or help would be greatly appreciated... thanks!
Looking about a bit I discovered it was necessary to get a session id first, which I am able to do via the partner wsdl and the "login" method. I then tried setting the sessionId for a new connection via a setSessionHeader call, but when I try and call the "subscribe" method again, I get the same invalid session error.
I am posting a bit of code to illustrate what I'm referring to below.
Code:
$mySforceConnection = new SforcePartnerClient();
$mySoapClient = $mySforceConnection->createConnection("includes/salesforce/soapclient/partner.wsdl.xml");
$mylogin = $mySforceConnection->login("username", "passandtoken");
$mySforceConnection2 = new SforcePartnerClient();
$mySoapClient2 = $mySforceConnection2->createConnection("includes/salesforce/integration.wsdl");
$mySforceConnection2->setSessionHeader($mylogin->sessionId);
Any tips, pointers or help would be greatly appreciated... thanks!
Clint
For those who may be having the same problem, I ultimately resolved this with help from Simon, in an Apex forum thread