The webhook event payload sent to the webhook endpoint in the app is a SOAP request and the response is expected to a SOAP response message. However, the response sent by the platform is JSON.
Below is the SOAP request made to the webhook:
<soapenv:Body>
<notifications xmlns="http://soap.sforce.com/2005/09/outbound">
<OrganizationId>00D2x000006MlWlEAK</OrganizationId>
<ActionId>04k2x000000GnAwAAK</ActionId>
<SessionId xsi:nil="true"/>
<EnterpriseUrl>https://ap17.salesforce.com/services/Soap/c/48.0/00D2x000006MlWl</EnterpriseUrl>
<PartnerUrl>https://ap17.salesforce.com/services/Soap/u/48.0/00D2x000006MlWl</PartnerUrl>
<Notification>
<Id>0032x000006vFy5AAE</Id>
<sObject xsi:type="sf:Contact" xmlns:sf="urn:sobject.enterprise.soap.sforce.com">
<sf:Id>0032x000006vFy5AAE</sf:Id>
<sf:CleanStatus>Pending</sf:CleanStatus>
<sf:CreatedById>0052x000002DnNoAAK</sf:CreatedById>
<sf:CreatedDate>2020-08-14T17:25:07.000Z</sf:CreatedDate>
<sf:Email>superman@freshdesk.com</sf:Email>
<sf:IsDeleted>false</sf:IsDeleted>
<sf:IsEmailBounced>false</sf:IsEmailBounced>
<sf:LastModifiedById>0052x000002DnNoAAK</sf:LastModifiedById>
<sf:LastModifiedDate>2020-08-14T17:25:07.000Z</sf:LastModifiedDate>
<sf:LastName>Sherlock Holmes</sf:LastName>
<sf:LastReferencedDate>2020-08-14T17:25:07.000Z</sf:LastReferencedDate>
<sf:LastViewedDate>2020-08-14T17:25:07.000Z</sf:LastViewedDate>
<sf:OwnerId>0052x000002DnNoAAK</sf:OwnerId>
<sf:PhotoUrl>/services/images/photo/0032x000006v0ALAAY</sf:PhotoUrl>
<sf:SystemModstamp>2020-08-14T17:25:07.000Z</sf:SystemModstamp>
</sObject>
</Notification>
</notifications>
</soapenv:Body>
The response from the webhook is
{
“success”: true
}
This is a JSON response, however, the response is expected to be a SOAP response.
Expected response:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<notificationsResponse xmlns="http://soap.sforce.com/2005/09/outbound">
<Ack>true</Ack>
</notificationsResponse>
</soapenv:Body>
</soapenv:Envelope>
Since the response is JSON the salesforce platform considers the event to have failed. The salesforce platform retries the failed events for 24 hours with exponential back-off. Thus, a lot of duplicate/redundant message get triggered.