function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nikhil Garg 17Nikhil Garg 17 

WSDL TO APEX PARSER

Hi Team,
I have generated the metadata WSDL file to parse to the apex class.
But when I'm trying to parse that WSDL using UI, so it show me error "File size should be less than 1 MB).
And my file size is 1.2 MB and when I'm trying to compress the size of file it's not compressing in less than 1 MB.

Can we have another way to do the same.

Regards
Nikhil
Lavon JohnsonLavon Johnson
Hello,

If you're encountering an error stating that the WSDL file size should be less than 1 MB when trying to parse it using the UI, there are a few alternative approaches you can consider to overcome this limitation:

Split the WSDL file: If possible, you can try splitting the WSDL file into smaller parts that are each less than 1 MB in size. You can divide it based on logical sections or separate complex types into individual files. This way, you can parse each smaller file separately within the size limit.

Use a command-line tool: Instead of relying on the UI, you can explore command-line tools or libraries that can parse WSDL files. These tools often have higher file size limits or may even support parsing larger files without any restrictions. Look for open-source or third-party libraries compatible with your programming language.

Use a different WSDL parser: Consider using a different WSDL parser that doesn't have the file size limitation. Some parsers may handle larger files more efficiently. Look for alternative libraries or tools specific to your programming language or platform.

Check for API limitations: Verify if the API or framework you are using to parse the WSDL has any specific documentation or guidelines regarding file size limits. There might be alternative methods or workarounds provided by the API itself. (https://www.myaccountaccess.one/)
 
VinayVinay (Salesforce Developers) 
Hi Nikhil,

You can check on below points.
  • Manually extract the elements from the WSDL that you don't need and then send that through WSDL2Apex. It will generate less Apex code.
  • Use the Partner API rather than the Enterprise API. The WSDL is smaller as it doesn't have dedicated complex types for every object in your org.
  • Use the version of WSDL2Apex in the FuseIT SFDC Explorer (https://www.fuseit.com/explorer). After you import the WSDL you will be given an option to select the web menthods you need access to. You can then opt to comment out or exclude and unnessacary parts of the code not required by the selected methods.
Please mark as Best Answer if above information was helpful.

Thanks,