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

Generating Apex Class from WSDL

I'm trying to generate Apex code from a WSDL and getting this error in Development environment: (I deleted the url)


Error: Failed to parse wsdl: Found schema import from location https://         External schema import not supported


I compare the WSDL I have in Dev with the one we are currently using in Production and they are the same.


I would appreciate any comment/suggestion why this is not working, thank you!!!

Best Answer chosen by Admin (Salesforce Developers) 

A wsdl's first line of code should look like this:


<wsdl:definitions name="nmtoken"? targetNamespace="uri"?>

(Web Services Description Language (WSDL) 1.1,, Section 2.1)


Your WSDL file missing the targetNamespace attribute, which is required by to infer the correct namespace (note that WSDL 1.1 uses a ?, meaning it is an optional parameter).