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="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<readMetadataResponse>
<result>
<records xsi:type="CustomLabel">
<fullName>Accepted</fullName>
<language>en_US</language>
<protected>true</protected>
<shortDescription>Accepted</shortDescription>
<value>Accepted</value>
</records>
<records xsi:type="CustomLabel">
<fullName>Rejected</fullName>
<language>en_US</language>
<protected>true</protected>
<shortDescription>Rejected</shortDescription>
<value>Rejected</value>
</records>
</result>
</readMetadataResponse>
</soapenv:Body>
</soapenv:Envelope>