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
DonSpilkyDonSpilky 

Allowing 3rd party to call my WebService

I'm just beginning to play with WebServices and I wrote a little webserivce class, to use as a proof of concept.  It's simple enough really, just creating 2 dummy accounts and returning them in a list of accounts.  I generated the class WSDL, and handed it to my Java developer to see if he could execute it and get anything back.

 

He gets the following error:

“faultCode: {http://soap.sforce.com/2006/08/apex}INVALID_SESSION_ID

 faultSubcode:

 faultString: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session

 

I have created an API only account but my developer is saying there is nowhere to set the session ID on my webservice.

 

Any assistance would be appreciated.

 

Thanks!

 

=============================================================================

Global  class SendProspectSOA {
    Webservice static List<account> SendAcct(){
        List<account> newAccts = new List<account>();
        Account oneAccount = new Account();
        oneAccount.Name = 'Test 1';
        newAccts.add(oneAccount);
        oneAccount.Name = 'Test 2';
        newAccts.add(oneAccount);
        return newAccts;
    }
}

SuperfellSuperfell

You call the login method from the partner or enterprise WSDLs to get a session and set it in the sessionHeader element defined in the WSDL (or you get a sessionId from one of the other alternatives like oAuth or a weblink)