I know that one of the way to invoke the custom web service is to first get the sessionId using the login() using Enterprise/Partner wsdl and then append that SessoinId with every call to the web service. What if I don't want to share Enterprise wsdl with 3rd party for some reasons and want to share only custom wsdl. Can I write custom logic to replicate the login() of Enterprise wsdl in my webservice to get the sesssionId?

Any advice is well appreciated.


  • In your custom WSDL, copy paste the loginCall logic. Then when your webserice method is called, call login call and parse that response and use same to call the method you want. May 21, 2018 at 13:55

1 Answer 1


Yes, you could write your own custom logic, but there's no reason to reinvent the wheel when it's in the existing documentation. It's a lot of work and not very "reusuable". Further, the Partner WSDL is a much better choice in terms of code resusability.

For authentication you can also use the OAuth JWT Bearer Token Flow which is much more secure for a login call than username - password authentication. It's specifically for server-to-server API integration with certificates.

Much depends on what kind of service you're creating. If you're providing a sessionId as you might with workflow, then the above may not be relevant to you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .