You need to sign in to do that
Don't have an account?
rv90
How can a salesforce WSDL file to authenticate without session id from external application ?
Hi i got a custom WSDL file and when ever i try to request data from salesforce from external application through wsdl it is asking me session id , Is there any way where i can access the salesforce data through wsdl file with out entering session id each and every time or like anything where we can include authentication in the same apex class and then generate the wsdl file where the authentication will take pace internally or something like that.
However, what I typically do is try to persist that session id in my application. For instance, you cache it somewhere in your external service so that you only call login once, and then you can pass the same session id until that session expires.
Once the session expires, then you'll get an error message and can re-call the login service and re-cache the session id if necessary.
All Answers
You'll need to call the login operation first prior to passing in the session Id. The login operation can be found by downloading (and importing) the enterprise WSDL file first. Once you call the login operation, you'll get the session id in the response, and then you can pass that session id into your custom wsdl / web service call.
It's best to test this in soap ui first, to make sure you have the general flow down. Patrick Connelly has done a great job of explaining this in one of his many blog posts here: http://blog.deadlypenguin.com/blog/2012/02/03/salesforce-and-soapui/
Regards,
- James
I am here sending a request from external application using Noble Phone number as a parameter and generating session id each and every time i want to call salesforce.
Is there any was where this authentication is done automatcally, so that we do not need to generate session id everytime for salesforce call. ?
Any method where we can pass username and -password and token key in the apex class itself so that we just need to send username and password and the parameters to get the response from the saleforce?
Please suggest if any solution. I have my apex code snippet for WSDL SOAP webservice for reference
However, what I typically do is try to persist that session id in my application. For instance, you cache it somewhere in your external service so that you only call login once, and then you can pass the same session id until that session expires.
Once the session expires, then you'll get an error message and can re-call the login service and re-cache the session id if necessary.