You need to sign in to do that
Don't have an account?
I want to work with Metadata API and write an apex code to use Metadata API
I have to work in Metadata API to customize my salesforce org through Apex.
I have generated WSDL for Metadata API as well as Enterprise
but when I am generating apex code for these WSDL it is showing errors to both the files
1. Enterprise WSDL - Apex Generation FailedUnsupported schema type: {http://www.w3.org/2001/XMLSchema}anyType
2. MetaData API- "Apex Generation Failed Class name 'Metadata' already in use. Please edit WSDL to remove repeated names"
For Enterprise error changing anyType to string couldn't solve my error.
Please assist me if any one have any idea to get rid of this issue.
Thanks in advance.
Regards,
Tushar Seth
No luck for me too :(
Hi,
In metadata file, there is service tag as shown below:
<service name="MetadataService">
<documentation>Manage your Salesforce.com metadata123</documentation>
<port binding="tns:MetadataBinding" name="MetadataWebSvc">
<soap:address location="https://cs11-api.salesforce.com/services/Soap/m/26.0"/>
</port>
</service>
Just change the name attribute value of the port tag to something different and then try to generate.
It worked for me.
Thanks,
Amit Vaidya
Hi @Amit Vaidya,
I have changed the name attribute value as "Metadataaa". But after that, I am getting below error:
The following generated class(es) have compilation errors:
Error: AsyncSoapSforceCom200604Metadataaa
Error: Dependent class is invalid and needs recompilation: Class soapSforceCom200604Metadataaa : Script too large: public class soapSforceCom200604Metadataaa { public class ReportTypeColumnTranslation { ... at 3:14
Error: soapSforceCom200604Metadataaa
Error: Script too large: public class soapSforceCom200604Metadataaa { public class ReportTypeColumnTranslation { ... at 3:14g
Please guide me right path.
Thank you.
I too got the same issue, did you solved it by any chance?? Please let me know.
Thank you.
Is this issue resolved? i am facing the same issue and i see the generating apex class has more than 1 million characters which is causing the script too large issue. As per Apex Class the character count should not exceed 1 million.
If anyone has the solution to this, could you please post it here.
For the script too large error, use FuseIt SFDC explorer. Download it and convert Metadata WSDL to Apex. Then copy the Generated class, go to salesforce Apex Class section from Salesforce UI and paste it and save it. It should resolve the issue.