Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've generated an Apex class based on the Metadata WSDL file I got from my org. I call the readMetadata function and while the response received contains all the data I want, the callout fails because of 'Apex type not found for element language'. What is missing from the generated code that it can't parse responses?

The response looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="" xmlns="" xmlns:xsi="">
                <records xsi:type="CustomLabel">
                <records xsi:type="CustomLabel">
share|improve this question
up vote 2 down vote accepted

Andrew Fawcett has done a lot of work on using this API from Apex. Some of the issues are listed in his Challanges calling the Metadata API from Apex, such as polymorphic types that the Apex WSDL tooling can't handle.

So rather than the WSDL emitted by an org, that financialforcedev/apex-mdapi Git project is the best place to start.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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