I'm working with the Metadata API, and I'm attempting to simply create a Custom Object.
I'm using the Python zeep
package, and it generates for me this XML:
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
<ns0:SessionHeader xmlns:ns0="http://soap.sforce.com/2006/04/metadata">
<sessionId>...</sessionId>
</ns0:SessionHeader>
</soap-env:Header>
<soap-env:Body>
<ns0:createMetadata xmlns:ns0="http://soap.sforce.com/2006/04/metadata">
<ns0:metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns0:Metadata">
<ns0:fullName>SomeCustomObject</ns0:fullName>
</ns0:metadata>
</ns0:createMetadata>
</soap-env:Body>
</soap-env:Envelope>
But when I send the query, it gives me this error:
Fault: Must specify a {http://www.w3.org/2001/XMLSchema-instance}type attribute value for the {http://soap.sforce.com/2006/04/metadata}metadata element
I was getting that error earlier, and thought it was because I was missing xsi:type
on the metadata
element, since that attribute wasn't there yet. But as you can see, I fixed it such that the generated XML now has that attribute, but it still gives me the error.
Can someone explain this error to me? I'm not sure if the issue is in Python where that XML gets generated, or if that's the correct XML, and a later step is having an issue.
Thanks!