I am new Salesforce. I've a requirement you call an external Java Web service from apex using SOAP. JAVA developers has provided their Wsdl which is supposed to be used in Salesforce to generate apex class for Java Web service.

Here I've a doubt that here do we need to write another apex class to call the newly generated apex class ( from Wsdl) which in turn connects to external service. Can anybodypls help how to get through it?

1 Answer 1


First download and save the WSDL file. Once, WSDL is downloaded and saved on local drive login to Salesforce and navigate to “Setup | Develop | Apex Classes”. On right hand side, you will find button named as “Generate from WSDL”. This button will generate equivalent Apex class to support Webservice call. The successfully 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. You can find more details in the below links.

Create an Apex Class from a WSDL

Consuming External Web Service in Apex – Salesforce

  • Please correct I am wrong in the below assumption - - if I want to call method in external Web service, do I need to call method in the generate Wsdl apex class which in turn calls external Web service Method OR can I call the external method directly from trigger?
    – Venkatz
    Aug 19, 2015 at 8:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .