Create an Apex Class from a WSDL
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 , or right-click your project and choose .
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.