• Clint
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 12
    Replies
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.

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!
  • June 27, 2008
  • Like
  • 0
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.

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!
  • June 27, 2008
  • Like
  • 0
I am new to APEX classes and have a few questions.  I posted once in the PHP forums to try and find a solution, but the answers were not clear

1)  If I create an APEX class can I access this from an external server/system or set of scripts that I write?  The script can be written in any language: PHP, Perl, etc....
2) Once I create the class and generate the WSDL from the class, do I download it and then use this like I do the Partner WSDL file


Any help or guidance would be appreciated.

I hope this is not too generic to answer my questions

Thanks,
Mike