QUESTION
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>
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?
ANSWER
the sObjects element should have an xsi:type attribute, e.g.
<sObjects xsi:type="CustomField">
You must log in to answer this question.