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
David Baumann 31David Baumann 31 

How to Delete AccountContactRelation Record with SOAP API Call?

We are planning to deepen out integration between Salesforce and a third-party tool. Within the tool we have multiple accounts related to one contact. To replicate the relations between these contacts and accounts, I activated the AccountContactRelation Object in Salesforce. Now I can successfully create a relation based on a SOAP create() call which uses the external IDs to relate the records, but I can not delete such a relation in response to a change in the external system. (I use SoapUI for testing)

I tried to use this SOAP delete() request:
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:sessionId>${#TestCase#sessionId}</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:delete>
         <!--Zero or more repetitions:-->
         <urn:sObjects xsi:type="urn1:AccountContactRelation" xmlns:xsi="http://www.w3.org/2001/XMLSchema instance">
            <!--Zero or more repetitions:-->
            <Account>
                <Account_ExternalID__c>2648</Account_ExternalID__c>
            </Account>
            <Contact>
                <Contact_ExternalID__c>4585</Contact_ExternalID__c>
            </Contact>
         </urn:sObjects>
      </urn:delete>
   </soapenv:Body>
</soapenv:Envelope>
I get the following error message: 
Unexpected element {}Account during simple type deserialization
What am I doing wrong?