I got the requirement where I need to consume the WSDL from Workday and create/update contact records in Salesforce. Can someone of you please assist me in how to utilize a WSDL from Workday into apex. Any sample code to implement the same will be more helpful.

Thanks in Advance


If the WSDL is fairly basic you can use a tool provided from Salesforce called WSDL2Apex. It will generate Apex classes that allow you to callout to the web methods exposed by the web service. You will also need to add a Remote Site setting to allow the callout to the target URL to occur.

Note that this will generate both synchronous and asynchronous classes for performing the callout. The latter is for use from Visualforce pages if you don't want to busy wait for the response.

There are limits to what type of SOAP callouts Apex supports and the type of WSDLs that WSDL2Apex can handle. See Supported WSDL Features.

You may get some further flexibility by using the open source version of WSDL2Apex. Or you may need to resort to manually forming the HTTP callouts and response parsing.

Finally, in the self promotion category, I've made an independent version of WSDL2Apex that is distributed by my employer. This can overcome a number of limitations from the built in version, but is still ultimately limited by what Apex supports via WebServiceCallout.invoke.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.