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
ken_devken_dev 

APEX Class Webservice keyword

Has anyone been successful calling webservice methods?
I added the webService keyword to the methods i wanted to expose. I created a WSDL and generated a Web Reference (in .NET).
When i attempt to call the webmethod i get: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session error.

Are these web services locked down? There is NO login methods available through the webreference like the SalesForce enterprise API.
How would I authenticate to call my custom web method?



thanks,
ken
SuperfellSuperfell
call the login method on the regular enterprise or partner API, and use the resulting sessionId with your specific apex stub.
Cool_DevloperCool_Devloper

Hi There, 

Can you please suggest how can i pass username/password/token to the webservice method? 

I mean there is no seperate Login mehod in apex to do the authentication in the apex class. Then how can i achieve the handshake when i call my apex webservice method from outside salesforce?

Many thanks in advance! 

Cool_D

SuperfellSuperfell
Call login in the enterprise or partner API, or use oAuth, or use web links to pass a sessionId from salesforce to your app. depends on exactly how you're trying to integrate.
Cool_DevloperCool_Devloper

Thanks a ton Simon!!

I will try out these options.

Almost everytime, you come to people's rescue

 

Simpy Great!! Cool_D