2

I'm using the SOAP Tooling API to try and update a CustomField (posting to /services/Soap/T/29.0)

The method signature is SaveResult[] update(sObject[] sObjects) - and CustomField extends sObject so it shouldn't be a problem to send that down the wire. However I encounter:

INVALID_TYPE: Must send a concrete entity type.

Then I looked at my raw XML on the wire, I can't say I'm surprised! How is the Tooling API service expected to differentiate between the different supported objects, unless it's doing smarts on the Id?

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <env:Header>
    <SessionHeader xmlns="urn:tooling.soap.sforce.com">
      <sessionId>
        00Db0000000d6mj...ViG5ZyFtqu
      </sessionId>
    </SessionHeader>
  </env:Header>
  <env:Body>
    <update xmlns="urn:tooling.soap.sforce.com">
      <sObjects>
        <Id>00Nb0000007p4tE</Id>
        <DeveloperName>NumberOfLocations</DeveloperName>
        <FullName xsi:nil="true"/>
        <Metadata xsi:nil="true"/>
        <NamespacePrefix xsi:nil="true"/>
        <TableEnumOrId xsi:nil="true"/>
      </sObjects>
    </update>
  </env:Body>
</env:Envelope>

What tag/attribute am I missing that's necessary for it to perceive my CustomField as concrete?

1 Answer 1

3

the sObjects element should have an xsi:type attribute, e.g.

<sObjects xsi:type="CustomField">
1
  • bullseye! appreciate your guidance Simon Jan 13, 2014 at 19:54

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.