AnsweredAssumed Answered

MetaData API - Unable to determine type mapping for type CustomMetadata. Type is illegal here.

Question asked by 94071669 on Sep 12, 2016
Latest reply on Sep 12, 2016 by 94071669

I'm using Web service SOAP Client connector to Upsert some data into Salesforce using MetaData API. Not sure what I'm doing wrong here.

 

Below is the error I'm seeing when I test run:

" Test execution of test completed with errors. Embedded message: [soapenv:Client] Unable to determine type mapping for type CustomMetadata. Type is illegal here."

 

Below is the SOAP Request. I created the XML Profile by importing a successful Request XML that I tested using SOAP UI.

 

<ns1:Envelope xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns4="http://soap.sforce.com/2006/04/metadata" xmlns:ns3="http://www.w3.org/2001/XMLSchema-instance">
<ns1:Header>
<ns4:SessionHeader>
<REMOVED>
</ns4:SessionHeader>
</ns1:Header>
<ns1:Body>
<ns4:upsertMetadata>
<ns4:metadata ns3:type="CustomMetadata">
<ns4:fullName>TDU_Cycle_test.aa101</ns4:fullName>
<ns4:description>Test</ns4:description>
<ns4:label>test</ns4:label>
<ns4:protected>false</ns4:protected>
<ns4:values>
<ns4:field>Tdu_Meter_Cycle__c</ns4:field>
<ns4:value>test</ns4:value>
</ns4:values>
</ns4:metadata>
</ns4:upsertMetadata>
</ns1:Body>
</ns1:Envelope>

 

Here is the SOAP UI Request that was successful and used to import:

 

<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">-<env:Header>-<SessionHeader xmlns="http://soap.sforce.com/2006/04/metadata"> <sessionId><REMOVED></sessionId> </SessionHeader></env:Header> -<env:Body>-<m:upsertMetadata xmlns:m="http://soap.sforce.com/2006/04/metadata"> -<m:metadata xsi:type="m:CustomMetadata"><m:fullName>TDU_Cycle_test.MC_000006</m:fullName> <m:description>created from meta data loader</m:description> <m:label>MC_000006</m:label><m:protected>false</m:protected> -<m:values><m:field>Tdu_Meter_Cycle__c</m:field><m:value xsi:type="xsd:string">05</m:value></m:values> -<m:values><m:field>Date__c</m:field><m:value xsi:type="xsd:dateTime">2016-09-07T21:39:15.686Z</m:value></m:values> </m:metadata></m:upsertMetadata></env:Body></env:Envelope>

 

Thanks

Rohan Podile

Outcomes