SOAP web service – How to creating a class from WSDL document?
SOAP web service class can be generated automatically by using WSDL document. Generating WSDL document allows Salesforce developers to make callouts to the external web service in their Apex code.
Follow below steps to generate apex class from a WSDL:
1.Go to Apex Classes form setup menu.
2.Click “Generate from WSDL” button.
3.Select WSDL document(XML file) you are using to generate apex class by clikcing choose file lookup button. This WSDL document is base to generate apex class.
4.Click Parse WSDL button which is highleted in the above image to verify WSDL document contents. It generates default class name based on WSDL document. It report errors in case of the WSDL contains schema types or constructs that aren’t supported by Apex classes, or if the resulting classes exceed the 1-million-character limit on Apex classes. For example, the Salesforce SOAP API.
Generated Apex classes include stub and type classes for calling the third-party Web service represented by the WSDL document. These classes allow you to call the external Web service from Apex.
When you generate Apex classes by using WSDL, it generated 2 classes, one is with given name for synchronus callouts and other is prefixed with Async for asynchronus callouts.
Refere here to know more about SOAP callouts: https://trailhead.salesforce.com/modules/apex_integration_services/units/apex_integration_soap_callouts