I am currently receiving an error when doing a metadata deploy. I have the following zip file structure:

Zip (File)
  --> Classes (Folder)
      --> MyCustomWrapper.cls (Class File)
      --> MyCustomWrapper.cls-meta.xml (Class Metadata)
  --> package.xml (File)

My package.xml is structured as follows:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">

This is what I get when I deploy the file via the Metadata Deploy in Workbench:

Metadata API Failure

Why is the deploy looking for a package.xml in the classes folder? Shouldn't it expect the package.xml to be in the root of the zip file?


You should contain the package within a single folder of the ZIP file, like this:

+ Zip File
|-- src
  |-- package.xml
  +-- classes
    |-- MyCustomWrapper.cls
    |-- MyCustomWrapper.cls-meta.xml

The system saw a single folder in the ZIP file, and assumed that that was the wrapper folder.

| improve this answer | |
  • Thanks for the comment! Unfortunately I made two mistakes in my comment, I capitalized the package.xml in my question when it was not capitalized in my deployment and I overwrote my ApexClass with MyCustomWrapper rather than NetSuiteResult. Question has been updated. – techbusinessman Dec 15 '15 at 18:29
  • @techbusinessman Everything should be in order if you did that. For completeness, did you try wrapping the entire file in a src folder? – sfdcfox Dec 15 '15 at 18:43
  • I did not. I had been thinking about that to see what would happen. I'll try and then let you know what happens. – techbusinessman Dec 15 '15 at 18:49
  • You rock, needed to wrap it in a src folder. Thanks! – techbusinessman Dec 15 '15 at 19:13
  • 1
    @techbusinessman I'll revise this answer to your findings. Glad I was able to help. – sfdcfox Dec 15 '15 at 19:14

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.