7

Question

What techniques can I use to modify a 3rd party WSDL that includes import tags so that I can use the Salesforce generate apex class from WSDL feature?

Background

I'm a beginner at using WSDLs and I'm trying to implement a 3rd party WSDL on salesforce. When I try to parse the wsdl I get the error "Error: Failed to parse wsdl: Unsupported Schema element found http://www.w3.org/2001/XMLSchema:include. At: 13:54".

I'm making an assumption that this is referring to XMLSchema import tag

<xs:import
    namespace="http://ws.clareity.com/clareityStoreFaults"
    schemaLocation="clareityStoreFaults.xsd"></xs:import>

Is it possible to flatten the import statement so that the Salesforce WSDL to Apex parse can handle this? I've done a lot of googling but am having some trouble as I don't know the terminology to describe what I'm looking to do.

I've upload the WSDL and related files in it's entirety into a gist.

  • Any joy with this Ralph? Happy to take a deeper look if your still puzzling? – Andrew Fawcett Jun 1 '13 at 18:27
  • Not yet @andrew, hoping to spend more time on it tomorrow. I'm torn between abandoning the approach and just manually consuming the SOAP, or just use a non-salesforce tool to consume the webservice and then have that communicate to Salesforce. As much as I'd love to get it working natively, in the past i've gotten burned wasting a ton of time working around the shortcomings of Salesforce features with no finished result :( – Ralph Callaway Jun 3 '13 at 15:24
1

UPDATE: As it stands this doesn't actually work. You will get the message

Apex Generation Failed
No type specified for element vendorId

Most likely the issue is the missing first import that defines the data types.


I was able to get the WSDL to import and generate code by merging the content of clareityStoreFaults.xsd directly into the ClareityStore.wsdl. Note that I didn't do the same for the http://schemas.xmlsoap.org/wsdl/ import.

So the steps were:

  1. Comment out <xs:import namespace="http://schemas.xmlsoap.org/wsdl/"></xs:import>
  2. Comment out <xs:import namespace="http://ws.clareity.com/clareityStoreFaults" schemaLocation="clareityStoreFaults.xsd"></xs:import>
  3. Paste the contents of clareityStoreFaults.xsd xs:schema element under the commented out code from step 2.
  4. Import the modified WSDL into Salesforce

I haven't been able to test if it actually works against the web service, but it does import and generate code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.