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
sfdcdev8sfdcdev8 

Soap UI error when trying to update picklist values in metadata API

Hello,

 

I am trying to update picklist values but SOapUI is throwing error

 

MY Request:

 

--------------------------

 

   <soapenv:Header>
    <met:CallOptions>
         <met:client></met:client>
      </met:CallOptions>
      <met:SessionHeader>
         <met:sessionId>-----</met:sessionId>
      </met:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <met:update>
         <!--Zero or more repetitions:-->
         <met:UpdateMetadata>
            <met:currentName>Account.test_field2__c</met:currentName>
            <met:metadata>
               <!--Optional:-->
               <met:fullName>Account.test_field2__c</met:fullName>
                <met:label>test field2</met:label>
    <met:picklist>
             <met:picklistValues>
        <met:fullName>five</met:fullName>
             </met:picklistValues>
        <met:sorted>false</met:sorted>
  </met:picklist>
        <met:type>Picklist</met:type>
    </met:metadata>
         </met:UpdateMetadata>
      </met:update>
   </soapenv:Body>
</soapenv:Envelope>
 
Error:
----------
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Client</faultcode>
         <faultstring>Must specify a {http://www.w3.org/2001/XMLSchema-instance}type attribute value for the {http://soap.sforce.com/2006/04/metadata}metadata element</faultstring>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>
 
One more thing I am not sure what should be the value in the <met:client></met:client>
 
Please suggest.
 
dinesh angaridinesh angari

Hi,

I am also facing the same issue, Did you got any solution for this...

If you have any solution please let me know

 

 

Martand AtreyMartand Atrey

Hi, 

I was also facing the same issue. Try below and let me know if this fix works.

In tag soapenv:Envelope - Add the following - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

in met:metadata Tag - add the following - xsi:type="met:__customValue__"

replace __customValue__ with the object you are trying to update. 

For example if you are trying to update the CustomObject, then the attribute will be  = xsi:type="met:CustomObject"

let me know if this helps.