+ Start a Discussion
ChichoChicho 

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) 
gbu.varungbu.varun

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

 

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

(Web Services Description Language (WSDL) 1.1, http://www.w3.org/TR/wsdl, Section 2.1)

 

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