Friday, February 23, 2018

Resolving WSDL File with external schemas In salesforce


Resolving WSDL File with external schemas In salesforce


One of them limitation of Salesforce “Generate from WSDL” is that it doesn’t support WSDL
files that imports external schemas.
For example, the following WSDL fragment imports an external schema, which is not supported
 <wsdl:types>  
  <xsd:schema  
   elementFormDefault="qualified"  
   targetNamespace="http://s3.amazonaws.com/doc/2006-03-01/">  
   <xsd:include schemaLocation="AmazonS3.xsd"/>  
  </xsd:schema>  
 </wsdl:types>  

When we upload a WSDL file that has imports an external schema then salesforce doesn’t parse WSDL and give following error in return.
Failed to parse wsdl: Found schema import from location XXX.xsd . External schema import not
supported

Workaround is to replace import statement with referenced schema. Here are steps.


  1. Open the WSDL with a text editor. 
  2. Inside <wsdl:types> (below the last <schema>) paste each referenced.xsd file content. Paste only <schema></schema>
  3. Once all schemas are in the WSDL then comment all <xsd:import> using <!-- → or remove them.  They are no longer needed.
  4. Save and you are ready to go.



Getting Started with Salesforce DX

Salesforce DX is a great way to let multiple peoples work together and also make deployment much easier. Salesforce DX make release cycle m...