2

I am trying to upsert /populate Project Lookup by using external Id field on Product object.

Getting Error as response

XML Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
<soapenv:Header>
<urn:SessionHeader>
<urn:sessionId>00DO00000000001!ARsAQLbrR_NotARealSessionId_oFVysAK_A9RYsdJMk2Wi3Up8V</urn:sessionId>
</urn:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<urn:upsert>
<urn:externalIDFieldName>External__c</urn:externalIDFieldName>
<urn:sObjects xsi:type="urn1:Product2">
<Name>Test Product1</Name>
<External__c>123test9</External__c>
<urn1:Project__c xsi:type="urn1:Project__c"> 
<Project_Unique__c>4030_12</Project_Unique__c>
</urn1:Project__c>
</urn:upsert>
</soapenv:Body>
</soapenv:Envelope>

Response :

   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Client</faultcode>
         <faultstring>Unable to find a de-serializer for the type {urn:sobject.enterprise.soap.sforce.com}Project__c</faultstring>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

Updated Question Not sure why I am getting error.

1

The example message you posted isn't well formed xml, I'll assume that's just cut'n'paste error.

The problem is that you're specify the relationship wrong, you're setting the Project__c value, which is the FK field, rather than the relationship field (which would end in __r), you want something like

<urn:sObjects xsi:type="urn1:Product2">
<Name>Test Product1</Name>
<External__c>123test9</External__c>
<Project__r xsi:type="urn1:Project__c"> 
  <Project_Unique__c>4030_12</Project_Unique__c>
</Project__r>
</urn:SObjects>
</urn:upsert>
</soapenv:Body>
</soapenv:Envelope>
0

It looks like you are using the Enterprise API. The Enterprise API is specific to the schema of the Org that generated the WSDL and to the user who generated it.

If the Target org receiving the SOAP request doesn't have the same schema you will get an error like:

Unable to find a de-serializer for the type {urn:sobject.enterprise.soap.sforce.com}Project__c

It's telling you it doesn't know what that custom object is.

Either regenerate the Enterprise API WSDL from the target org, or switch to using the Partner API which is metadata driven and hence not org specific.

Also ensure the user making the API call has permissions to access the custom object.

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.