Http response to a SOAP webhook request must be a SOAP response and not JSON

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.

Hi @Sharon_Kumar,

If I understand you problem correctly, you are looking for a way to have custom response (as expected SOAP response) when post request is made to webhook generate by your app? Am I correct?

Hey @Saif

yes thats what i’m looking for

The Developer has informed that errors are not being seen currently. Closing this issue for now. If any of you sees this error or similar, please feel free to create a new topic(and reference to this thread if helpful)

1 Like