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

Consume external web service with Apex code


How can I consume an external web service using Apex code? I have seen a post here from two years ago that says it's impossible. There is a news article saying that Salesforce have implemented this functionality -

How can it be done?

It IS possible now.  All you need is the WSDL of your web service, and will generate all the required code to callout the external webservice for you.  Here's the link to the developers' guide page that describes the process:
Please read therough the complete documentation on this page, and make sure that your WSDL is of the same type that accepts (details mentioned in the guide).  I hope this helps.


Can it be possible to call the Salesforce API methods like changePassword,upsert and so on from the apex code.

I saw a lot of threads using javascript.But I need to access it from the Apex code rather than javascript.

Please help me with some code sample if it is possible with Apex.