Create an Apex Class from a WSDL

Force.com IDE is in a maintenance-only state. We still provide support for the product through our official channels, but updates prior to October 12, 2019 will be only for critical security issues that arise. On October 12, 2019, we will no longer provide support or updates of any kind for Force.com IDE. On that date, we will also begin archiving documentation and removing download links for the product. We recommend that you start migrating to Salesforce Extensions for Visual Studio Code or one of the great tools made by our partners. For more information, see The Future of Salesforce IDEs on the Salesforce Developers Blog.

Warning

You can generate Apex classes from a WSDL document that is stored on a local hard drive or network. Creating a class by consuming a WSDL document allows you to make callouts to an external Web service in your Apex code by calling the methods in the generated class.

To create an Apex class from a WSDL, click File | New | Apex Class from WSDL, or right-click your project and choose New | Apex Class from WSDL.

The first step of the WSDL to Apex wizard enables you to specify a WSDL file to import and choose whether to generate asynchronous classes.

Field Description
WSDL File Click Browse to select a WSDL file from your local hard drive or a network drive.
Add Async Class Check this box to generate asynchronous classes. The generated classes enable you to make synchronous callouts. If you choose to also generate asynchronous classes by checking this box, you can make asynchronous callouts from a Visualforce page by using those classes.

In the second step of the wizard, you can rename the new classes. The wizard creates a default class name for each namespace in the WSDL. While you can save more than one WSDL namespace into a single class by using the same class name for each namespace, Apex classes can be no more than 1 million characters total. You can rename synchronous classes only. The names of asynchronous classes correspond to the names of their synchronous counterparts and contain a prefix of Async.

Open-source code for the WSDL to Apex wizard is available in the WSDL2Apex GitHub repository. Developers in the GitHub community can add enhancements or customizations to WSDL2Apex. The Force.com IDE plug-in is a snapshot of the WSDL2Apex and idecore GitHub repositories at the time of the latest official plug-in release.

Note