1

I'm trying to upload the following wsdl to generate apex classes.But i'm getting a schema error Do I need to make any changes on the xsd?

Error: Failed to parse wsdl: Found schema import from location https://webservices.sandbox.netsuite.com/xsd/platform/v2015_1_0/core.xsd. External schema import not supported

2

2 Answers 2

2

The Salesforce tooling only supports a sub-set of the possible constructs available in WSDL/XSD. See SOAP Services: Defining a Class from a WSDL Document for the details.

One thing not supported is the external schema import your WSDL contains. That can potentially by manually fixed by you editing the files: grab the source of the imports and add themin-line. The example in the documentation of such a fix is to convert this:

<wsdl:types>
  <xsd:schema
   elementFormDefault="qualified"
   targetNamespace="http://s3.amazonaws.com/doc/2006-03-01/">
    <xsd:include schemaLocation="AmazonS3.xsd"/>
  </xsd:schema>
</wsdl:types>

to this:

<wsdl:types>
  <xsd:schema
    xmlns:tns="http://s3.amazonaws.com/doc/2006-03-01/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    targetNamespace="http://s3.amazonaws.com/doc/2006-03-01/">

    <xsd:element name="CreateBucket">
      <xsd:complexType>
        <xsd:sequence>
   [...]
  </xsd:schema>
</wsdl:types>

Unfortunately your WSDL contains a lot of imports.

There is also a pretty hight chance that you will run into other unsupported features.

2
  • <xsd:import namespace="urn:core_2015_1.platform.webservices.netsuite.com" schemaLocation="webservices.sandbox.netsuite.com/xsd/platform/v2015_1_0/…> Can you pls help me on the conversion of this import I'm confused on how to handle the name space and schem alocation. Commented Jun 15, 2015 at 15:43
  • @HarishGudipudi I can't access that... Roughly speaking you need to setup the namespace prefixes used in the XSD on the xsd:schema element.
    – Keith C
    Commented Jun 15, 2015 at 16:31
2

Unfortunately Salesforce only supports very basic WSDL features and the WSDL 2 Apex tool isn't very helpful for most WSDLs.

I've had some decent success using FuseIt SFDC Explorer's WSDL Parser & Apex Generate Features. You may be interested in looking into it and seeing if it better meets your needs.

You must log in to answer this question.

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