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
nagnknagnk 

SOAP Web services calling WSDL generating classes

HI,

i consumed the WSDL file external system WSDL,generated  5 Apex classes classes what is next steps and how to write invoking class using these classes please give solution 

Thanks in advance...
Best Answer chosen by nagnk
James LoghryJames Loghry
After generating the wsdl 2 apex class, you'll need to call it from a separate Apex class.  The methods are typically instance classes, so you'll need to construct the classes first and then call your method(s).  If your method uses complex Apex classes, you'll also need to construct those before you pass them into the method.

WSDL2Apex also hard codes the endpoint based on your WSDL, so if you need to point the code to a sandbox environment for testing, then you'll need to configure the endpoint along with any headers your webservice needs.

Lastly, WSDL2Apex does NOT generate test classes, so you'll need to create those prior to deploying your Apex to production.

This link has a bit more info too: https://developer.salesforce.com/page/Apex_Web_Services_and_Callouts

All Answers

James LoghryJames Loghry
After generating the wsdl 2 apex class, you'll need to call it from a separate Apex class.  The methods are typically instance classes, so you'll need to construct the classes first and then call your method(s).  If your method uses complex Apex classes, you'll also need to construct those before you pass them into the method.

WSDL2Apex also hard codes the endpoint based on your WSDL, so if you need to point the code to a sandbox environment for testing, then you'll need to configure the endpoint along with any headers your webservice needs.

Lastly, WSDL2Apex does NOT generate test classes, so you'll need to create those prior to deploying your Apex to production.

This link has a bit more info too: https://developer.salesforce.com/page/Apex_Web_Services_and_Callouts
This was selected as the best answer
nagnknagnk
Thanks for reply sir